Information Systems



How do I clone a linux software raid drive

BE CAREFUL BEFORE MESSING WITH sfdisk! MAKE SURE YOU KNOW WHAT YOU'RE DOING!

sfdisk -d /dev/sda | /dev/sdc
If above doesn't work, try with sdb


sfdisk -d /dev/sda > sda.out
sfdisk /dev/sda < sda.out

cat /proc/mdstat

mdadm /dev/md0 --add /dev/sda6

For instance
mdadm /dev/md1 --add /dev/sdc1 // boot
mdadm /dev/md0 --add /dev/sdc2 // big

sfdisk -l

If you want the second disk to boot, you need to deal with grub.

Use grub-install /dev/sda, /dev/sdb etc or else

following dependent on ide/hda,hdb, etc
grub
> device (hd0) /dev/hda
> root (hd0,0)
> setup (hd0)
> device (hd1) /dev/hdc
> root (hd1,0)
> setup (hd1)

for testing

raidsetfaulty /dev/md1 /dev/sdc2