Why didn’t I use LVM on everything?

Due to a series of historical accidents, I have the following disk space layout:

Partition Size Use
Disk 1 – 250Gb
/dev/hda1 2Gb dom0 root
/dev/hda2 2Gb dom0 swap
/dev/hda3 Rest part of vg “xen-space”
Disk 2 – 250Gb
/dev/hdc1 2Gb formerly dom0 root – unused
/dev/hdc2 1Gb formerly dom0 swap – unused
/dev/hdc3 Rest part of vg “xen-space”
Disk 3 – 400Gb
/dev/hde1 300Gb mounted as /dev/hdb on a domU
/dev/hde2 Rest part of vg “xen-space”

The root partitions of the three domUs are all lvs on vg “xen-space”. There is over 250Gb free on the vg.

What I would like to do is clean up the second drive to get rid of the extraneous partitions, and to grow the partition on /dev/hde1 to the full disk. So what I’m thinking of doing is the following:

  1. Migrate the content of /dev/hdc3 off using “pvmove” and “vgreduce”.
  2. Delete all three partitions on /dev/hdc3 and add it back to the vg using “pvcreate /dev/hdc; vgextend xen-space /dev/hdc”.
  3. Migrate the content of /dev/hde2 off using “pvmove” and “vgreduce”.
  4. Delete the /dev/hde2 partition and increase the disk of /dev/hde1 to fill up the drive, and use resize2fs to make /dev/hde1 use the whole partition.

The problem is that I don’t know if I can do this stuff without shutting down the domUs. And for the physical partition /dev/hde1, which is mapped to the /dev/hdb on one of my domUs, I don’t know if I have to shut down the domU or just umount it within the domU and remount it afterwards.

One thought on “Why didn’t I use LVM on everything?”

Comments are closed.