多路径 Raid 6-MDADM 找不到超级块-18.04

多路径 Raid 6-MDADM 找不到超级块-18.04

我正在运行一个连接到多驱动器磁盘阵列的服务器,它以双路径配置连接。因此,所有驱动器都显示两次。

我遭遇了断电,现在阵列无法组装。不过我可以使用我使用的原始命令。当我尝试组装时,它说没有超级块。

mdadm: No super block found on /dev/mapper/35000c500415cbb87 (Expected magic a92b4efc, got 00000000)
mdadm: no RAID superblock on /dev/mapper/35000c500415cbb87

我有两个问题:

  1. 此时是否可以重新组装阵列或者是否丢失任何数据?
  2. 我应该如何正确地做这件事以避免将来再发生这种情况。

初始命令运行:

- 尝试设置阵列,发现驱动器数量是原来的两倍。- 了解了多路径 - 构建了包含排除非多路径驱动程序的配置(见下文) - 使用 /dev/mapper/drives 创建了 Raid6 阵列。命令:

sudo mdadm --create --verbose /dev/md0 --level=6 --raid-devices=12 /dev/mapper/35000c500415cbb87 /dev/mapper/35000c500415cbbef /dev/mapper/35000c500415cfea3 /dev/mapper/35000c500415d0e3b /dev/mapper/35000c500415d6e3b /dev/mapper/35000c500415e456b /dev/mapper/35000c500415e4e5f /dev/mapper/35000c500415e8223 /dev/mapper/35000c500415ee867 /dev/mapper/35000c5004160b2df /dev/mapper/35000c5004160b6bb /dev/mapper/35000c50041611daf 

sudo mdadm -A /dev/mapper/35000c500415cbb87 /dev/mapper/35000c500415cbbef /dev/mapper/35000c500415cfea3 /dev/mapper/35000c500415d0e3b /dev/mapper/35000c500415d6e3b /dev/mapper/35000c500415e456b /dev/mapper/35000c500415e4e5f /dev/mapper/35000c500415e8223 /dev/mapper/35000c500415ee867 /dev/mapper/35000c5004160b2df /dev/mapper/35000c5004160b6bb /dev/mapper/35000c50041611daf

sudo mkfs.ext4 -F /dev/md0
sudo mkdir -p /mnt/md0
sudo mount /dev/md0 /mnt/md0
sudo mdadm --detail --scan | sudo tee -a /etc/mdadm/mdadm.conf
sudo update-initramfs -u

那时,我设置了文件夹并开始使用驱动器,直到断电将其关闭。重新启动后,我无法将其重新组装。

/etc/multipath.conf

defaults {
        user_friendly_names no
}
blacklist {
    wwid "600508e000000000997d2e0655fb5108"
    wwid "5002538d408c9715"
    device {
        vendor "Dell    "
        product "Virtual Disk    "
    }
}

/etc/mdadm/mdadm.conf

# wildcards if desired.
#DEVICE partitions containers

DEVICE /dev/mapper/35000c500415cbb87
DEVICE /dev/mapper/35000c500415cbbef
DEVICE /dev/mapper/35000c500415cfea3
DEVICE /dev/mapper/35000c500415d0e3b
DEVICE /dev/mapper/35000c500415d6e3b
DEVICE /dev/mapper/35000c500415e456b
DEVICE /dev/mapper/35000c500415e4e5f
DEVICE /dev/mapper/35000c500415e8223
DEVICE /dev/mapper/35000c500415ee867
DEVICE /dev/mapper/35000c5004160b2df
DEVICE /dev/mapper/35000c5004160b6bb
DEVICE /dev/mapper/35000c50041611daf


# automatically tag new arrays as belonging to the local system
HOMEHOST <system>

# instruct the monitoring daemon where to send mail alerts
#MAILADDR root

# definitions of existing MD arrays

# This configuration was auto-generated on Wed, 25 Jul 2018 23:01:52 +0000 by mkconf
ARRAY /dev/md0 metadata=1.2 name=media:0 UUID=5cfbe80c:d11c6b57:4beaff64:ed3bc6dd

答案1

该问题是由于使用设备而不是针对分区造成的。

第一步是对每个驱动器进行预先分区。

sudo mkfs.ext4 -F /dev/mapper/35000c500415cbb87
sudo mkfs.ext4 -F /dev/mapper/35000c500415cbbef
sudo mkfs.ext4 -F /dev/mapper/35000c500415cfea3
sudo mkfs.ext4 -F /dev/mapper/35000c500415d0e3b
sudo mkfs.ext4 -F /dev/mapper/35000c500415d6e3b
sudo mkfs.ext4 -F /dev/mapper/35000c500415e456b
sudo mkfs.ext4 -F /dev/mapper/35000c500415e4e5f
sudo mkfs.ext4 -F /dev/mapper/35000c500415e8223
sudo mkfs.ext4 -F /dev/mapper/35000c500415ee867
sudo mkfs.ext4 -F /dev/mapper/35000c5004160b2df
sudo mkfs.ext4 -F /dev/mapper/35000c5004160b6bb
sudo mkfs.ext4 -F /dev/mapper/35000c50041611daf

然后我可以使用分区驱动器完成相同的创建过程

sudo mdadm --create --verbose /dev/md0 --level=6 --raid-devices=12 /dev/dm-0 /dev/dm-1 /dev/dm-2 /dev/dm-3 /dev/dm-4 /dev/dm-5 /dev/dm-6 /dev/dm-7 /dev/dm-8 /dev/dm-9 /dev/dm-10 /dev/dm-11
sudo mkfs.ext4 -F /dev/md0
sudo mkdir -p /mnt/md0
sudo mount /dev/md0 /mnt/md0
sudo mdadm --detail --scan | sudo tee -a /etc/mdadm/mdadm.conf
sudo update-initramfs -u

然后我必须添加到 /etc/mdadm/mdadm.conf 而不是 /dev/mapper 条目

DEVICE /dev/dm-0
DEVICE /dev/dm-1
DEVICE /dev/dm-2
DEVICE /dev/dm-3
DEVICE /dev/dm-4
DEVICE /dev/dm-5
DEVICE /dev/dm-6
DEVICE /dev/dm-7
DEVICE /dev/dm-8
DEVICE /dev/dm-9
DEVICE /dev/dm-10
DEVICE /dev/dm-11

相关内容