{"id":3694,"date":"2019-07-19T23:44:53","date_gmt":"2019-07-19T20:44:53","guid":{"rendered":"https:\/\/kifarunix.com\/?p=3694"},"modified":"2019-07-20T08:49:59","modified_gmt":"2019-07-20T05:49:59","slug":"resize-root-partition-of-virtualbox-vm-snapshot","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/resize-root-partition-of-virtualbox-vm-snapshot\/","title":{"rendered":"Resize Root Partition of VirtualBox VM Snapshot"},"content":{"rendered":"\n
You are running a virtual machine on a VirtualBox with multiple snapshots and you want to resize the root partition of the specific partition without losing data? Well, this guide on how to resize root partition of VirtualBox VM snapshot using the Gparted Live CD.<\/p>\n\n\n\n
GParted is a free partition manager that enables you to resize, copy, and move partitions without data loss. It is however a good practise have a backup just in case things go south. Navigate to the Gparted Downloads<\/a> page and download it. You can simply use wget.<\/p>\n\n\n\n To resize a root partition of a Virtual Machine containing the snapshot whose root partition you want to resize, you need to power that VM off. Well, you can power off the VM from the VirtualBox interface or simply use the vboxmanage<\/strong> command as shown below;<\/p>\n\n\n\n Replace VM_NAME<\/strong> with the name of the virtual machine in question.<\/p>\n\n\n\n Open the Virtual Media Manager and find the name of the virtual machine snapshot whose root partition is to be resized. <\/p>\n\n\n\n Once you have identified the name of the virtual machine snapshot to resize, proceed to resize the disk. Snapshots are located on the snapshots folder.<\/p>\n\n\n\n The original disk size is 12GB and we have resized it to 30GB<\/p>\n\n\n\n Next, attach the GParted Live CD iso to your vm with a snapshot to be resized.<\/p>\n\n\n\n Once you have attached the iso, set the boot order such that optical<\/strong> disk comes first.<\/p>\n\n\n\n start your virtual machine.<\/p>\n\n\n\n When the virtual machine starts, let it boot with GParted Live default settings.<\/p>\n\n\n\n Select your keymap, your preferred language and continue to startx to use Gparted automatically.<\/p>\n\n\n\n As you can see, the unallocated space is 18GB.<\/p>\n\n\n\n To resize the root partition to unallocated space, we are going to first delete the extended and swap<\/strong> partition. Hence, right click and delete it.<\/p>\n\n\n\n Next, right click on the root partition, in this case, it is \/dev\/sda<\/strong> and select resize and set the new partition size.<\/p>\n\n\n\n Click resize to extend the partition size. After that, click the tick to save the changes.<\/p>\n\n\n\n You should now have resized your disk.<\/p>\n\n\n\n Poweroff the virtual machine and detach the Gparted Live CD iso and boot your system.<\/p>\n\n\n\n When the system boots, you can check the disk size by running the df -h<\/strong> command.<\/p>\n\n\n\n There you go. That is it on how to resize root partition of VirtualBox VM snapshot using the Gparted Live CD.<\/p>\n\n\n\n You can check our other articles by following the links below;<\/p>\n\n\n\n Install VirtualBox Guest Additions on Debian 10 Buster<\/a><\/p>\n\n\n\n Install Debian 10 Buster on VirtualBox<\/a><\/p>\n\n\n\n Install and Configure Endian Firewall on VirtualBox<\/a><\/p>\n\n\n\nwget https:\/\/downloads.sourceforge.net\/gparted\/gparted-live-1.0.0-3-amd64.iso<\/code><\/pre>\n\n\n\n
Poweroff the Virtual Machine<\/h3>\n\n\n\n
vboxmanage controlvm VM_NAME poweroff<\/code><\/pre>\n\n\n\n
Find the Name of the Snapshot<\/h3>\n\n\n\n
<\/a><\/figure>\n\n\n\n
Resize Root Partition of VirtualBox VM Snapshot<\/h3>\n\n\n\n
vboxmanage modifymedium disk VirtualBox\\ VMs\/debian9\/Snapshots\/{ff94f0a8-9695-4c6f-b3a9-39baba8e5566}.vdi --resize 30720<\/code><\/pre>\n\n\n\n
Attach GParted Live CD ISO<\/h3>\n\n\n\n
<\/a><\/figure>\n\n\n\n
<\/a><\/figure>\n\n\n\n
<\/a><\/figure>\n\n\n\n
<\/a><\/figure>\n\n\n\n
<\/a><\/figure>\n\n\n\n
<\/a><\/figure>\n\n\n\n
<\/a><\/figure>\n\n\n\n
df -h \/dev\/sda1<\/code><\/pre>\n\n\n\n
Filesystem Size Used Avail Use% Mounted on\n\/dev\/sda1 30G 1.9G 27G 7% \/<\/code><\/pre>\n\n\n\n