I have been tasked with the job of creating a backup machine for a business-critical server. I'll only have a small window of opportunity to do this, over the holidays - the box is usually running 24/7.
My first idea was to boot a live CD with ddrescue, then clone the disk to an image on a USB drive, bring the drive back to the office and prepare a backup machine from that.
Unfortunately on closer examination it turns out that the server has five hard drives, arranged in a RAID5 configuration:
[root@sonic ~]# cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4]
md0 : active raid5 sde1 sdd1 sdc1 sdb1 sda2
141820928 blocks level 5, 256k chunk, algorithm 2 [5/5] [UUUUU]
unused devices: <none>
[root@sonic ~]# cat /etc/fstab
/dev/VolGroup00/LogVol00 / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/VolGroup00/LogVol01 swap swap defaults 0 0
So here's my revised idea. I won't be able to test this unfortunately - I can't bring the server down, and I don't have another box with a RAID5 config to play with.
My idea is to bring the server up using a live CD with mdadm and ddrescue on, then do
mdadm --assemble --scan
.. I'm hoping that this will assemble the array (as md0, presumably) so that I can then take an image of /dev/md0 to a file on a USB drive (I'll use ddrescue).
Back at base, I can transfer the image to the root disk of the backup machine, tinker with its fstab using a live CD so that it's not expecting a metadevice, and I think I should have a working copy of the server, ready to boot up in case of disaster.
Anyone tried something similar? Can anyone see a flaw in this plan? As I say, I can't test it at the moment and I've never tried it before, so I'm grateful for any comments.