我的工作站有两个磁盘(/ dev / sd [ab]),两个磁盘都有类似的分区. / dev / sdb失败,cat / proc / mdstat停止显示第二个sdb分区.
我为使用它们的阵列上的故障磁盘的所有分区运行了mdadm –fail和mdadm –remove,尽管所有这些命令都失败了
mdadm: set device faulty Failed for /dev/sdb2: No such device mdadm: hot remove Failed for /dev/sdb2: No such device or address
然后我热插拔故障磁盘,对新磁盘进行分区并将分区添加到相应的阵列.除了一个阵列之外,所有阵列都得到了正确的重建,因为在/ dev / md2中,似乎没有正确地从阵列中删除故障磁盘.因此,新分区不断添加为分区的备用,其状态仍然降低.
这是mdadm –detail / dev / md2显示的内容:
[root@ldmohanr ~]# mdadm --detail /dev/md2 /dev/md2: Version : 1.1 Creation Time : Tue Dec 27 22:55:14 2011 Raid Level : raid1 Array Size : 52427708 (50.00 GiB 53.69 GB) Used Dev Size : 52427708 (50.00 GiB 53.69 GB) Raid Devices : 2 Total Devices : 2 Persistence : Superblock is persistent Intent Bitmap : Internal Update Time : Fri Nov 23 14:59:56 2012 State : active,degraded Active Devices : 1 Working Devices : 2 Failed Devices : 0 Spare Devices : 1 Name : ldmohanr.net:2 (local to host ldmohanr.net) UUID : 4483f95d:e485207a:b43c9af2:c37c6df1 Events : 5912611 Number Major Minor RaidDevice State 0 8 2 0 active sync /dev/sda2 1 0 0 1 removed 2 8 18 - spare /dev/sdb2
要删除磁盘,mdadm需要一个设备文件名,最初是/ dev / sdb2,但不再引用设备编号1.我需要帮助删除设备编号1并删除状态并使/ dev / sdb2处于活动状态.
解决方法
如果驱动器不再显示在系统中,请执行以下操作:
mdadm / dev / md2 -r分离
要么
mdadm / dev / md2 -r失败了
如果成功完成,您应该收到如下消息:
mdadm: hot removed 8:50 from /dev/md0
并且驱动器不再显示在/ proc / mdstat中.从手册页:
“The first causes all Failed device to be removed. The second causes any device which is no longer connected to the system (i.e an ‘open’ returns ENXIO) to be removed. This will only succeed for devices that are spares or have already been marked as Failed.”