Making A Clone Of An LVM-based EL5 Install

Home » CentOS » Making A Clone Of An LVM-based EL5 Install
CentOS 6 Comments

Does anybody here have any idea how to make an exact copy of a drive that has LVM partitions? I’m having trouble using dd to do this for an EL5 server.

We’re trying to diagnose a software problem of some kind and would like an exact, perfect copy of the software running so that we can see exactly what the problem is without disturbing our production copy. It’s been admin practice to set up a single server with the ideal image as desired, and then use DD to replicate that image to multiple hosts. We’ve done this a large number of times. The exact procedure followed is:

-) Perform typical file-level backups with rsync
-) Install additional HDD (hereafter sdb) as least a big as the HDD to be duplicated.
-) Boot off a CentOS install DVD with “linux rescue”
-) Where /dev/sda is the original drive and /dev/sdb is the new drive, run:
dd bs

6 thoughts on - Making A Clone Of An LVM-based EL5 Install

  • —– “Lists” escreveu:

    Hi,

    What about Clonezilla (www.clonezilla.org) or Mondo (www.mondorescue.org) ??

    But, I do it with dd too, and it works fine with LVM.

    Att.,

    Antonio.


    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    | Antonio S. Martins Jr. – Support Analyst | “Only The Shadow Knows |
    | Universidade Estadual de Maringá – Brasil| what evil lurks in the |
    | NPD – Núcleo de Processamento de Dados | Heart of Men!” |
    | E-Mail: asmartins@uem.br / shadow@uem.br | !!! Linux User: 52392 !!! |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    “Real Programmers don’t need comments — the code is obvious.”


    Esta mensagem foi verificada pelo sistema de antivirus e acredita-se estar livre de perigo.

  • The only reason that I can think of that would cause this is an initrd that doesn’t contain the driver for the whatever adapter the disk is attached to.

    Boot the rescue image and identify the adapter module. When you’ve identified it, go back to the live system and make a new initrd using
    “–with “. Don’t replace the existing initrd, just create a new one in /boot. If you then clone the disk, you should be able to boot the cloned disk to grub. Edit the kernel definition and change the path to the initrd, selecting the one you’ve created for the new system. It should boot properly, at which point you can replace the standard initrd path or fix grub’s configuration file.

    …and if you don’t want to clone the system again, you can just boot the rescue environment, chroot to the sysimage, and make the initrd there.

  • Hi Ben,

    Off-list as Antonio had the same message, but I would HIGHLY recommend CloneZilla; it would only back up the used portion of the drive unlike dd (which would save you a lot of time), and it hasn’t failed me yet in
    5 years. I recommend the “alternative-stable” release; it has more drivers.

    http://sourceforge.net/projects/clonezilla/files/clonezilla_live_alternative/20130314-quantal/clonezilla-live-20130314-quantal-i386.iso/download

    (this is unrelated to the issue you fixed; clonezilla’s image would also be missing the sata_nv driver)

    -xrx

LEAVE A COMMENT