Extended VM Disk In VirtualBox or VMware


First, Clean VM all snapshot, and poweroff your VM.

vmdk:

vmware-vdiskmanager -x 16GB myDisk.vmdk

vdi:

VBoxManage modifyhd <absolute path to > --resize <size  MB>

 

And now, go to guest OS to resize partition.

I have only one partition, and it's root partition. You can use LiveCD do this. However, You alse use fdisk and resize2fs, that support online mode.

fdisk /dev/sda

Delete old partition, and create new partition you want. Last, write to disk, reboot your VM. Then run:

resize2fs /dev/sda1

Now, you can check your partition size.

 -h

 

P.S.

I find Shell script on raspi-config. It's a script it is used for expand root filesystem on SD card.

! [ -h /dev/root ]; --msgbox =$( /dev/= [ = ]; --msgbox [ -ne ]; --msgbox =$(parted /dev/mmcblk0 -ms unit s p | -n | -f - [ != ]; --msgbox =$(parted /dev/mmcblk0 -ms unit s p | | -f - ] || return /dev/mmcblk0 <<= <<\EOF > /etc/init.d/resize2fs_once &&!/bin/---Start: --/lib/lsb/init- &&/dev/root && /etc/init.d/resize2fs_once &&-rc.d resize2fs_once remove &&?* >& +x /etc/init.d/resize2fs_once &&-rc.d resize2fs_once defaults && [ = True ]; --msgbox View Code

 

[via]

[via]

 

相关内容