我在生产中有一台Centos 5.4服务器,软件RAID1中有2个驱动器.
最后几天/ var / log / messages有很多消息,表明其中一个驱动器已准备好失败:
Sep 23 00:48:38 milkyway kernel: SCSI device sda: 1465149168 512-byte hdwr sectors (750156 MB) Sep 23 00:48:39 milkyway kernel: ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0 Sep 23 00:48:39 milkyway kernel: ata1.00: irq_stat 0x40000001 Sep 23 00:48:39 milkyway kernel: ata1.00: cmd 25/00:10:31:21:8c/00:00:28:00:00/e0 tag 0 dma 8192 in Sep 23 00:48:40 milkyway kernel: res 51/40:00:35:21:8c/00:00:28:00:00/e0 Emask 0x9 (media error) Sep 23 00:48:40 milkyway kernel: ata1.00: status: { DRDY ERR } Sep 23 00:48:40 milkyway kernel: ata1.00: error: { UNC } Sep 23 00:48:40 milkyway kernel: ata1.00: configured for UDMA/133 Sep 23 00:48:40 milkyway kernel: ata1: EH complete Sep 23 00:48:41 milkyway kernel: sda: Write Protect is off Sep 23 00:48:41 milkyway kernel: ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0 Sep 23 00:48:58 milkyway kernel: ata1.00: irq_stat 0x40000001 Sep 23 00:49:00 milkyway kernel: ata1.00: cmd 25/00:10:31:21:8c/00:00:28:00:00/e0 tag 0 dma 8192 in Sep 23 00:49:03 milkyway kernel: res 51/40:00:35:21:8c/00:00:28:00:00/e0 Emask 0x9 (media error) Sep 23 00:49:03 milkyway kernel: ata1.00: status: { DRDY ERR } Sep 23 00:49:04 milkyway kernel: ata1.00: error: { UNC } Sep 23 00:49:04 milkyway kernel: ata1.00: configured for UDMA/133 Sep 23 00:49:04 milkyway kernel: ata1: EH complete Sep 23 00:49:04 milkyway kernel: ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0 Sep 23 00:49:04 milkyway kernel: ata1.00: irq_stat 0x40000001 Sep 23 00:49:04 milkyway kernel: ata1.00: cmd 25/00:10:31:21:8c/00:00:28:00:00/e0 tag 0 dma 8192 in Sep 23 00:49:04 milkyway kernel: res 51/40:00:35:21:8c/00:00:28:00:00/e0 Emask 0x9 (media error) Sep 23 00:49:04 milkyway kernel: ata1.00: status: { DRDY ERR } Sep 23 00:49:04 milkyway kernel: ata1.00: error: { UNC } Sep 23 00:49:04 milkyway kernel: ata1.00: configured for UDMA/133 Sep 23 00:49:05 milkyway kernel: ata1: EH complete Sep 23 00:49:05 milkyway kernel: SCSI device sda: drive cache: write back Sep 23 00:49:06 milkyway kernel: ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0 Sep 23 00:49:06 milkyway kernel: ata1.00: irq_stat 0x40000001 Sep 23 00:49:06 milkyway kernel: ata1.00: cmd 25/00:10:31:21:8c/00:00:28:00:00/e0 tag 0 dma 8192 in Sep 23 00:49:06 milkyway kernel: res 51/40:00:35:21:8c/00:00:28:00:00/e0 Emask 0x9 (media error) Sep 23 00:49:06 milkyway kernel: ata1.00: status: { DRDY ERR } Sep 23 00:49:06 milkyway kernel: ata1.00: error: { UNC } Sep 23 00:49:06 milkyway kernel: ata1.00: configured for UDMA/133 Sep 23 00:49:08 milkyway kernel: sd 0:0:0:0: SCSI error: return code = 0x08000002
但是在/ proc / mdstat中没有任何硬盘显示为降级:
Personalities : [raid1] [raid10] [raid0] [raid6] [raid5] [raid4] md0 : active raid1 sdb1[1] sda1[0] 4200896 blocks [2/2] [UU] md1 : active raid1 sdb2[1] sda2[0] 2104448 blocks [2/2] [UU] md2 : active raid1 sdb3[1] sda3[0] 726266432 blocks [2/2] [UU] unused devices: <none>
我已经开始将所有数据迁移到新服务器.但结果是,由于硬盘发生故障,现在这很慢,几乎不可能将它们全部转移.此外,由于硬盘瓶颈负载天空火箭,导致服务器无法使用.
是否可以在不丢失数据且没有任何停机的情况下删除故障驱动器?即使RAID1暂时保留1个驱动器,我也不介意,以便尽快完成传输而不会延迟.
解决方法
您可以通过mdadm手动将驱动器标记为失败:
mdadm --manage /dev/md0 --fail /dev/sda1
然后,它将允许您从阵列中删除驱动器:
mdadm --manage /dev/md0 --remove /dev/sda1
对所有阵列重复上述操作.
这将使阵列只有一个驱动器,这应该允许您备份另一个驱动器上的数据
要么
使用备用驱动器替换故障/故障驱动器,并通过镜像来自良好驱动器的磁盘分区来重建阵列,然后将这些分区添加到md设备以进行阵列重建.
但是,“RAID不是备份”的正常咒语适用,即在即将发生磁盘故障之前很久就已经预先知道了数组内容的备份,尽管这对您来说并不是特别有用.