I have a 3 disk RAID5 mdadm array total 4TB on an Ubuntu Server 14.04.3 LTS.
Since a kernel panic caused by a device unrelated to the array and that has been already replaced, after every reboot the array starts [UU_] So I always have to run mdadm --add /dev/md0 /dev/sdd1
and it starts rebuilding and it does rebuild successfully.
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md0 : active raid5 sdd1[4] sdb1[3] sdc1[1]
3906763776 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU]
unused devices: <none>
But I have to do it every reboot and I noticed that the disk numbers seem wrong: 4, 3 and 1 instead of 2, 1 and 0.
root@Bt-Networks-Server:~# mdadm --detail /dev/md0
/dev/md0:
Version : 1.2
Creation Time : Fri Aug 1 00:53:53 2014
Raid Level : raid5
Array Size : 3906763776 (3725.78 GiB 4000.53 GB)
Used Dev Size : 1953381888 (1862.89 GiB 2000.26 GB)
Raid Devices : 3
Total Devices : 3
Persistence : Superblock is persistent
Update Time : Mon Oct 26 17:40:43 2015
State : clean
Active Devices : 3
Working Devices : 3
Failed Devices : 0
Spare Devices : 0
Layout : left-symmetric
Chunk Size : 512K
Name : Bt-Networks-Server:0 (local to host Bt-Networks-Server)
UUID : 4e860a9e:0b433a00:54d2c991:78ca3d15
Events : 83137
Number Major Minor RaidDevice State
4 8 49 0 active sync /dev/sdd1
1 8 33 1 active sync /dev/sdc1
3 8 17 2 active sync /dev/sdb1
I also found the following information on dmesg about kicking non-fresh disk:
[ 2.430966] md: raid1 personality registered for level 1
[ 2.500019] raid6: sse2x1 3900 MB/s
[ 2.568110] raid6: sse2x2 4957 MB/s
[ 2.582322] md: bind<sdc1>
[ 2.583992] md: bind<sdd1>
[ 2.608030] usb 6-2: new low-speed USB device number 2 using uhci_hcd
[ 2.619248] md: bind<sdb1>
[ 2.620098] md: kicking non-fresh sdd1 from array!
[ 2.620103] md: unbind<sdd1>
[ 2.636013] raid6: sse2x4 6926 MB/s
[ 2.636015] raid6: using algorithm sse2x4 (6926 MB/s)
[ 2.636017] raid6: using ssse3x2 recovery algorithm
[ 2.637624] xor: measuring software checksum speed
[ 2.664021] usb 7-1: new low-speed USB device number 2 using uhci_hcd
[ 2.676012] prefetch64-sse: 10026.000 MB/sec
[ 2.716011] generic_sse: 8868.000 MB/sec
[ 2.716013] xor: using function: prefetch64-sse (10026.000 MB/sec)
[ 2.717321] async_tx: api initialized (async)
[ 2.725129] md: raid6 personality registered for level 6
[ 2.725131] md: raid5 personality registered for level 5
[ 2.725133] md: raid4 personality registered for level 4
[ 2.728509] md: export_rdev(sdd1)
[ 2.729556] md/raid:md0: device sdb1 operational as raid disk 2
[ 2.729559] md/raid:md0: device sdc1 operational as raid disk 1
[ 2.729927] md/raid:md0: allocated 0kB
[ 2.729976] md/raid:md0: raid level 5 active with 2 out of 3 devices, algorithm 2
[ 2.729983] RAID conf printout:
[ 2.729984] --- level:5 rd:3 wd:2
[ 2.729986] disk 1, o:1, dev:sdc1
[ 2.729988] disk 2, o:1, dev:sdb1
[ 2.730030] md0: detected capacity change from 0 to 4000526106624
[ 2.731863] md: raid10 personality registered for level 10
[ 2.755618] md0: unknown partition table
[ 2.812332] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
I have already rechecked mdadm.conf by updating:
root@Bt-Networks-Server:~# mdadm --detail --scan
ARRAY /dev/md/0 metadata=1.2 name=Bt-Networks-Server:0 UUID=4e860a9e:0b433a00:54d2c991:78ca3d15
saving to the config file and running update-initramfs -u
Is there any solution to avoid adding and rebuilding/resyncing the array every reboot?
Thanks!
EDIT:
This is the partition layout of /dev/sdd, the partition table type is MBR:
Disk /dev/sdd: 2000.4 GB, 2000398934016 bytes
81 heads, 63 sectors/track, 765633 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0xdda80ffc
Device Boot Start End Blocks Id System
/dev/sdd1 2048 3907029167 1953513560 fd Linux raid autodetect