From the mdadm man page:
“When creating a RAID5 array, mdadm will automatically create a degraded array with an extra spare drive. This is because building the spare into a degraded array is in general faster than resyncing the parity on a non-degraded, but not clean, array. This feature can be overridden with the –force option.”
So I have 4 hard drives I’m going to want to drop into an array… The howto I’m using specifies to use one of them as the ‘spare’…
mdadm –create –verbose /dev/md0 –level=5 –raid-devices=3 /dev/sdb1 /dev/sdc1 /dev/sdd1 –spare-devices=1 /dev/sde1
What I don’t understand is why this occurs, my assumption is that I would end up with a 3 drive array and a hot spare… What if I don’t want that and I want a 4 drive array, I see that I can do that with the -force option…
I’m just wondering why this is the default and if I’m missing anything…
Thanks in advance.
That behavior (using a spare) should really be invisible to you; what it’s saying there is that it’s going to do some drive building trickery, and instead of sweeping the disks and building the parity channel up during the build (slow!), it’s going to build the array on three devices and throw the last device in after the fact, to do the parity build in the background.
Your suspicion about the problem with the command as you have it is dead on. If you run that, it’ll generate a 3-disk array on 2 disks, then add the third disk from being the temporary hot-spare into the array.. leaving you with, still, a hot spare at the end of it.
You’ll want this, instead; mdadm will still do its trickery with the hot-spare, but it’ll be invisible to you (you’ll see in
/proc/mdstat after the creation, that it’ll immediately jump into the process of loading data onto the 4th disk):
mdadm --create --verbose /dev/md0 --level=5 --raid-devices=4 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1
Leave a comment
- What is the easiest way to upgrade my existing Perl 5.14 to Perl 5.16 on FreeBSD 9 using the ports system?
- Know if mysql has done its job
- Redirect https .com to https .co.uk without a valid SSL cert on .com without DNS change
- Why is it a bad idea to use customer email as from address
- 100% packets dropped on first RX queue on 3/5 raid6 iSCSI NAS devices using intel igb (resolved)