dd and lvm

Rick Stevens rstevens at vitalstream.com
Wed Jan 18 21:43:12 UTC 2006


On Wed, 2006-01-18 at 11:19 -0700, redhat at buglecreek.com wrote:
> We have a few redhat ES-4 systems that were originally installed with
> lvm across two drives.  We would like to clone the hardrives using dd,
> but are not sure if if will work correctly since the drives were setup
> using lvm.  Normally I would just do something like the following: dd
> if=/dev/hda of=/backup/image.img and do the opposite to the new
> hardrive.
>  Can this be done with the current lvm setup on these systems?  Will
> something like this work: dd if=/dev/mapper/VolGroup00-LogVol00
> of=/backup/image.img?  Or maybe do each drive separately?

This can be ugly.  Ideally, you should put the new drives in the
system and make a separate volume group/logical volume from them and
mount it somewhere.  Then do a

	# cp -a /old/LVM/mountpoint /new/LVM/mountpoint

Once that's done, unmount the new LVM and do a "vgexport" of the volume
group involved.  Put the new drives on a system and do a "vgimport" to
import them.  See "man vgexport" and "man vgimport" for details.

The problem is that "dd" wants sequential data from a device and you've
got a "quasi" device here.  The new drives may not lay out the same
as the old ones.  It's best to try to copy the _filesystem_ data, not
the raw device data.

----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
-              Careful!  Ugly strikes 9 out of 10 people!            -
----------------------------------------------------------------------




More information about the Redhat-install-list mailing list