Consider the following simple RAID1 setup. I have the following two physical disks (lsblk output):
sdb 8:16 0 3.7T 0 disk sdc 8:32 0 3.7T 0 disk
I created the array with the following command:
# mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb /dev/sdc
This gave me /dev/md0, which I created a file system on and started using.
I then did init 0 and started the machine again the next day.
Now I'm faced with the problem of assembling the array again.
I do this:
# mdadm --assemble /dev/md0 /dev/sdb /dev/sdc mdadm: /dev/md0 has been started with 1 drive (out of 2).
[ 493.602864] md: kicking non-fresh sdb from array! [ 493.602869] md: unbind<sdb>
Nothing else is wrong in dmesg. These are brand new disks too, no I/O errors.
I do a bit of googling and find this:
So I issue:
# mdadm /dev/md0 --add /dev/sdb mdadm: added /dev/sdb
[ 570.743137] RAID1 conf printout: [ 570.743142] --- wd:1 rd:2 [ 570.743146] disk 0, wo:1, o:1, dev:sdb [ 570.743148] disk 1, wo:0, o:1, dev:sdc [ 570.743265] md: recovery of RAID array md0 [ 570.743268] md: minimum _guaranteed_ speed: 1000 KB/sec/disk. [ 570.743269] md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for recovery. [ 570.743271] md: using 128k window, over a total of 3906887360k.
And indeed, it is now rebuilding the array, for no apparent reason.
cat /proc/mdstat Personalities : [raid1] md0 : active raid1 sdb sdc 3906887360 blocks super 1.2 [2/1] [_U] [>....................] recovery = 0.0% (2137216/3906887360) finish=334.9min speed=194292K/sec unused devices: <none>
What am I doing wrong?
Did I issue the wrong commands? Should I have stopped the array before doing init 0? Why is it rebuilding an array that is not broken?