[mythtv-users] Migrating LVM partition?

Tony Brummett brummett at gmail.com
Wed Dec 5 17:58:02 UTC 2007


On 12/5/07, Craig Huff <huffcslists at gmail.com> wrote:
> How do I go about moving the /video partition, which is currently
> in an LVM on the old drive onto the new drive in a normal ext3
> partition and convert the LVM partition into a normal ext3 partition
> for other file storage?

Assuming the new drive is at least as big as the old one, there's a
couple of different ways to get there...

If you want to have it all live as you're working (though you'll
probably need to shut down to add the new drive), then you can do
something like this
1) Create an LVM autodetect partition on the new drive
2) pvcreate the new partition to make it a PV
3) vgextend to add the new PV to the volume group
4) pvmove the data from the old disk
5) pvremove the old disk from the volume group
At this point, you can lvextend and grow the LV and filesystem with
/video.  The old drive can be repartitioned however you like

A more straightforward way might be to start with your original plan
to make a new, empty partition/volume-group/filesystem for new_video/
on the new disk.  It doesn't necessarily have to be booted from a
rescue CD, just that the backend isn't running while the copy is going
on.  At this point, you have the old data mounted at /video/, and a
new filesystem mounted at /new_video/.  Copy all the data with
something like:
cd /video; tar cf - * | ( cd /new_video; tar vxf -)

Then you can unmount both filesystems, change /etc/fstab so /video is
associated with the new LV device.

-- Tony


More information about the mythtv-users mailing list