LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Create Single Disk Image from 5 disk RAID 5 setup? (https://www.linuxquestions.org/questions/linux-software-2/create-single-disk-image-from-5-disk-raid-5-setup-918314/)

slimjim 12-12-2011 06:54 AM

Create Single Disk Image from 5 disk RAID 5 setup?
 
Hi,

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:

Code:

[root@sonic ~]# cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4]
md0 : active raid5 sde1[4] sdd1[3] sdc1[2] sdb1[1] sda2[0]
      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
[root@sonic ~]#

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

Code:

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.

Cheers
James

_bsd 12-12-2011 11:08 AM

Since you seem to have most of your system on / as a logical volume, have you looked into logical volume snapshots?
/boot can easily be backed up a dozen different ways.

slimjim 12-13-2011 03:35 AM

Thanks for the reply - is it possible to take a logical volume snapshot to an external drive, then create a partition on a single drive from it?

_bsd 12-13-2011 05:34 AM

If size permits, yes.
When the logical volume snapshot was originally developed snapshots were written to tape devices.
Just pay close attention to sizes, the snapshot only has to be as big as the data actually being used.
Use the man pages and read up on any LVM command before using it.

I always suggest going through a trial, make a temp VG, LV, copy some small collection of files, take a snap shot, restore.
After you're comfortable with the process, and achieved success in practice, go ahead and perform the same with production data.
Don't practice with production data.


All times are GMT -5. The time now is 05:03 AM.