Relayout LVM Disk

Posted by Tom on Server Fault See other posts from Server Fault or by Tom
Published on 2012-06-02T11:40:04Z Indexed on 2012/06/02 16:43 UTC
Read the original article Hit count: 201

Filed under:
|
|

I have an Ubuntu 11.10 system with two 500GB disks. The partition tables look like this:

/dev/sda1      primary   465.52GB
/dev/sda2      extended  243.17MB
  -> /dev/sda5 logical   243.14MB
/dev/sdb1      primary   465.76GB

sda1 and sdb1 are in a single LVM physical volume group containing a single logical volume containing a single logical filesystem which is mounted as /. sda5 is mounted as /boot.

The problem comes when I want to upgrade to Ubuntu 12.04, which requires at least 247MB free on /boot. So I need to reduce the size of sda1 so that I can increase the size of sda2 and sda5. How the heck do I do that? I can find how to shrink the logical volume group, but I'm not at all clear on how to clear out the end part of sda1 so that I can reduce the physical volume group. Does pvresize just deal with this automagically? Or is that wild wishful thinking?

I guess the alternatives are to back everything up onto something or other and recreate the thing from scratch or find out whether GRUB2 supports using LVM for /boot.

© Server Fault or respective owner

Related posts about lvm

Related posts about disk