[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

creating images of RAID boxen?



For my work, I'm trying to create a system that will create and write disk images.  The way I'm currently doing this is by mounting the existing disk, copying everything in the filesystems on that disk to a directory using 'cp -a', then copying everything from that directory to a new disk by the same means, 'cp -a'.  And this works well when RAID isn't involved.  However, when I try and do this with a RAID setup (using md), I can't make the new disk boot in a machine (root filesystem is on the RAID).  It always complains about the wrong UUID. 

I've finally figured out that this UUID problem is coming from mdadm.conf inside the initramfs.  Trouble is, I'm not sure how to modify the initramfs.  I can pass it through gunzip and cpio and extract the files, and I can then change conf/mdadm.conf, create a cpio archive and gzip that.  But I'm not sure if that will work, and I don't really feel like trying right now.  I wonder if there's an easier way.

The machine that I'm trying to make a copy of it set up with RAID 1 on two disks.  There are six partitions per disk (four RAID autodetect, one extended, one swap).  Four RAID arrays.  I want to be able to store an image of that setup in such a way that I can take two empty disks, stick 'em in the machine with the image, work some mojo, put those disks in a brand-new box, turn on the box, and have the box come up as a clone of the original machine.  What's the best way for me to do this under Debian?

Kit Peters

Reply to: