RAID-5arrays在重启时分裂(ubuntu)

我已经使用mdadm – v3.2.5 – 2012年5月18日在Ubuntu 13.04(kernel 3.8.0-27-generic)上build立了一个RAID-5arrays。它看起来工作得很好,精神很好:

$ cat /proc/mdstat Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] md0 : active raid5 sdb3[0] sdd1[3] sdc1[1] 2929994752 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU] unused devices: <none> 

然而,在重新启动时,数组被分割成两个单独的数组,看起来没有什么好的理由。 在启动时,我得到提示:

 *** WARNING: Degraded RAID devices detected. *** Press Y to start the degraded RAID or N to launch recovery shell 

我通常回答是,然后放到一个initramfs shell中,我立即退出。 一旦我回到系统本身,我的RAIDarrays已经被拆分了:

 $ cat /proc/mdstat Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] md0 : inactive sdb3[0] 1464997976 blocks super 1.2 md127 : inactive sdc[1] sdd[2] 2930275120 blocks super 1.2 

我也得到了相反的结果:

 $ cat /proc/mdstat Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] md127 : inactive sdb3[0] 1464997976 blocks super 1.2 md0 : inactive sdc[1] sdd[2] 2930275120 blocks super 1.2 

虽然sdc和sdd似乎已经形成了一个集团。 我可以重新组装数组,只需发出:

 $ mdadm --stop /dev/md0 $ mdadm --stop /dev/md127 $ mdadm -A /dev/md0 /dev/sdb3 /dev/sdc1 /dev/sdd1 

之后,我可以安装在md0上的LVM卷,并像没有任何事情发生(不重build或任何东西)。 但是,我真正喜欢的是不必经过这些步骤。 我的mdadm.conf文件包含以下行:

 ARRAY /dev/md0 metadata=1.2 UUID=e8aaf501:b564493d:ee375c76:b1242a82 

我从这个论坛post的build议中删除了这个名字。 运行细节和扫描产生这个:

 $ mdadm --detail --scan mdadm: cannot open /dev/md/mimir:0: No such file or directory ARRAY /dev/md0 metadata=1.2 name=turbopepper:0 UUID=e8aaf501:b564493d:ee375c76:b1242a82 

注意数组“mimir”。 这是我之前玩数组时的一个残留数组。 我不知道它是从哪里检测到的(它不在mdadm.conf中,在fstab中没有提及它)。 它可能需要去,但我不知道它来自哪里(它实际上可能是罪魁祸首)。

任何帮助将不胜感激,让arrays能够坚持通过重新启动而不干预。

为了以防万一,这里有更多的输出,可能会或可能不会有用。

 $ fdisk -l /dev/sdb /dev/sdc /dev/sdd Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes 255 heads, 63 sectors/track, 243201 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: 0x7f0e98a6 Device Boot Start End Blocks Id System /dev/sdb1 2048 499711 248832 fd Linux raid autodetect /dev/sdb2 499712 976771071 488135680 fd Linux raid autodetect /dev/sdb3 976771072 3907029167 1465129048 fd Linux raid autodetect Disk /dev/sdc: 1500.3 GB, 1500301910016 bytes 81 heads, 63 sectors/track, 574226 cylinders, total 2930277168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00052c9c Device Boot Start End Blocks Id System /dev/sdc1 2048 2930277167 1465137560 fd Linux raid autodetect Disk /dev/sdd: 1500.3 GB, 1500301910016 bytes 81 heads, 63 sectors/track, 574226 cylinders, total 2930277168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000bd694 Device Boot Start End Blocks Id System /dev/sdd1 2048 2930277167 1465137560 fd Linux raid autodetect 

我想在sdc和sdd在一起分裂的原因是他们是相同的驱动器。

 $ cat /etc/mdadm/mdadm.conf # mdadm.conf # # Please refer to mdadm.conf(5) for information about this file. # # by default (built-in), scan all partitions (/proc/partitions) and all # containers for MD superblocks. alternatively, specify devices to scan, using # wildcards if desired. #DEVICE partitions containers # auto-create devices with Debian standard permissions CREATE owner=root group=disk mode=0660 auto=yes # automatically tag new arrays as belonging to the local system HOMEHOST <system> # instruct the monitoring daemon where to send mail alerts MAILADDR root # definitions of existing MD arrays ARRAY /dev/md0 metadata=1.2 UUID=e8aaf501:b564493d:ee375c76:b1242a82 # This file was auto-generated on Sun, 08 Dec 2013 00:39:01 -0500 # by mkconf $Id$ 

其中一个分区,可能是sdb3,对于由启动时由mdadm扫描的“mimir”数组,仍然有一个旧的超级块。 应该通过发行来解决

 mdadm --zero-superblock /dev/sdb3 

然后读取分区到arrays。