1. Run in cmd
Vboxmanage modifyhd D: \ My database \ Documents \ virtualbox VMS \ Ubuntu \ ubuntu. VDI -- resize 61440
Error syntax error: Invalid parameter 'vms \ Ubuntu \ ubuntu. vdi'
It turns out that the path cannot contain spaces, so the folder virtualbox VMS is changed to virtualboxvms
Run the preceding command again.
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
OK. Change the folder name back.
2. After starting the virtual machine, you also need to use the gparted-gnome partition Editor tool to initialize the New Extended partitions. Otherwise, the system will not recognize the new extended space.
You can install sudo apt-Get install gparted In ubuntu. The tool is a graphical interface. Easy to use. After setting, click "edit"> "apply all operations" to initialize the extended disk.
Write down the partition name/dev/sda3
3. Sudo-I enables the root user to run
lvm pvcreate/dev/sda3
4. Run vgextend xubuntu-VG/dev/sda3 to add/dev/sda3 to the volume group xubuntu-VG (volume group view command vgdisplay)
vgextend xubuntu-vg /dev/sda3
5. Run lvresize-L + 100% free/dev/mapper/xubuntu -- VG-root to expand the root volume group under the volume group xubuntu-VG.
lvresize -l+100%FREE /dev/mapper/xubuntu--vg-root
6. Execute resize2fs/dev/mapper/xubuntu -- VG-root to reset the file system.
resize2fs /dev/mapper/xubuntu--vg-root
7. Run DF-h-t to verify the disk capacity expansion.
df -h -T
Virtualbox Virtual Disk resizing