格式化SD卡
查看SD卡设备接点,设备节点为/dev/sdb
sudo umount /dev/sdb*
sudo fdisk /dev/sdb
输入p 查看执行结果
键入“d”,然后输入 1,删除 1 分区
出现红色字体,表明已无存在的分区
创建第一个分区
开始创建第二个分区
现在输入“p”检查分区表,会看到刚刚创建的 2 个分区。如果没问题,键入“w”以写入到 SD
卡并退出
完成了分区创建后,就可以格式化分区了
sudo mkfs.vfat -F 32 -n boot /dev/sdb1
sudo mkfs.ext4 -L rootfs /dev/sdb2
需要等待一段时间
重新插拔读卡器,将文件放到指定分区
BOOT.BIN、boot.scr 和 image.ub 文件拷贝到名为 boot 的分区也即/dev/sdb1 分区中
cp BOOT.BIN image.ub boot.scr /media/aa/boot/
根据实际情况来
sudo dd if=rootfs.ext4 of=/dev/sdb2
sudo umount /dev/sdb2
sudo dd if=images/linux/rootfs.ext4 of=/dev/sdb2
sync
sudo resize2fs /dev/sdb2
sync
写入等很久
拷贝文件
cp BOOT.BIN boot.scr image.ub /media/aa/boot/
安装open-vm-tools
sudo apt install open-vm-tools
sudo apt install open-vm-tools-desktop
重新运行虚拟机
右下角切换模式
输入秘密登录
可以直接拖拽文件
# 问题
Welcome to fdisk (util-linux 2.37.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
This disk is currently in use - repartitioning is probably a bad idea.
It’s recommended to umount all file systems, and swapoff all swap
partitions on this disk.
sudo swapoff /dev/sdb*
swapon --show
Device Start End Sectors Size Type
/dev/sdb1 2048 2099199 2097152 1G Linux filesystem
/dev/sdb2 2099200 1048575966 1046476767 499G Linux filesystem
Command (m for help): w
The partition table has been altered.
Failed to remove partition 3 from system: Device or resource busy
Failed to update system information about partition 1: Device or resource busy
Failed to add partition 2 to system: Device or resource busy
df -h
==================
下面是你需要的!!!
设置静态IP
ifconfig eth0 192.168.100.88 netmask 255.255.255.0