Linux – gparted (live usb) says the partition is mounted, but where

gpartedlinuxlvm

I'm attempting to grow /dev/sda5, which is an 'lvm2 pv' partition, but it's contained in /dev/sda2, which is an extended partition.

There is plenty of "unallocated" space immediately after /dev/sda2, since I've just cloned my previous disk to a larger one.

My plan is to resize the extended partition, and then resize the contained PV to match. Then I'll extend the VG and the filesystem.

So I've booted using a Linux Mint 17.1 USB stick and run gparted. It won't let me resize the extended partition, claiming that it's "Busy (At least one logical partition is mounted)".

However, running mount (or cat /proc/mounts) doesn't show anything other than the Live USB image mounted.

What's the problem?

Best Answer

Because the partition contains an LVM2 volume group, it's treated as busy (even if it doesn't appear mounted). You need to deactivate the VG:

sudo vgscan      # to discover the name of the volume group "mint-vg"
sudo vgchange -a n mint-vg

Then, in gparted, select GParted / Refresh Devices. This should remove the lock icon from the partitions.

Aside: rather than a lock icon, my copy of gparted displays a telephone, which is ... confusing.

At this point, you should be able to resize the extended partition, /dev/sda2 as normal to use the unallocated space. Apply the change.

Then resize the 'lvm2 pv' partition, /dev/sda5. Apply the change.

Then resize the PV:

sudo pvresize /dev/sda5

Check the new size:

sudo pvdisplay /dev/sda5

Reactivate the volume group:

sudo vgchange -a y mint-vg

Then extend the logical volume into the new space:

sudo lvextend /dev/mint-vg/root /dev/sda5

I forgot to specify -r to resize the filesystem, so I have to do that as well...

sudo e2fsck -f /dev/mint-vg/root
sudo resize2fs /dev/mint-vg/root
Related Question