Linux VM not detecting change in ZVOL size

lell186

Dabbler
Joined
Nov 11, 2021
Messages
12
I am trying to resize my Linux VM's disk (ubuntu 22.04) and have followed this guide successfully in the past: link.

Instead of following that guide exactly I accidentally increased the size of the ZVOL before shutting down the VM. Now when I restart the VM and run 'print' inside 'parted' the changes are not detected. What is the best way to 'reset' this so that the VM understands the virtual disk has increased in size?

Thanks in advance for anyone who is able to help me out with this.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
You need to manually use the resize command in parted to make the partition take up the whole space.
 

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
Your ZVOL is just a physical disk the way your VM guest OS sees it. It then creates partitions on that virtual disk, which is going to also need to be resized.

From my experience, Linux installers tend to stick a swap partition at the end of the disk, so you may need to remove that swap partition first before you can resize your primary partition up.

You can boot into the live environment and use GParted to edit the partition table. The process of enlarging (should be) fairly harmless, but be aware that anytime you muck around with the partition table, there is always a risk of data loss, so uh... have backups before you do this.... or actually, just snapshot the VM before you do anything.
 
Last edited:

lell186

Dabbler
Joined
Nov 11, 2021
Messages
12
Ahh I realised what I was doing wrong now - not following the instructions (again)! When i was running parted I was using /dev/vda3 instead of /dev/vda and so I wasn't getting the expected result or options. All resolved now.
 
Top