[linux-lvm] Cloning Logical Volumes

Jed Donnelley jed at nersc.gov
Tue May 2 00:05:01 UTC 2006


At 03:21 PM 4/27/2006, Jonathan E Brassow wrote:
>dd is probably the best way right now.
>
>in the future, the clone would probably take the form:
>prompt> lvconvert -m1 vg/lv; (wait for sync); lvsplit vg/lv
>
>The syntax isn't worked out yet and lvsplit is not there yet... but 
>we have talked about doing something like that.
>
>brassow

One possibility that occurs to me is to use RAID-1 under LVM and then 
clone your LVM file system(s)
by splitting a software RAID-1 clone (e.g. MD driver).  Even if you 
don't want to pay the price of redundant
disks in your final system configuration, you can leave it with a 
single 1/2 RAID set with no loss of reliability
(over no RAID).  You can even do the RAID-1ing on a single disk if 
that has any potential value, but it's a bit
more difficult for me to see how you would separate the clone out that way.

Just a thought.  I use such RAID-1 cloning quite often and find it 
very convenient.  It seems to me it
would work fine in this case.  About the only thing I find I have to 
be careful of is to be sure that if
I'm cloning the /boot (or /root if it includes /boot) file system 
that I make sure the boot record is in
place (in my case running grub and writing the appropriate record on 
the appropriate disk before
splitting the RAID system for cloning).

I still don't trust LVM for recovering munged file systems (no 
effective mechanism for fsck if you
can't get to the LVM file system, init problems for RAID-10, etc. as 
mentioned previously on
this list) so I'm not using LVM at this time and haven't tested the 
above mechanism.  You're
mileage may vary.

>On Apr 26, 2006, at 5:55 PM, Greg Hartzog wrote:
>
>>Hello there folks.  I have a question.
>>
>>I am looking for a better way of cloning logical volumes then 
>>creating a new logical volume, identical to a source logical 
>>volume, and using "dd" to copy data between the two logical volumes.
>>
>>I would love to use dm-mirror to do this, but I do not think any 
>>interface has been provided to do this yet.
>>
>>All suggestions and ideas appreciated.
>>
>>I am running lvm2-2.02.04-r1 & 2.6.15 kernel.
>>
>>Thanks!
>
>--Jed http://www.nersc.gov/~jed/ 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/linux-lvm/attachments/20060501/44dadb9b/attachment.htm>


More information about the linux-lvm mailing list