恢复 raid 配置(Ubuntu 8.04 服务器)

恢复 raid 配置(Ubuntu 8.04 服务器)

丢失 RAID

重新启动 AWS 后,我丢失了 RAID(mdadm),但磁盘似乎没有问题(单独而言)。

症状

mdadm不工作

机器重启后(在 Amazon AWS 上停止并启动),设备 /dev/md0 不工作:

[11:52:17 root :)  ]$ cat /proc/mdstat 
Personalities : 
unused devices: <none>

[12:03:09 root :) ]$ mdadm -A /dev/md0 
mdadm: no devices found for /dev/md0

磁盘仍被视为 RAID 的一部分

但所有 RAID 磁盘似乎都是 RAID 的一部分:

[12:05:24 root :) ]$ mdadm -Q /dev/sdk
/dev/sdk: is not an md array
/dev/sdk: device 7 in 8 device undetected raid0 /dev/md0.  
          Use mdadm --examine for more detail.

和:

[11:51:40 root :) ]$ mdadm -mdadm --create /dev/md0 --level=0 --raid-devices=8 
              --chunk=1024 /dev/sd[defghijk]
mdadm: /dev/sdd appears to be part of a raid array:
    level=raid0 devices=8 ctime=Wed Oct 27 10:38:53 2010
mdadm: /dev/sde appears to be part of a raid array:
    level=raid0 devices=8 ctime=Wed Oct 27 10:38:53 2010
mdadm: /dev/sdf appears to be part of a raid array:
    level=raid0 devices=8 ctime=Wed Oct 27 10:38:53 2010
mdadm: /dev/sdg appears to be part of a raid array:
    level=raid0 devices=8 ctime=Wed Oct 27 10:38:53 2010
mdadm: /dev/sdh appears to be part of a raid array:
    level=raid0 devices=8 ctime=Wed Oct 27 10:38:53 2010
mdadm: /dev/sdi appears to be part of a raid array:
    level=raid0 devices=8 ctime=Wed Oct 27 10:38:53 2010
mdadm: /dev/sdj appears to be part of a raid array:
    level=raid0 devices=8 ctime=Wed Oct 27 10:38:53 2010
mdadm: /dev/sdk appears to be part of a raid array:
    level=raid0 devices=8 ctime=Wed Oct 27 10:38:53 2010

mdadm.conf(以供参考)

[11:53:10 root ]$ cat /etc/mdadm/mdadm.conf
# mdadm.conf
#
# Please refer to mdadm.conf(5) for information about this file.
#

# by default, scan all partitions (/proc/partitions) for MD superblocks.
# alternatively, specify devices to scan, using wildcards if desired.
DEVICE partitions

# auto-create devices with Debian standard permissions
CREATE owner=root group=disk mode=0660 auto=yes

# 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
ARRAY /dev/md0 level=raid0 num-devices=8 UUID=a6c665f4:650c70af:7c32f52b:1d49233e

答案1

好吧,我办公室里的一些高手智胜了我一筹。

开始:

由于错误配置导致的问题:

文件 /etc/mdadm/mdadm.conf 指示设备 UUID:

ARRAY /dev/md0 level=raid0 num-devices=8 
               UUID=a6c665f4:650c70af:7c32f52b:1d49233e

我检查了设备的实际 UUID(它是不同的):

[12:15:30 root :) ]$ vol_id /dev/sde | grep ID_FS_UUID=
ID_FS_UUID=575fee91:786ac78e:8ffa4ee6:5eade1eb
[12:17:11 root :) ]$ vol_id /dev/sdf | grep ID_FS_UUID=
ID_FS_UUID=575fee91:786ac78e:8ffa4ee6:5eade1eb

更改配置文件后,您应该以重新创建模式运行 mdadm:

[12:13:01 root :) ]$ mdadm -A /dev/md0 
mdadm: /dev/md0 has been started with 8 drives.

相关内容