我的 Linux 知识水平很浅(我正在学习),而且我遇到了一个超出我的 Google-Fu 水平的问题。我已经超出了我的深度,我希望有人能够帮助我......
我在我的家庭实验室中运行 OpenMediaVault 5.5.3-1 (Usul),并有两个软件 RAID 阵列 /dev/md0 和 /dev/md1。今天早上登录时,我发现 /dev/md1,一个四磁盘 RAID5 集(又名 /dev/disk/by-label/RAID5)不可用。它保存了大量我不想丢失的数据。
到目前为止我所做的:
我检查了 OpenMediaVault GUI,它告诉我 raidset“丢失”
我确定组成 Raidset 的四个磁盘之一没有出现在 BIOS 级别。我重新安装了电缆,所有四个驱动器(sdc、sdd、sde 和 sdh)现在对操作系统都是可见的。
重新启动后,raidset 仍然显示为“丢失”,并且 dmesg 中出现一条消息
EXT4-fs (md1): unable to read superblock
/proc/mdstat 确认 md1 处于非活动状态:
root@OpenMediaTower:~# cat /proc/mdstat Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] md1 : inactive sdh[3](S) sde[2](S) sdd[1](S) sdc[0](S) 7813529952 blocks super 1.2 md0 : active raid1 sdf[1] sda[0] 3906886464 blocks super 1.2 [2/2] [UU] bitmap: 0/30 pages [0KB], 65536KB chunk unused devices: <none>
通过谷歌,我发现以前的一篇文章处理了一个有点类似的问题,从中我查看了 mdadm,但不幸的是,我知识不足,无法使用详细信息来诊断和解决问题
mdadm --detail 的输出
root@OpenMediaTower:~# mdadm --detail --scan
ARRAY /dev/md0 metadata=1.2 name=OpenMediaTower:Mirror UUID=f7b1c667:3df80c11:975d87ad:126b5401
INACTIVE-ARRAY /dev/md1 metadata=1.2 name=RAID5 UUID=c813cb15:a9d26d51:7faada85:9b76b36d
尝试重新组装raidset
root@OpenMediaTower:~# mdadm --stop
/dev/md1 mdadm: stopped /dev/md1
root@OpenMediaTower:~# mdadm --assemble --scan
mdadm: /dev/md1 assembled from 2 drives - not enough to start the array.
mdadm --examine 的输出
root@OpenMediaTower:~# mdadm --examine /dev/sd[dehc]
/dev/sdc:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x1
Array UUID : c813cb15:a9d26d51:7faada85:9b76b36d
Name : RAID5
Creation Time : Sun May 17 14:49:46 2020
Raid Level : raid5
Raid Devices : 4
Avail Dev Size : 3906764976 (1862.89 GiB 2000.26 GB)
Array Size : 5860147200 (5588.67 GiB 6000.79 GB)
Used Dev Size : 3906764800 (1862.89 GiB 2000.26 GB)
Data Offset : 264192 sectors
Super Offset : 8 sectors
Unused Space : before=264112 sectors, after=176 sectors
State : clean
Device UUID : 42088567:13765c92:e2a5503b:c30355d0
Internal Bitmap : 8 sectors from superblock
Update Time : Wed Jul 22 08:35:02 2020
Bad Block Log : 512 entries available at offset 16 sectors
Checksum : dd641c67 - correct
Events : 218937
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 0
Array State : A.AA ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdd:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x1
Array UUID : c813cb15:a9d26d51:7faada85:9b76b36d
Name : RAID5
Creation Time : Sun May 17 14:49:46 2020
Raid Level : raid5
Raid Devices : 4
Avail Dev Size : 3906764976 (1862.89 GiB 2000.26 GB)
Array Size : 5860147200 (5588.67 GiB 6000.79 GB)
Used Dev Size : 3906764800 (1862.89 GiB 2000.26 GB)
Data Offset : 264192 sectors
Super Offset : 8 sectors
Unused Space : before=264112 sectors, after=176 sectors
State : active
Device UUID : 69f98cc0:b818da43:b883695d:2246b3ab
Internal Bitmap : 8 sectors from superblock
Update Time : Sun Jul 19 03:32:33 2020
Bad Block Log : 512 entries available at offset 16 sectors
Checksum : e55cb645 - correct
Events : 30843
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 1
Array State : AAAA ('A' == active, '.' == missing, 'R' == replacing)
/dev/sde:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x1
Array UUID : c813cb15:a9d26d51:7faada85:9b76b36d
Name : RAID5
Creation Time : Sun May 17 14:49:46 2020
Raid Level : raid5
Raid Devices : 4
Avail Dev Size : 3906764976 (1862.89 GiB 2000.26 GB)
Array Size : 5860147200 (5588.67 GiB 6000.79 GB)
Used Dev Size : 3906764800 (1862.89 GiB 2000.26 GB)
Data Offset : 264192 sectors
Super Offset : 8 sectors
Unused Space : before=264112 sectors, after=176 sectors
State : active
Device UUID : 04ec1c61:a7f1bb11:ee13bfe0:7153e38a
Internal Bitmap : 8 sectors from superblock
Update Time : Tue Jul 21 21:59:53 2020
Bad Block Log : 512 entries available at offset 16 sectors
Checksum : b6579d04 - correct
Events : 216993
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 2
Array State : A.AA ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdh:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x1
Array UUID : c813cb15:a9d26d51:7faada85:9b76b36d
Name : RAID5
Creation Time : Sun May 17 14:49:46 2020
Raid Level : raid5
Raid Devices : 4
Avail Dev Size : 3906764976 (1862.89 GiB 2000.26 GB)
Array Size : 5860147200 (5588.67 GiB 6000.79 GB)
Used Dev Size : 3906764800 (1862.89 GiB 2000.26 GB)
Data Offset : 264192 sectors
Super Offset : 8 sectors
Unused Space : before=264112 sectors, after=176 sectors
State : clean
Device UUID : 2af17abb:48930a97:31ce1fa5:850ac7d0
Internal Bitmap : 8 sectors from superblock
Update Time : Wed Jul 22 08:35:02 2020
Bad Block Log : 512 entries available at offset 16 sectors
Checksum : a0495199 - correct
Events : 218937
Layout : left-symmetric
Chunk Size : 512K
Device Role : Active device 3
Array State : A.AA ('A' == active, '.' == missing, 'R' == replacing)
- 我运行了 e2fsck,它报告了超级块的问题。在这个阶段我还没有尝试过
root@OpenMediaTower:~# e2fsck /dev/md1 e2fsck 1.45.5 (07-Jan-2020) e2fsck: Invalid argument while trying to open /dev/md1 The superblock could not be read or does not describe a validext2/ext3/ext4 filesystem. If the device is valid and it really contains an ext2/ext3/ext4 filesystem (and not swap or ufs or something else), then the superblock is corrupt, and you might try running e2fsck with an alternate superblock: e2fsck -b 8193 <device> or e2fsck -b 32768 <device>
- 我尝试重新组装 raidset,分别命名每个磁盘
root@OpenMediaTower:~# mdadm --verbose --assemble /dev/md1 /dev/sdc /dev/sdd /dev/sde /dev/sdh mdadm: looking for devices for /dev/md1 mdadm: /dev/sdc is identified as a member of /dev/md1, slot 0. mdadm: /dev/sdd is identified as a member of /dev/md1, slot 1. mdadm: /dev/sde is identified as a member of /dev/md1, slot 2. mdadm: /dev/sdh is identified as a member of /dev/md1, slot 3. mdadm: added /dev/sdd to /dev/md1 as 1 (possibly out of date) mdadm: added /dev/sde to /dev/md1 as 2 (possibly out of date) mdadm: added /dev/sdh to /dev/md1 as 3 mdadm: added /dev/sdc to /dev/md1 as 0 mdadm: /dev/md1 assembled from 2 drives - not enough to start the array.
答案1
为避免进一步的数据丢失,请设置写时复制覆盖并将其用于您所有的实验。
然后你就可以用集结力碰碰运气了没有具有最新更新时间和事件计数的驱动器/dev/sdd
。
mdadm --stop /dev/md1
mdadm --assemble /dev/md1 --force /dev/mapper/sdc /dev/mapper/sde /dev/mapper/sdh
如果幸运的话,这将使您能够访问您的数据(在降级模式下)。
然而,最大的问题是它最初是如何崩溃的。因此,请检查 SMART 值,如果任何驱动器已重新分配/待处理/无法纠正的扇区,则您将需要新的驱动器,然后ddrescue
才能继续。尝试在故障驱动器上恢复数据并不是一个好主意。