I created a mdadm-based RAID 5 from six hard drives using the following command:
# mdadm --create /dev/md0 --level=5 --raid-devices=5 \ /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1 \ --spare-devices=1 /dev/sdg1
I expected the array to have one hot spare, namely /dev/sdg1. However, checking
mdadm --detail shows 2 spares:
# mdadm --detail --scan ARRAY /dev/md0 metadata=1.2 spares=2 name=...
Also, the array size as shown by
df is 2 TB, which would correspond to only four of my 500 GB drives being used.
So what exactly is the semantics of
--spare-devices? The man page states that it "Specif[ies] the number of spare (eXtra) devices in the initial array.", but that does not seem to be the case here.