英语不是我的母语,所以如果出现任何语法错误,请提前致歉。
一位合作伙伴使用 mdadm 配置了 raid 0 的 raid 5(我不想将数据放在非默认配置上)。以下是他使用的基本命令:
mdadm --create --verbose /dev/md11 --level=0 --raid-devices=2 /dev/sdb /dev/sdc
mdadm --create --verbose /dev/md12 --level=0 --raid-devices=2 /dev/sdd /dev/sde
mdadm --create --verbose /dev/md13 --level=0 --raid-devices=2 /dev/sdf /dev/sdg
mdadm --create --verbose /dev/md14 --level=0 --raid-devices=2 /dev/sdh /dev/sdi
mdadm --create --verbose /dev/md15 --level=0 --raid-devices=2 /dev/sdj /dev/sdk
mdadm --create --verbose /dev/md5 --level=5 --raid-devices=5 /dev/md11 /dev/md12 /dev/md13 /dev/md14 /dev/md15
mdadm --detail --scan >> /etc/mdadm/mdadm.conf
服务器重启后,团队并未重建。
这是 /etc/mdadm/mdadm.conf 文件:
ARRAY /dev/md3 metadata=0.90 UUID=0a820b7d:49f63cdd:a4d2adc2:26fd5302
ARRAY /dev/md2 metadata=0.90 UUID=2fe084f0:e0a7b781:a4d2adc2:26fd5302
ARRAY /dev/md11 metadata=1.2 name=PostgresMain:11
UUID=47f54c97:58c905d5:c09c5a80:2d1dcdd7
ARRAY /dev/md12 metadata=1.2 name=PostgresMain:12
UUID=95587959:f50147c1:3a3f7458:fa308077
ARRAY /dev/md13 metadata=1.2 name=PostgresMain:13
UUID=8c99c82a:a9ada5df:af25626d:5a5356fd
ARRAY /dev/md14 metadata=1.2 name=PostgresMain:14
UUID=92a99a99:47e18be4:1734c0d3:b13806ef
ARRAY /dev/md15 metadata=1.2 name=PostgresMain:15
UUID=01d3b8b9:da2c6924:39abd96b:fd0bd6e6
ARRAY /dev/md5 metadata=1.2 spares=1 name=PostgresMain:5
UUID=a2915206:fd364e54:210972b3:694cdf77
ARRAY /dev/md0 metadata=1.2 name=PostgresMain:0
UUID=abf769d3:792cba00:193ab174:1baccc38
请忽略其他设备,它们只是属于 RAID5 的设备,即:md11 到 md15 以及 RAID 5 本身:md5
一些额外的信息: cat /proc/mdstat 个性:[raid1] [raid0] [raid6] [raid5] [raid4] [linear] [multipath] [raid10] md3:活动 raid1 sda3[0] 3748952384 块 [12/1] [U___________]
md2:活动 raid1 sda2[0] 523200 块[12/1] [U___________]
显然 RAID5 不存在。
来自这篇文章重启后 mdadm 消失我尝试进行扫描,并且正如 /proc/mdstat 所预期的那样,Raid5 不存在:
mdadm --detail --scan
ARRAY /dev/md2 metadata=0.90 UUID=2fe084f0:e0a7b781:a4d2adc2:26fd5302
ARRAY /dev/md3 metadata=0.90 UUID=0a820b7d:49f63cdd:a4d2adc2:26fd5302
从同一篇文章中他从未跑过更新-initramfs -u。
我尝试使用以下命令重新组装 raid:
mdadm --assemble /dev/md5 --uuid a2915206:fd364e54:210972b3:694cdf77
它没有显示任何错误,但它没有构建设备(请注意,我尝试构建其中一个 raid 0 设备,但它也没有工作)。使用详细命令我得到:
mdadm: looking for devices for /dev/md5
mdadm: no recogniseable superblock on /dev/md3
mdadm: no recogniseable superblock on /dev/md2
mdadm: cannot open device /dev/sr0: No medium found
mdadm: no recogniseable superblock on /dev/sdk1
mdadm: Cannot assemble mbr metadata on /dev/sdk
mdadm: no recogniseable superblock on /dev/sdl1
mdadm: Cannot assemble mbr metadata on /dev/sdl
mdadm: no recogniseable superblock on /dev/sdj1
mdadm: Cannot assemble mbr metadata on /dev/sdj
mdadm: no recogniseable superblock on /dev/sdi1
mdadm: Cannot assemble mbr metadata on /dev/sdi
mdadm: no recogniseable superblock on /dev/sdg1
mdadm: Cannot assemble mbr metadata on /dev/sdg
mdadm: no recogniseable superblock on /dev/sdh1
mdadm: Cannot assemble mbr metadata on /dev/sdh
mdadm: no recogniseable superblock on /dev/sdf1
mdadm: Cannot assemble mbr metadata on /dev/sdf
mdadm: no recogniseable superblock on /dev/sde1
mdadm: Cannot assemble mbr metadata on /dev/sde
mdadm: no recogniseable superblock on /dev/sdd1
mdadm: Cannot assemble mbr metadata on /dev/sdd
mdadm: no recogniseable superblock on /dev/sda5
mdadm: /dev/sda3 has wrong uuid.
mdadm: /dev/sda2 has wrong uuid.
mdadm: Cannot assemble mbr metadata on /dev/sda1
mdadm: Cannot assemble mbr metadata on /dev/sda
mdadm: no recogniseable superblock on /dev/sdc1
mdadm: Cannot assemble mbr metadata on /dev/sdc
mdadm: no recogniseable superblock on /dev/sdb1
mdadm: Cannot assemble mbr metadata on /dev/sdb
mdadm: no recogniseable superblock on /dev/loop5
mdadm: no recogniseable superblock on /dev/loop4
mdadm: no recogniseable superblock on /dev/loop3
mdadm: no recogniseable superblock on /dev/loop2
mdadm: no recogniseable superblock on /dev/loop1
mdadm: no recogniseable superblock on /dev/loop0
我不想丢失任何数据。运行每个创建命令,然后运行 mount,然后运行 update-initramfs -u 是否安全?设备似乎具有元数据:
mdadm --examine /dev/sdk
/dev/sdk:
MBR Magic : aa55
Partition[0] : 4294967295 sectors at 1 (type ee)