gparted live CD can't resize a partition?

12,202

The process appears to be:

  1. create a new partition in your newly available free space; your choice of filesystem doesn't much matter, as we will change it later
  2. reboot into the system
  3. use cfdisk to flag the new partition as Linux LVM instead of whatever you chose above
  4. use pvcreate to flag your new partition as a physical volume for LVM
  5. use vgextend to add your new physical volume to your existing VolumeGroup
  6. use lvresize to expand your desired logical volume with the new space in its volume group
  7. use resize2fs to grow your fs to use the new space on your logical volume (I hope your filesystem supports online resizing)
  8. enjoy your now-spacious VM.
Share:
12,202

Related videos on Youtube

Hank Gay
Author by

Hank Gay

Updated on September 18, 2022

Comments

  • Hank Gay
    Hank Gay over 1 year

    I recently ran out of space on a VirtualBox VM (CentOS guest) managed by Vagrant. It was using a .vmdk image, so I couldn't dynamically resize it. Following these instructions, I cloned the old image to a new, much larger vdi image, then attempted to resize the old partition using the GParted LiveCD. Unfortunately, even though I can see that the backing device is much larger, the partition (which is managed by LVM, since it is a CentOS guest) is displayed with a lock icon, and I can't resize it. I don't understand why the partition is locked: I'm using a LiveCD, so the FS is shouldn't be mounted (at least as I understand these things). Any suggestions on what I've done wrong? Thanks.

    • nwaltham
      nwaltham almost 12 years
      I think your issue is that GParted doesnt manage LVM partitions. I am not sure how to solve this, but I think you may need to create another regular (extended) partition from the free space, add it to the volume group, then extend your LVM volume to cover the created space, and then finally extend the file system. Essentially a manual process with command line tools.
    • Hank Gay
      Hank Gay almost 12 years
      @user859955 GParted still doesn't handle LVM partitions? :-( Thank you very much.
  • psusi
    psusi almost 12 years
    Rather than create a new partition, you should use use parted or fdisk in sector mode to delete the existing partition, and recreate it with the exact same starting sector, but a larger size. Then run pvresize to extend the pv, and then you can use lvresize and resize2fs.