无法挂载 RAID 5 卷

无法挂载 RAID 5 卷

大家晚上好,

在 Linux 方面完全是新手,我使用 Xpenology(Synology)作为 NAS 软件,由于 SATA 电缆出现故障,我的 RAID 5 卷丢失了 - 在操作系统中它处于崩溃状态。

感谢另一位 ServerFault 用户的帮助下,我设法插入丢失的磁盘并将其从降级状态恢复,但我不知道下一步是什么。

SUPERSYNO> cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4]
md2 : active raid5 sdd5[0] sdk5[7] sdj5[6] sdi5[5] sdh5[4] sdg5[3] sdf5[2] sde5[1]
  20478048192 blocks super 1.2 level 5, 64k chunk, algorithm 2 [8/8] [UUUUUUUU]

md3 : active raid5 sde6[0] sdj6[2] sdh6[5] sdk6[4] sdi6[6]
  3906971648 blocks super 1.2 level 5, 64k chunk, algorithm 2 [5/5] [UUUUU]

md1 : active raid1 sdc2[0] sdd2[2] sde2[1] sdf2[3] sdg2[4] sdh2[5] sdi2[6] sdj2[7] sdk2[8]
  2097088 blocks [12/9] [UUUUUUUUU___]

md0 : active raid1 sdc1[0] sdd1[8] sde1[1] sdf1[7] sdg1[5] sdh1[4] sdi1[6] sdj1[3] sdk1[2]
  2490176 blocks [12/9] [UUUUUUUUU___]

unused devices: <none>

我不知道为什么这里有 4 个 md,也许这就是原因?

SUPERSYNO> mdadm --detail /dev/md2
/dev/md2:
Version : 1.2
Creation Time : Sat Dec 22 12:19:43 2018
Raid Level : raid5
Array Size : 20478048192 (19529.39 GiB 20969.52 GB)
Used Dev Size : 2925435456 (2789.91 GiB 2995.65 GB)
Raid Devices : 8
Total Devices : 8
Persistence : Superblock is persistent

Update Time : Sat Dec 22 22:13:59 2018
      State : clean
Active Devices : 8
Working Devices : 8
Failed Devices : 0
Spare Devices : 0

     Layout : left-symmetric
 Chunk Size : 64K

       Name : SUPERSYNO:2  (local to host SUPERSYNO)
       UUID : 7d8b04cf:aebb8d01:6034359b:c4bb62db
     Events : 110

Number   Major   Minor   RaidDevice State
   0       8       53        0      active sync   /dev/sdd5
   1       8       69        1      active sync   /dev/sde5
   2       8       85        2      active sync   /dev/sdf5
   3       8      101        3      active sync   /dev/sdg5
   4       8      117        4      active sync   /dev/sdh5
   5       8      133        5      active sync   /dev/sdi5
   6       8      149        6      active sync   /dev/sdj5
   7       8      165        7      active sync   /dev/sdk5

如果我尝试安装它,我会得到

SUPERSYNO> mount /dev/md2 /mnt
mount: mounting /dev/md2 on /mnt failed: No such device

如果我运行 fsck.ext4,我会得到以下结果:

SUPERSYNO> fsck.ext4 /dev/md2
e2fsck 1.42.6 (21-Sep-2012)
ext2fs_open2: Bad magic number in super-block
fsck.ext4: Superblock invalid, trying backup blocks...
fsck.ext4: Bad magic number in super-block while trying to open /dev/md2

The superblock could not be read or does not describe a correct ext2 filesystem.  
If the device is valid and it really contains an ext2 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>

如果我执行 fdisk -l 我会得到以下结果:

SUPERSYNO> fdisk -l

Disk /dev/sdc: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks  Id System
/dev/sdc1               1         311     2490240  fd Linux raid autodetect
Partition 1 does not end on cylinder boundary
/dev/sdc2             311         572     2097152  fd Linux raid autodetect
Partition 2 does not end on cylinder boundary
fdisk: device has more than 2^32 sectors, can't use all of them

Disk /dev/sdd: 2199.0 GB, 2199023255040 bytes
255 heads, 63 sectors/track, 267349 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks  Id System
/dev/sdd1               1      267350  2147483647+ ee EFI GPT
fdisk: device has more than 2^32 sectors, can't use all of them

Disk /dev/sde: 2199.0 GB, 2199023255040 bytes
255 heads, 63 sectors/track, 267349 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks  Id System
/dev/sde1               1      267350  2147483647+ ee EFI GPT
fdisk: device has more than 2^32 sectors, can't use all of them

Disk /dev/sdf: 2199.0 GB, 2199023255040 bytes
255 heads, 63 sectors/track, 267349 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks  Id System
/dev/sdf1               1      267350  2147483647+ ee EFI GPT
fdisk: device has more than 2^32 sectors, can't use all of them

Disk /dev/sdg: 2199.0 GB, 2199023255040 bytes
255 heads, 63 sectors/track, 267349 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks  Id System
/dev/sdg1               1      267350  2147483647+ ee EFI GPT
fdisk: device has more than 2^32 sectors, can't use all of them

Disk /dev/sdh: 2199.0 GB, 2199023255040 bytes
255 heads, 63 sectors/track, 267349 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks  Id System
/dev/sdh1               1      267350  2147483647+ ee EFI GPT
fdisk: device has more than 2^32 sectors, can't use all of them

Disk /dev/sdi: 2199.0 GB, 2199023255040 bytes
255 heads, 63 sectors/track, 267349 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks  Id System
/dev/sdi1               1      267350  2147483647+ ee EFI GPT
fdisk: device has more than 2^32 sectors, can't use all of them

Disk /dev/sdj: 2199.0 GB, 2199023255040 bytes
255 heads, 63 sectors/track, 267349 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks  Id System
/dev/sdj1               1      267350  2147483647+ ee EFI GPT
fdisk: device has more than 2^32 sectors, can't use all of them

Disk /dev/sdk: 2199.0 GB, 2199023255040 bytes
255 heads, 63 sectors/track, 267349 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks  Id System
/dev/sdk1               1      267350  2147483647+ ee EFI GPT

在得到这些结果之前,为了重新排序驱动器,我运行了下面的命令,大约花了 9 个小时才完成。希望这没有抹去它?

mdadm -Cf /dev/md2 -e1.2 -n8 -l5 /dev/sdd5 /dev/sde5 /dev/sdf5 /dev/sdg5 /dev/sdh5 /dev/sdi5 /dev/sdj5 /dev/sdk5 -u7d8b04cf:aebb8d01:6034359b:c4bb62db

我还有数据吗?可以重新安装吗?任何帮助都将不胜感激

答案1

是的,您使用最后一个命令擦除了驱动器。

MD 设备数量不同是因为它基于分区,而不是设备。一个可能是启动设备,一个是根设备,一个是数据设备;诸如此类。

但是,为什么您会拥有包含 12 个组件的 raid1 卷,这对我来说仍然是个谜。

顺便说一句,您不应该使用有那么多磁盘的 RAID5。在网上搜索为什么 RAID 不能在当今的容量下提供足够的冗余。

至于最初出现的问题,似乎没有足够的信息来说明原因。

相关内容