I have a RAID 5 array built from partitions on 5 drives - /dev/sda1, /dev/sdb1, /dev/sdc1, /dev/sdd1, and /dev/sde1. When I assemble the array manually, it works fine.
Unfortunately, there seem to also be superblocks on /dev/sdb and /dev/sdc (probably something I messed up early on), and when the array assembles automatically at startup, it builds with /dev/sdb instead of /dev/sdb1 (the same with /dev/sdc), and fails to mount (with an invalid fs error).
$ sudo mdadm --assemble --scan --force (presumably what happens on startup)
mdadm: WARNING /dev/sdb1 and /dev/sdb appear to have very similar superblocks.
If they are really different, please --zero the superblock on one
If they are the same or overlap, please remove one from the
DEVICE list in mdadm.conf.
$ sudo mdadm --detail /dev/md7
/dev/md7:
Version : 00.90
Creation Time : Wed Apr 6 18:17:07 2011
Raid Level : raid5
Array Size : 7814047744 (7452.06 GiB 8001.58 GB)
Used Dev Size : 1953511936 (1863.01 GiB 2000.40 GB)
Raid Devices : 5
Total Devices : 5
Preferred Minor : 7
Persistence : Superblock is persistent
Update Time : Sat Apr 30 13:55:50 2011
State : clean
Active Devices : 5
Working Devices : 5
Failed Devices : 0
Spare Devices : 0
Layout : left-symmetric
Chunk Size : 64K
UUID : 224009a1:e4173bf3:2490f10a:1455ce9c (local to host ravenscar)
Events : 0.2
Number Major Minor RaidDevice State
0 8 1 0 active sync /dev/sda1
1 8 16 1 active sync /dev/sdb
2 8 32 2 active sync /dev/sdc
3 8 48 3 active sync /dev/sdd1
4 8 65 4 active sync /dev/sde1
$ sudo mdadm --examine /dev/sdb
/dev/sdb:
Magic : a92b4efc
Version : 00.90.00
UUID : 224009a1:e4173bf3:2490f10a:1455ce9c (local to host ravenscar)
Creation Time : Wed Apr 6 18:17:07 2011
Raid Level : raid5
Used Dev Size : 1953511936 (1863.01 GiB 2000.40 GB)
Array Size : 7814047744 (7452.06 GiB 8001.58 GB)
Raid Devices : 5
Total Devices : 5
Preferred Minor : 7
Update Time : Wed Apr 27 21:15:03 2011
State : clean
Active Devices : 5
Working Devices : 5
Failed Devices : 0
Spare Devices : 0
Checksum : f83035d3 - correct
Events : 2
Layout : left-symmetric
Chunk Size : 64K
Number Major Minor RaidDevice State
this 1 8 17 1 active sync /dev/sdb1
0 0 8 1 0 active sync /dev/sda1
1 1 8 17 1 active sync /dev/sdb
2 2 8 33 2 active sync /dev/sdc
3 3 8 49 3 active sync /dev/sdd1
4 4 8 65 4 active sync /dev/sde1
Then I do:
$ sudo mdadm --stop /dev/md7
$ sudo mdadm --assemble /dev/md7 /dev/sd[abcde]1
And then it works.
My question: Is it safe to use the --zero-superblock option to remove those erroneous superblocks? what other measures should I take? Did I make the right choice building the array with partitions instead of drives (/dev/sda1 instead of /dev/sda, and so on).
/mdadm --examine /dev/sdband/mdadm --examine /dev/sdb1show? – sciurus Apr 30 '11 at 17:36