Ubuntu – Unable to resize LVM partition just after Ubuntu install with ‘use lvm’ option

12.10partitioning

During installation of Ubuntu 12.10 x64 I checked the "Use LVM" option. My partitions:

  • /dev/sda1, ext2, mount: /boot, 243.00 MiB, flag: boot
  • /dev/sda2, extended, 698.4 GiB
    • /dev/sda5, lvm2 pv, mount: ubuntu, 698.4 GiB, flag: lvm

Or better see a GParted screenshot (am not allowed to post images)

I've tried both with current system and a live USB Ubuntu, but I can't do anything with the LVM partition: nor add a new subpartition, neither resize it. Is there a way to shrink it so I can add more physical partitions? Or how do I add a new virtual subpartition to LVM? (No such menu option in GParted)

EDIT sudo pvs:

PV         VG     Fmt  Attr PSize   PFree
/dev/sda5  ubuntu lvm2 a--  698.39g    0 

sudo vgs:

VG     #PV #LV #SN Attr   VSize   VFree
ubuntu   1   2   0 wz--n- 698.39g    0 

sudo lvs:

LV     VG     Attr     LSize   Pool Origin Data%  Move Log Copy%  Convert
root   ubuntu -wi-ao-- 692.49g                                           
swap_1 ubuntu -wi-ao--   5.91g  

Best Answer

Here is a few bits of information I gathered regarding resizing LVM2 partitions based on my personal experience.

  1. First things first: G-Parted (currently version 16 / July 2013) is unable to extend or shrink LVM2 partitions... Just forget G-Parted at the time being.

  2. To date, the only GUI application able to resize LVM2 partition is "system-config-lvm" (sudo apt-get install system-config-lvm) but for some reason, I haven't been able to get much from it.

  3. Alternatively, it is possible to resize LVM2 partitions by using the appropriate command lines. More here > http://www.howtogeek.com/howto/40702/how-to-manage-and-use-lvm-logical-volume-management-in-ubuntu/ and there > http://www.tcpdump.com/kb/os/linux/lvm-resizing-guide/all-pages.html

  4. I am personally a fan of G-Parted, the usual fast & easy trick. I hope the next version will be able to resize LVM2 partitions all graphically. But in the meantime, the best thing I always do, and I really mean it, is NOT to install new Linux boxes with LVM2; but rather with Ext3 or Ext4 instead. This choice is given in the middle of the install process: just avoid doing the "OK / Next / Next" thing mindlessly as LVM2 will be picked up as the default partition system ^^ it is far better customizing the formatting method. So let's keep say 1024 Mb for the Swap Partition, and assign 10GB or more to the /dev/sda1 partition (the Ext3/4 one), on which "/" is the Mount Point.

This way, you may be able to use G-parted later on it if needed, with no limitation of any kind.

Edit 1 : if you desperately need to free some disk space on your FileSystem partition ASAP, logon your linux and type the following command : "du -sh *", which will display a list of all the directories and their size. This will help you identify the biggest folders at a glance and maybe move or remove static data.

Edit 2 : Latest news from the G-Parted Team (dated 2nd sept. 2013) : "

To resize LVM2 PV partitions, the volume must be deactivated. To do this, select the menu option "Partition --> Deactivate". When the LVM2 PV partition is deactivated, then the resize/move menu option will be enabled.

Since Logical Volume Management is not simply a file system, there are serious repercussions to changing the volume group name or UUID. Also problems will occur if the LVM2 PV is copied. That is why these operations are not supported for LVM2 PV."

Related Question