嘗試在Linux上重新組裝RAID 1;意外創建了新的 /dev/md0 (而不是重新組裝),現在它無法安裝

嘗試在Linux上重新組裝RAID 1;意外創建了新的 /dev/md0 (而不是重新組裝),現在它無法安裝

我試圖重新組裝一個工作的 RAID 1 陣列,但我不小心執行了 代替mdadm --createmdadm --assemble現在 RAID 設備無法安裝。

錯誤:起初我不幸地這樣做了:

$ sudo mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdc1

之後,嘗試掛載/dev/md0失敗:

$ sudo mount /dev/md0 /mnt/mirror
mount: /mnt/mirror: wrong fs type, bad option, bad superblock on /dev/md0, missing codepage or helper program, or other error.

現在,當我嘗試執行此操作時--assemble,RAID 設備將無法安裝:

$ sudo mdadm --assemble /dev/md0 /dev/sdc1
mdadm: /dev/sdc1 is busy - skipping
$ sudo mdadm --stop /dev/md0
mdadm: stopped /dev/md0
sudo mdadm --assemble /dev/md0 /dev/sdb1 /dev/sdc1
mdadm: /dev/md/0 has been started with 2 drives.
$ sudo mount /dev/md0 /mnt/mirror
mount: /mnt/mirror: wrong fs type, bad option, bad superblock on /dev/md0, missing codepage or helper program, or other error.

如何將 fs 類型還原為 RAID 1 的正確設定(無需格式化! - 我不想破壞資料!)

$ sudo mdadm --examine /dev/sdb1
/dev/sdb1:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : 409bb846:c04ba3d6:cff546fe:b63ce279
           Name : mojo:0  (local to host mojo)
  Creation Time : Sat Jun  1 14:40:46 2019
     Raid Level : raid1
   Raid Devices : 2

 Avail Dev Size : 977008640 (465.87 GiB 500.23 GB)
     Array Size : 488253440 (465.63 GiB 499.97 GB)
  Used Dev Size : 976506880 (465.63 GiB 499.97 GB)
    Data Offset : 264192 sectors
   Super Offset : 8 sectors
   Unused Space : before=264112 sectors, after=501760 sectors
          State : active
    Device UUID : 36202ff4:4c450b4c:4e45f049:83d16385

Internal Bitmap : 8 sectors from superblock
    Update Time : Sat Jun  1 16:38:50 2019
  Bad Block Log : 512 entries available at offset 16 sectors
       Checksum : 19e7023e - correct
         Events : 719


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

$ cat /proc/mdstat 
Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10] 
md0 : active raid1 sdb1[0] sdc1[1]
      488253440 blocks super 1.2 [2/2] [UU]
      [==================>..]  resync = 94.0% (459229248/488253440) finish=7.0min speed=68932K/sec
      bitmap: 1/4 pages [4KB], 65536KB chunk

unused devices: <none>


$ sudo fdisk /dev/sdc

Welcome to fdisk (util-linux 2.33.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/sdc: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Disk model: Hitachi HDS72105
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x69ed0c28

Device     Boot Start       End   Sectors   Size Id Type
/dev/sdc1        2048 976773167 976771120 465.8G fd Linux raid autodetect

sudo blkid /dev/sdb1 /dev/sdc1
/dev/sdb1: UUID="409bb846-c04b-a3d6-cff5-46feb63ce279" UUID_SUB="36202ff4-4c45-0b4c-4e45-f04983d16385" LABEL="mojo:0" TYPE="linux_raid_member" PARTUUID="0004e809-01"
/dev/sdc1: UUID="409bb846-c04b-a3d6-cff5-46feb63ce279" UUID_SUB="63ec26cb-7468-8e16-1e32-08e984d3245d" LABEL="mojo:0" TYPE="linux_raid_member" PARTUUID="69ed0c28-01"

sudo mount /dev/md0 /mnt/mirror
mount: /mnt/mirror: wrong fs type, bad option, bad superblock on /dev/md0, missing codepage or helper program, or other error.
sudo blkid /dev/md0

No output from blkid on /dev/md0.

相關內容