尝试恢复 mdadm RAID1

尝试恢复 mdadm RAID1

我有一个 RAID1 阵列,我想将其分成两个独立的驱动器。/dev/sdb 和 /dev/sdc 是两个驱动器,有三个独立的分区。

/dev/sd[bc]1  /dev/md0
/dev/sd[bc]2  /dev/md1
/dev/sd[bc]3  /dev/md2

阵列的当前状态是:/dev/sdc 已被分配了新任务,不再是阵列的一部分。我正在尝试在没有 /dev/sdc 的情况下重新组装阵列。

当我尝试仅使用 /dev/sdb 启动阵列时,出现以下问题

luke@hoth:~$ sudo mdadm --verbose --assemble --run /dev/md0 /dev/sdb1
mdadm: looking for devices for /dev/md0
mdadm: Device /dev/sdb1 is not large enough for data described in superblock
mdadm: no RAID superblock on /dev/sdb1
mdadm: /dev/sdb1 has no superblock - assembly aborted

luke@hoth:~$ sudo mdadm --examine /dev/sdb1
/dev/sdb1:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : 775ff7b7:9f32199e:d05c36f6:581bbe80
           Name : hoth:0  (local to host hoth)
  Creation Time : Tue Oct  3 14:04:39 2023
     Raid Level : raid1
   Raid Devices : 2

 Avail Dev Size : 524023808 sectors (249.87 GiB 268.30 GB)
     Array Size : 262011904 KiB (249.87 GiB 268.30 GB)
    Data Offset : 264192 sectors
   Super Offset : 8 sectors
   Unused Space : before=264112 sectors, after=-262143 sectors DEVICE TOO SMALL
          State : clean TRUNCATED DEVICE
    Device UUID : bd9c610b:d25f6823:55bdcdad:cf7c81d4

Internal Bitmap : 8 sectors from superblock
    Update Time : Sat Apr 13 02:41:24 2024
  Bad Block Log : 512 entries available at offset 16 sectors
       Checksum : 997af08c - correct
         Events : 18311


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

我认为该问题与分区处于“清理截断的设备”状态有关,当我尝试组装驱动器上的任何其他分区时,我遇到了相同的错误和相同的状态。

我差点就让这条线路运行来尝试解决这个问题,但我不知道这是否会使情况变得更糟:

mdadm --create /dev/md0 --raid-devices=2 --level=1 /dev/sdb1 missing

我真的不知道接下来该做什么,因为我读过的所有文章中,没有一篇能清楚地解决我所处的境况,也没有一篇能让我“感到温暖”,让我能够遵循他们的解决方案。

我感谢您的帮助,我可以提供任何所需的额外信息!

以下是有关我的设置的更多信息

操作系统:Debian 测试版 (Trixie)

/dev/sdb——已知良好的 2TB Seagate NAS 硬盘

fdisk -l
    Disk /dev/sdb: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
    Disk model: ST2000DM005-2CW1
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disklabel type: dos
    Disk identifier: 0x4afa9d4b
    
    Device     Boot      Start        End    Sectors   Size Id Type
    /dev/sdb1  *          2048  524027903  524025856 249.9G fd Linux raid autodetect
    /dev/sdb2        524290048 1048315903  524025856 249.9G fd Linux raid autodetect
    /dev/sdb3       1048578048 3906766847 2858188800   1.3T fd Linux raid autodetect

/dev/sdc——已知良好的 2TB Seagate NAS 硬盘

fdisk -l
    Disk /dev/sdc: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
    Disk model: ST2000DM005-2CW1
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disklabel type: dos
    Disk identifier: 0x2920693c

/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.
#
MAILADDR root
DEVICE /dev/sd[bc][123]
ARRAY /dev/md0 metadata=1.2 name=hoth:0 level=raid1 num-devices=2 UUID=775ff7b7:9f32199e:d05c36f6:581bbe80
ARRAY /dev/md1 metadata=1.2 name=hoth:1 level=raid1 num-devices=2 UUID=1dbfc0fb:e0e82d09:f4ba2dc2:580c0b71
ARRAY /dev/md2 metadata=1.2 name=hoth:2 level=raid1 num-devices=2 UUID=2dabb7ff:4f868181:75d05891:dd13a16e

/dev/sdb1 mdadm --检查

/dev/sdb1:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : 775ff7b7:9f32199e:d05c36f6:581bbe80
           Name : hoth:0  (local to host hoth)
  Creation Time : Tue Oct  3 14:04:39 2023
     Raid Level : raid1
   Raid Devices : 2

 Avail Dev Size : 524023808 sectors (249.87 GiB 268.30 GB)
     Array Size : 262011904 KiB (249.87 GiB 268.30 GB)
    Data Offset : 264192 sectors
   Super Offset : 8 sectors
   Unused Space : before=264112 sectors, after=-262143 sectors DEVICE TOO SMALL
          State : clean TRUNCATED DEVICE
    Device UUID : bd9c610b:d25f6823:55bdcdad:cf7c81d4

Internal Bitmap : 8 sectors from superblock
    Update Time : Sat Apr 13 02:41:24 2024
  Bad Block Log : 512 entries available at offset 16 sectors
       Checksum : 997af08c - correct
         Events : 18311


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

/dev/sdb2 mdadm --检查

/dev/sdb2:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : 1dbfc0fb:e0e82d09:f4ba2dc2:580c0b71
           Name : hoth:1  (local to host hoth)
  Creation Time : Tue Oct  3 14:04:53 2023
     Raid Level : raid1
   Raid Devices : 2

 Avail Dev Size : 524023808 sectors (249.87 GiB 268.30 GB)
     Array Size : 262011904 KiB (249.87 GiB 268.30 GB)
    Data Offset : 264192 sectors
   Super Offset : 8 sectors
   Unused Space : before=264112 sectors, after=-262143 sectors DEVICE TOO SMALL
          State : clean TRUNCATED DEVICE
    Device UUID : aadeafb8:ee259c18:dff6ec77:15f8599b

Internal Bitmap : 8 sectors from superblock
    Update Time : Fri Apr 12 23:42:37 2024
  Bad Block Log : 512 entries available at offset 16 sectors
       Checksum : 3815b526 - correct
         Events : 4885


   Device Role : Active device 1
   Array State : AA ('A' == active, '.' == missing, 'R' == replacing)

/dev/sdb3 mdadm --检查

/dev/sdb3:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : 2dabb7ff:4f868181:75d05891:dd13a16e
           Name : hoth:2  (local to host hoth)
  Creation Time : Tue Oct  3 14:05:09 2023
     Raid Level : raid1
   Raid Devices : 2

 Avail Dev Size : 2858186928 sectors (1362.89 GiB 1463.39 GB)
     Array Size : 1429093440 KiB (1362.89 GiB 1463.39 GB)
  Used Dev Size : 2858186880 sectors (1362.89 GiB 1463.39 GB)
    Data Offset : 264192 sectors
   Super Offset : 8 sectors
   Unused Space : before=264112 sectors, after=-262271 sectors DEVICE TOO SMALL
          State : clean TRUNCATED DEVICE
    Device UUID : 3f000511:538ed947:10bb14aa:0a9853ad

Internal Bitmap : 8 sectors from superblock
    Update Time : Fri Apr 12 23:42:38 2024
  Bad Block Log : 512 entries available at offset 16 sectors
       Checksum : 6316a366 - correct
         Events : 27246


   Device Role : Active device 1
   Array State : AA ('A' == active, '.' == missing, 'R' == replacing)

lsblk:

sda      8:0    0 119.2G  0 disk 
├─sda1   8:1    0   512M  0 part /boot/efi
├─sda2   8:2    0 117.8G  0 part /
└─sda3   8:3    0   977M  0 part [SWAP]
sdb      8:16   0   1.8T  0 disk 
├─sdb1   8:17   0 249.9G  0 part 
├─sdb2   8:18   0 249.9G  0 part 
└─sdb3   8:19   0   1.3T  0 part 
sdc      8:32   0   1.8T  0 disk 
sdd      8:48   1   7.5G  0 disk 
├─sdd1   8:49   1   1.4G  0 part 
└─sdd2   8:50   1     5M  0 part 
sr0     11:0    1  1024M  0 rom  

相关内容