I stupidly created a dynamic disk when I created a VM. The disk has been converted to Fixed and the size upped to 20GB. I booted into a GParted live CD and extended the partition up to the maximum.

GParted screen shot

Through extensive Googling, I then executed the following commands in a terminal:

pvresize /dev/sda5
(reports 19.76GiB total/in use)

lvextend -l +100%FREE /dev/snoopy-vg/root
(4547 extents matches existing size)

resize2fs /dev/snoopy-vg/root
(open: no such file or directory while opening /dev/snoopy-vg/root)

If I try...

resize2fs /dev/sda5
(resize2fs: Bad magic number in super-block while trying to open /dev/sda5)

As you can see, the last command is obviously wrong. Once I boot into the VM proper, nothing has changed...

frank@snoopy:~$ df -H
Filesystem                   Size  Used Avail Use% Mounted on
/dev/mapper/snoopy--vg-root  6.0G  5.3G  359M  94% /

Is there some last step that I'm missing? What's the secret sauce?

  • Have you done lvchange -ay /dev/snoopy-vg/root ? Jul 22 '14 at 21:54

So... I just found the answer, mere seconds after posting this (ain't that always the way?!)

I booted into the VM, did a sudo su - and executed the following...

resize2fs /dev/snoopy-vg/root [number of available blocks]

I could have specified in various different ways (i.e. G for GB).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.