[Ma-linux] cloning logical volumes
Przemek Klosowski
przemek.klosowski at nist.gov
Wed Oct 7 13:11:17 EDT 2009
On 10/06/2009 05:42 PM, James Ewing Cottrell 3rd wrote:
> You could also mirror the data, then throw away the old disk, recovering
> from the second.
>
> But heck, how about just making a snapshot, and then rsyncing the
> snapshot to another LVM filesystem?
The scenario I am considering is a single system with a failing drive,
where you physically add a second drive, copy/clone, and pull the
original one out. Syncing the snapshot will result in a duplicate PV ID
and LVM will get confused and complain and might start writing to the
random PV, unless you took care of disabling/deactivating it, which is
tricky because if you do it before copying, the copy will have been
disabled itself so you will have to somehow enable it before it can
start after removing the original drive.
Bonus points will be awarded to a solution that copies the boot
environment in a way that makes the second disk directly bootable.
Of course 'dd' of the initial part of the disk with boot sectors,
partition table and the first /boot partition works, unless there
is some dark magic involved with the geometry of both drives (remember,
during boot BIOS is doing the I/O at least initially, and traditionally
BIOSes access the disk by CHS not by LBN)
I think Aaron's pvmove is the right way to go; I am going to test that
on some local loopmounted PVs.
More information about the Ma-linux
mailing list