参考:https://blog.csdn.net/think_nothing/article/details/53788524
1、虚拟机扩容
D:VirtualBox VMs>VBoxManage list hdds
UUID: f69aee89-bdb3-4337-9ec3-6231b97e981e
Parent UUID: base
State: created
Type: normal (base)
Location: D:VirtualBox VMsESP8266_lubuntuESP8266_lubuntu-disk1.vdi
Storage format: vdi
Capacity: 8192 MBytes
Encryption: disabled
UUID: 1ce8cdcb-22d2-42a4-90c5-1cd6214f34bb
Parent UUID: base
State: created
Type: normal (base)
Location: D:VirtualBox VMslubuntulubuntu1804.4-disk001.vdi
Storage format: vdi
Capacity: 61440 MBytes
Encryption: disabled
D:VirtualBox VMsESP8266_lubuntu>VBoxManage modifyhd ESP8266_lubuntu-disk1.vdi --resize 16384
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
2、分区 sudo fdisk /dev/sda 按步骤进行分区
3、格式化 sudo mkfs -t ext4 /dev/sda4
4、挂载 创建目录 /home/esp8266/sda4
sudo mkdir sda4
将分区 /dev/sda4 挂载到 /home/esp8266/sda4
sudo mount /dev/sda4 /home/esp8266/sda4
5、
开机自动挂载,则修改/etc/fstab文件,在这个文件里面添加一行:
使用vim命令编辑/etc/fstab文件
sudo vim /etc/fstab
增加如下一行代码
/dev/sda4 /home/esp8266/sda4/ ext4 defaults 0 1