操作系统:Debian Squeeze 内核:2.6.32-5-amd64 mdadm 版本:3.1.4(2010 年 8 月 31 日)
多维数组
md1 = raid1 (this is working) (devices: /dev/sd[fg]1)
md0 = raid6 (previously raid5, now failing to start) (devices: /dev/sd[abcde]1)
描述:我有一个 4 磁盘 raid 5,我决定将其转换为 6 磁盘 raid 6。向阵列中添加了两个磁盘并开始重塑。在此过程的早期,我丢失了一个磁盘(智能错误)。磁盘被移除,重塑继续。重塑期间我发生了三次电源故障,但每次开机后重塑都会继续。重塑完成,但一个磁盘被“移除”,例如,没有向操作系统报告其版本(显示为未知型号)。
在这个阶段,raid6 有两个丢失的磁盘并且阵列可以运行(我仍在等待替换磁盘,因此缺少一个磁盘来完成阵列)。
我决定关闭机器,然后重新打开电源,看看丢失的磁盘是否再次出现。它确实出现了,但阵列组装失败,并出现以下错误:
madm --assemble /dev/md0
mdadm: superblock on /dev/sdd1 doesn't match others - assembly aborted
我也尝试使用 mdadm --assemble --force /dev/md0,但出现了完全相同的错误。
现在我尝试了这个:
mdadm --verbose --assemble /dev/md0
mdadm: looking for devices for /dev/md0
mdadm: cannot open device /dev/md/1: Device or resource busy
mdadm: /dev/md/1 has wrong uuid.
mdadm: cannot open device /dev/sdg1: Device or resource busy
mdadm: /dev/sdg1 has wrong uuid.
mdadm: cannot open device /dev/sdg: Device or resource busy
mdadm: /dev/sdg has wrong uuid.
mdadm: cannot open device /dev/sdf2: Device or resource busy
mdadm: /dev/sdf2 has wrong uuid.
mdadm: cannot open device /dev/sdf1: Device or resource busy
mdadm: /dev/sdf1 has wrong uuid.
mdadm: cannot open device /dev/sdf: Device or resource busy
mdadm: /dev/sdf has wrong uuid.
mdadm: no RAID superblock on /dev/sde2
mdadm: /dev/sde2 has wrong uuid.
mdadm: no RAID superblock on /dev/sde
mdadm: /dev/sde has wrong uuid.
mdadm: cannot open device /dev/sdd2: Device or resource busy
mdadm: /dev/sdd2 has wrong uuid.
mdadm: superblock on /dev/sdd1 doesn't match others - assembly aborted
mdadm -Esvvv 的输出也是:
mdadm -Esvvv
mdadm: No md superblock detected on /dev/md/1.
/dev/sdg1:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : b7433980:f3a086eb:7f8f8a15:093b5909
Name : cell01:1 (local to host cell01)
Creation Time : Sun Apr 8 15:30:47 2012
Raid Level : raid1
Raid Devices : 2
Avail Dev Size : 1681342464 (801.73 GiB 860.85 GB)
Array Size : 1681342192 (801.73 GiB 860.85 GB)
Used Dev Size : 1681342192 (801.73 GiB 860.85 GB)
Data Offset : 2048 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 74d30246:840a1947:b4eeecc1:0dd95b2a
Update Time : Fri Aug 24 00:06:16 2012
Checksum : b302004f - correct
Events : 244
Device Role : Active device 1
Array State : AA ('A' == active, '.' == missing)
mdadm: No md superblock detected on /dev/sdg.
/dev/sdf2:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : b7433980:f3a086eb:7f8f8a15:093b5909
Name : cell01:1 (local to host cell01)
Creation Time : Sun Apr 8 15:30:47 2012
Raid Level : raid1
Raid Devices : 2
Avail Dev Size : 1681342464 (801.73 GiB 860.85 GB)
Array Size : 1681342192 (801.73 GiB 860.85 GB)
Used Dev Size : 1681342192 (801.73 GiB 860.85 GB)
Data Offset : 2048 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 5847c4e4:319a9c6e:353f67c8:765e4b47
Update Time : Fri Aug 24 00:06:16 2012
Checksum : 9cb0d9ca - correct
Events : 244
Device Role : Active device 0
Array State : AA ('A' == active, '.' == missing)
mdadm: No md superblock detected on /dev/sdf1.
mdadm: No md superblock detected on /dev/sdf.
mdadm: No md superblock detected on /dev/sde2.
/dev/sde1:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : 5343f9b9:ccb86e50:33ed2a4b:d494c7dc
Name : cell01:0 (local to host cell01)
Creation Time : Sat Jul 2 11:22:04 2011
Raid Level : raid6
Raid Devices : 6
Avail Dev Size : 3904927744 (1862.01 GiB 1999.32 GB)
Array Size : 15619706880 (7448.06 GiB 7997.29 GB)
Used Dev Size : 3904926720 (1862.01 GiB 1999.32 GB)
Data Offset : 2048 sectors
Super Offset : 8 sectors
State : clean
Device UUID : d13f32aa:7da122d9:77ba06f0:bc57d063
Update Time : Thu Aug 23 22:15:58 2012
Checksum : 6212fa6e - correct
Events : 134404
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 5
Array State : AA.A.A ('A' == active, '.' == missing)
mdadm: No md superblock detected on /dev/sde.
mdadm: No md superblock detected on /dev/sdd2.
/dev/sdd1:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x4
Array UUID : 5343f9b9:ccb86e50:33ed2a4b:d494c7dc
Name : cell01:0 (local to host cell01)
Creation Time : Sat Jul 2 11:22:04 2011
Raid Level : raid6
Raid Devices : 6
Avail Dev Size : 3904927744 (1862.01 GiB 1999.32 GB)
Array Size : 15619706880 (7448.06 GiB 7997.29 GB)
Used Dev Size : 3904926720 (1862.01 GiB 1999.32 GB)
Data Offset : 2048 sectors
Super Offset : 8 sectors
State : clean
Device UUID : 3d05a6b3:3a05d5bc:fc1d01a6:10c055eb
Reshape pos'n : 7732852736 (7374.62 GiB 7918.44 GB)
Delta Devices : 1 (5->6)
New Layout : left-symmetric
Update Time : Thu Aug 23 09:48:17 2012
Checksum : 83a30996 - correct
Events : 134174
Layout : left-symmetric-6
Chunk Size : 512K
Device Role : Active device 2
Array State : AAAA.A ('A' == active, '.' == missing)
mdadm: No md superblock detected on /dev/sdd.
mdadm: No md superblock detected on /dev/sda2.
/dev/sda1:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : 5343f9b9:ccb86e50:33ed2a4b:d494c7dc
Name : cell01:0 (local to host cell01)
Creation Time : Sat Jul 2 11:22:04 2011
Raid Level : raid6
Raid Devices : 6
Avail Dev Size : 3904927744 (1862.01 GiB 1999.32 GB)
Array Size : 15619706880 (7448.06 GiB 7997.29 GB)
Used Dev Size : 3904926720 (1862.01 GiB 1999.32 GB)
Data Offset : 2048 sectors
Super Offset : 8 sectors
State : clean
Device UUID : c66da6b9:aa010cbc:8e4ab376:7a623f21
Update Time : Thu Aug 23 22:15:58 2012
Checksum : 988b9d9b - correct
Events : 134404
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 3
Array State : AA.A.A ('A' == active, '.' == missing)
mdadm: No md superblock detected on /dev/sda.
mdadm: No md superblock detected on /dev/sdc2.
/dev/sdc1:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : 5343f9b9:ccb86e50:33ed2a4b:d494c7dc
Name : cell01:0 (local to host cell01)
Creation Time : Sat Jul 2 11:22:04 2011
Raid Level : raid6
Raid Devices : 6
Avail Dev Size : 3904927744 (1862.01 GiB 1999.32 GB)
Array Size : 15619706880 (7448.06 GiB 7997.29 GB)
Used Dev Size : 3904926720 (1862.01 GiB 1999.32 GB)
Data Offset : 2048 sectors
Super Offset : 8 sectors
State : clean
Device UUID : e7afc574:abca367c:ebb58fe5:c4961cb7
Update Time : Thu Aug 23 22:15:58 2012
Checksum : 188fd371 - correct
Events : 134404
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 0
Array State : AA.A.A ('A' == active, '.' == missing)
mdadm: No md superblock detected on /dev/sdc.
mdadm: No md superblock detected on /dev/sdb2.
/dev/sdb1:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : 5343f9b9:ccb86e50:33ed2a4b:d494c7dc
Name : cell01:0 (local to host cell01)
Creation Time : Sat Jul 2 11:22:04 2011
Raid Level : raid6
Raid Devices : 6
Avail Dev Size : 3904927744 (1862.01 GiB 1999.32 GB)
Array Size : 15619706880 (7448.06 GiB 7997.29 GB)
Used Dev Size : 3904926720 (1862.01 GiB 1999.32 GB)
Data Offset : 2048 sectors
Super Offset : 8 sectors
State : clean
Device UUID : fb3a88de:834f2bc0:452db777:48ef3b21
Update Time : Thu Aug 23 22:15:58 2012
Checksum : c28d282b - correct
Events : 134404
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 1
Array State : AA.A.A ('A' == active, '.' == missing)
mdadm: No md superblock detected on /dev/sdb.
我能看到的唯一区别是,不匹配磁盘的特征图设置为 0x4,其他磁盘设置为 0x0。阵列的 UUID 在所有磁盘上都是相同的。
我非常确定数据还在那里,我很想尝试将 /dev/sdd1 的超级块清零,然后将其重新添加到阵列中,因为我认为阵列在缺少两个磁盘的情况下应该可以正常工作。但是,由于我没有备份(是的,我知道这很愚蠢),而且数据对我来说很重要(我选择 raid6 的原因),所以我想尝试绝对最安全的方法来恢复阵列。
我还考虑升级到 Debian wheezy,因为它有较新的 mdadm,但我更愿意一直使用 Debian 稳定版,直到 wheezy 发布。
你可以想象这很可怕,我不想丢失我的数据,所以如果有知识和经验的人可以指导我下一步该怎么做,我将不胜感激。
答案1
解决方案出奇地简单
mdadm --assemble /dev/md0 /dev/sd1 /dev/sdb1 /dev/sdc1 /dev/sde1
然后
mdadm --add /dev/md0 /dev/sdd1
突袭正在恢复!