在 md raid 中丢失了超级块

dde*_*eke 4 software-raid mdadm superblock

Red Hat Linux 5 上的问题。

由于一些误传,我们环境中的两个 LUN 从 1.2 TB 扩大到 1.7 TB。

现在,重新启动后,mdadm 找不到再次构建阵列的超级块。

通用格式 — 称为 0.90 版 — 有一个 4K 长的超级块,写入一个 64K 对齐的块,该块从设备末尾开始至少 64K 且小于 128K(即获取超级块的地址)设备大小降低到 64K 的倍数,然后减去 64K)。

我找到了一些旧文档:

# mdadm -D /dev/md0
/dev/md0:
        Version : 0.90
  Creation Time : Tue Jul 10 17:45:00 2012
     Raid Level : raid1
     Array Size : 1289748416 (1230.00 GiB 1320.70 GB)
  Used Dev Size : 1289748416 (1230.00 GiB 1320.70 GB)
   Raid Devices : 2
  Total Devices : 2
Preferred Minor : 0
    Persistence : Superblock is persistent

    Update Time : Wed Apr 17 15:03:50 2013
         State : active
Active Devices : 2
Working Devices : 2
Failed Devices : 0
  Spare Devices : 0

           UUID : 2799bd51:67eb54d2:1fcd3c90:293311a1
         Events : 0.39

    Number   Major   Minor   RaidDevice State
       0     253       10        0      active sync   /dev/dm-10
       1     253       11        1      active sync   /dev/dm-11

# fdisk -l /dev/dm-10 /dev/dm-11

Disk /dev/dm-10: 1320.7 GB, 1320702443520 bytes
255 heads, 63 sectors/track, 160566 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/dm-10 doesn't contain a valid partition table

Disk /dev/dm-11: 1320.7 GB, 1320702443520 bytes
255 heads, 63 sectors/track, 160566 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/dm-11 doesn't contain a valid partition table
Run Code Online (Sandbox Code Playgroud)

Mat*_*chs 6

只需运行mdadm --build -l1 -n2 /dev/md0 /dev/dm-10 /dev/dm11即可取回您的数据。

在执行此操作之前验证设备是否正确(或使用 /dev/mapper 中的别名)!

此外,如果您的内核已经使用(或正在使用)这些设备之一,数据将不一致。您应该将第二个设备设置为退化 1.2 阵列,复制数据,开始使用新的退化 RAID,并将第一个磁盘添加到其中。如果您没有当前的备份,请在尝试之前制作一个您知道该怎么做的备份。

(无论如何切换到 1.2 是个好主意,因为 1.2 RAID 超级块可以防止此类问题。)