Is there any way to build a linux software raid system without all drives?

by xenoterracide   Last Updated April 03, 2015 07:00 AM

I'm building a raid1 (ok it will probably be a raid10,f2 but the difference with 2 drives... isn't much) system with 2 1TB drives. However, 1 of the drives I've ordered is bad so I'm RMA-ing it. I'm wondering if I could partition and install to the 1 drive and then rebuild the array when I get the second drive (after I test it of course) My initial investigation doesn't show me a way of creating the array without specifying all devices... and the device the second drive will be is one that has data that I will need to migrate (plus it's not big enough). Is it possible that I could create an array without specifying all devices? or specify false ones and reconfigure to the right ones later? Or some other method I'm not thinking of.



Answers 1


mdadm will let you create a new array with a missing device. Name the drive / partition as "missing" in the mdadm command line, like, say:

mdadm --create /dev/md0 --level=raid1 --raid-devices=2 /dev/sda1 missing

You can add the second drive to the array when you get it back:

mdadm --manage /dev/md0 --add /dev/sdb1

Given that you've had one of these drives fail already I'd question the wisdom in using the other drive until you've got the first one back from RMA.

Evan Anderson
Evan Anderson
May 14, 2010 00:44 AM

Related Questions


write hole: which RAID levels are affected?

Updated April 16, 2017 21:00 PM



Linux RAID1 Software - grub resync after fail

Updated April 03, 2015 08:00 AM