I needed to re-arrange some disk space. I explained the situation in Rants and Revelations » Why didn’t I use LVM on everything? with a table showing the current layout and everything. At the time, my plan was:
- Migrate the content of
/dev/hdc3
off using“pvmoveâ€
and“vgreduceâ€
. - Delete all three partitions on
/dev/hdc3
and add it back to thevg
using“pvcreate /dev/hdc; vgextend xen-space /dev/hdcâ€
. - Migrate the content of
/dev/hde2
off using“pvmoveâ€
and“vgreduceâ€
. - Delete the
/dev/hde2
partition and increase the disk of/dev/hde1
to fill up the drive, and useresize2fs
to make/dev/hde1
use the whole partition.
I did steps 1-3, and it all worked perfectly. I didn’t have to shut down anything, and it didn’t interrupt the normal operation of either the dom0 or the domUs. But when I’d done that, I realized I actually had enough free space on the lv that I could do an even better plan:
- Set up a 250Gb
lv
. - Use rsync to copy everything from
/dev/hde1
to the lv
. - Once that was done, shut down domU 1.
- Make
/dev/hde1
part of thelv
. - Make the 250Gb
lv
bigger usinglvextend
– I chose to add 100Gb to it, and I have space to add more if I need it. - “
e2fsck -f
” and “resize2fs
” thelv
. - Restart the domU 1, using the
lv
instead of/dev/hde1
.
This worked perfectly. The domU was down about 10-15 minutes tops. /dev/hde is still partitioned into two partitions, even though both partitions are part of the same vg
. But other than that, it’s exactly what I’d have done if I were setting it up from scratch now.