如何恢复未挂载的 RAID1 阵列

时间:2021-02-15 14:23:39

标签: raid mdadm

我遇到了一个磁盘故障的 RAID1 阵列,该磁盘将自身置于只读模式。我更换了磁盘,重新创建了分区,但无法组装阵列:

cat /proc/mdstat
Personalities : [raid1] 
unused devices: <none>
mdadm --detail /dev/md0
mdadm: cannot open /dev/md0: No such file or directory
mdadm --assemble /dev/md0
mdadm: /dev/md0 assembled from 0 drives and 1 spare - not enough to start the array.

但是我似乎仍然有一个来自原始磁盘的正确分区,由于未知原因,它被标记为备用:

mdadm --examine /dev/nvme0n1p1
/dev/nvme0n1p1:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x0
     Array UUID : 24afa306:05a5839f:f98f8f26:845e4779
           Name : rescue:0  (local to host rescue)
  Creation Time : Tue Oct 23 18:44:41 2018
     Raid Level : raid1
   Raid Devices : 2

 Avail Dev Size : 67043328 (31.97 GiB 34.33 GB)
     Array Size : 33521664 (31.97 GiB 34.33 GB)
    Data Offset : 65536 sectors
   Super Offset : 8 sectors
   Unused Space : before=65384 sectors, after=0 sectors
          State : clean
    Device UUID : 3c484cb4:9ccbc063:f1af58d0:ede05f12

    Update Time : Fri Feb 12 16:07:11 2021
  Bad Block Log : 512 entries available at offset 136 sectors
       Checksum : 41b35da2 - correct
         Events : 1536433


   Device Role : spare
   Array State : .A ('A' == active, '.' == missing, 'R' == replacing)

这是我的 mdadm.conf:

cat /etc/mdadm/mdadm.conf 
# mdadm.conf
#
# !NB! Run update-initramfs -u after updating this file.
# !NB! This will ensure that initramfs has an uptodate copy.
#
# Please refer to mdadm.conf(5) for information about this file.
#

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

# 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/md/0  metadata=1.2 UUID=24afa306:05a5839f:f98f8f26:845e4779 name=rescue:0
   spares=1
ARRAY /dev/md/1  metadata=1.2 UUID=291a677d:13b5ac5d:f808a9b1:9293ef73 name=rescue:1
   spares=1
ARRAY /dev/md/2  metadata=1.2 UUID=1f1321c8:64bee927:64f97e9f:6d36ce26 name=rescue:2
   spares=1

# This configuration was auto-generated on Mon, 15 Feb 2021 15:12:47 +0100 by mkconf

除了重新创建数组之外,还有什么方法可以让它工作吗?我发现的一切都假设 /dev/md0 存在。

0 个答案:

没有答案