How to clone a RAID5 system

cloneddraid

I clone single disk systems by booting the master system to a CD and running…

dd if=/dev/sda | gzip - | ssh user@hostname dd of=image.gz

Then I boot the target system with the CD and run…

ssh user@hostname dd if=image.gz | unzip - | dd of=/dev/sda

I works great for simple single disk systems.

But now I'd like to perform a similar cloning of a 4 disk RAID5 system. I know that /dev/sda needs to change, but to what?

EDIT: The boxes are linux each with a software RAID.

Best Answer

Trying to clone the underlying partitions/drives used by the RAID will probably just result in problems.

I would probably follow a procedure like this.

  • On the original server
    • Boot your livecd/rescue environment
    • Make sure your RAID volumes are started.
    • Backup any filesystems/devices that are not part of your RAID volume (like your /boot)
    • Use DD to make a backup the block devices for your arrays.
  • On the Destination
    • Boot your livecd/rescue environment
    • Issue the required partitioning commands and mdadm commands to create the required filesystems and setup a RAID volume similar to the source server
    • Restore all volume backups to their respective locations.
    • Finally mount the filesystems and correct your /etc/mdadm/*, /etc/fstab, and any other configuration files that reference the UUID of the original array.
Related Topic