RAID故障后如何启动(软件RAID)?

以前我有一个使用( mdadm )驱动器sdasdb设置的软件raid。 sdb失败,重新启动系统的唯一方法是拔下第二个硬盘驱动器。

现在我已经添加了新的sdbsdc到我的RAID设置。 sda是最老的(所以最有可能失败),这是我们开车的驱动器(我想,我怎么检查?)。

我如何确保和testing(通过GRUBconfiguration等),如果sda失败,我仍然可以启动我的机器。

fdisk -l

 Disk /dev/sda: 250.0 GB, 250000000000 bytes 255 heads, 63 sectors/track, 30394 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000080 Device Boot Start End Blocks Id System /dev/sda1 * 1 30064 241489048+ fd Linux raid autodetect /dev/sda2 30065 30394 2650725 5 Extended /dev/sda5 30065 30394 2650693+ fd Linux raid autodetect Disk /dev/sdb: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0x00000000 Device Boot Start End Blocks Id System /dev/sdb1 * 1 30064 241489048+ fd Linux raid autodetect Partition 1 does not start on physical sector boundary. /dev/sdb2 30065 30394 2650725 5 Extended /dev/sdb5 30065 30394 2650693+ fd Linux raid autodetect Partition 5 does not start on physical sector boundary. Disk /dev/sdc: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0x00000000 Device Boot Start End Blocks Id System /dev/sdc1 * 1 30064 241489048+ fd Linux raid autodetect Partition 1 does not start on physical sector boundary. /dev/sdc2 30065 30394 2650725 5 Extended /dev/sdc5 30065 30394 2650693+ fd Linux raid autodetect Partition 5 does not start on physical sector boundary. Disk /dev/md0: 247.3 GB, 247284695040 bytes 2 heads, 4 sectors/track, 60372240 cylinders Units = cylinders of 8 * 512 = 4096 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Alignment offset: 512 bytes Disk identifier: 0x00000000 Disk /dev/md0 doesn't contain a valid partition table Disk /dev/md1: 2714 MB, 2714238976 bytes 2 heads, 4 sectors/track, 662656 cylinders Units = cylinders of 8 * 512 = 4096 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Alignment offset: 512 bytes Disk identifier: 0x00000000 Disk /dev/md1 doesn't contain a valid partition table 

这是一个老栗子。 简短的回答是,“grub-install”通常是软件RAID的错误答案。 这里有一个例子,我有一个3路RAID-1arrays。 / boot分区存储在/ dev / md0。 这将GRUB安装到每个磁盘,以便如果一个磁盘发生故障,可以从其他磁盘启动。

 # grub grub> find /grub/stage1 (hd0,0) (hd1,0) (hd2,0) grub> device (hd0) /dev/sda grub> root (hd0,0) grub> setup (hd0) grub> device (hd0) /dev/sdb grub> root (hd0,0) grub> setup (hd0) grub> device (hd0) /dev/sdc grub> root (hd0,0) grub> setup (hd0) grub> quit 

在未来的GRUB版本中,它更聪明,但CentOS 6 / RHEL 6仍旧装载了旧的GRUB。

testing:将grub.conf文件(在/ boot下)的“timeout = 5”值改为timeout = 30。 然后在重新启动系统之前交换两个驱动器的位置。 或者更改BIOS中硬盘的启动顺序。

(当然,确保你有很好的备份,并知道如何恢复到正确的configuration。在一次性系统上testing这是一个好主意。)