從硬體 RAID (Windows) 遷移到軟體 RAID (Linux) 後磁碟對不可用

從硬體 RAID (Windows) 遷移到軟體 RAID (Linux) 後磁碟對不可用

很久以前,我從 JMicron JMB363 卡的啟動選單建立了 RAID1 對。在 Windows 下一切正常,並且 RAID1 陣列被識別為單一磁碟。我不記得磁碟有多少個分割區,但可以肯定的是,有一個 NTFS 分割區,這是鏡像在 Windows 上執行時唯一使用的分割區。

我最近將作業系統從 Windows 遷移到 Linux,並且無法再使用 NTFS 分割區。我可以看到這兩個磁碟從分割區的角度來看是相同的:

#lsblk --fs
...
sdb     linux_raid_member 1.2   MyRAIDLabel <uuid>                
└─md127                                                                                              
sdc     linux_raid_member 1.2   MyRAIDLabel <uuid>                
└─md127    

fdisk指令顯示磁碟對中的 NTFS 分割區

#fdisk -l
Disk /dev/sdc: 465.76 GiB, 500107862016 bytes, 976773168 sectors
...
Device     Boot Start       End   Sectors  Size Id Type
/dev/sdc1        2048 204802047 204800000 97.7G  7 HPFS/NTFS/exFAT


Disk /dev/sdb: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: ST500DM002-1BD14
...
Device     Boot Start       End   Sectors  Size Id Type
/dev/sdb1        2048 204802047 204800000 97.7G  7 HPFS/NTFS/exFAT

然而奇怪的是,檔案系統中沒有/dev/sdb1or ,/dev/sdc1而只有/dev/sdband /dev/sdc。所以NTFS分割區看起來就像是「隱藏」的。

md顯示了該設備

...

Disk /dev/md127: 465.64 GiB, 499973619712 bytes, 976510976 sectors
...

但據我了解,md是透過軟體實現多個磁碟的RAID。我不明白 JMicron 卡是否處理兩個磁碟之間的同步,或者是否由 Windows 驅動程式處理。所以問題是:

當卡片處理 RAID 陣列時,我還需要使用 Linux md 嗎?

如果我嘗試安裝,/dev/md127則會出現錯誤:

#mount -t auto -o loop /dev/md127 /mnt/raid
mount: /mnt/raid: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error.  

如果我嘗試安裝/dev/sdb/dev/sdc收到另一個錯誤:

mount: /mnt/raid: unknown filesystem type 'linux_raid_member'

另一件無法解釋的事情是,如果我從兩個磁碟裝置讀取前 16 個位元組,我會得到與以下結果不同的結果md

# hexdump -C -n 16 /dev/md127
00000000  20 69 6e 20 6f 72 67 2e  61 70 61 63 68 65 2e 68  | in org.apache.h|
00000010
# hexdump -C -n 16 /dev/sdb
00000000  33 c0 8e d0 bc 00 7c 8e  c0 8e d8 be 00 7c bf 00  |3.....|......|..|
00000010
# hexdump -C -n 16 /dev/sdc
00000000  33 c0 8e d0 bc 00 7c 8e  c0 8e d8 be 00 7c bf 00  |3.....|......|..|
00000010

設備似乎md以文件內容啟動。
怎麼可能?
如何恢復數組中的資料?

附加md數據:

以下是mdstat文件中報告的一些附加資訊:

#cat /proc/mdstat 
Personalities : [raid1] 
md127 : active (auto-read-only) raid1 sdb[1] sdc[0]
      488255488 blocks super 1.2 [2/2] [UU]
      bitmap: 0/4 pages [0KB], 65536KB chunk

unused devices: <none>

這是輸出mdadm

mdadm --detail /dev/md127 
/dev/md127:
           Version : 1.2
     Creation Time : Sun Sep  7 17:57:53 2014
        Raid Level : raid1
        Array Size : 488255488 (465.64 GiB 499.97 GB)
     Used Dev Size : 488255488 (465.64 GiB 499.97 GB)
      Raid Devices : 2
     Total Devices : 2
       Persistence : Superblock is persistent

     Intent Bitmap : Internal

       Update Time : Sat Feb 25 20:21:09 2023
             State : clean 
    Active Devices : 2
   Working Devices : 2
    Failed Devices : 0
     Spare Devices : 0

Consistency Policy : bitmap

              Name : MirrorRAID:0
              UUID : 95f02fbb:71f61cca:e24e932f:2dcfc5e0
            Events : 150294

    Number   Major   Minor   RaidDevice State
       0       8       32        0      active sync   /dev/sdc
       1       8       16        1      active sync   /dev/sdb


#mdadm --examine /dev/sdb
/dev/sdb:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : 95f02fbb:71f61cca:e24e932f:2dcfc5e0
           Name : MirrorRAID:0
  Creation Time : Sun Sep  7 17:57:53 2014
     Raid Level : raid1
   Raid Devices : 2

 Avail Dev Size : 976511024 sectors (465.64 GiB 499.97 GB)
     Array Size : 488255488 KiB (465.64 GiB 499.97 GB)
  Used Dev Size : 976510976 sectors (465.64 GiB 499.97 GB)
    Data Offset : 262144 sectors
   Super Offset : 8 sectors
   Unused Space : before=262056 sectors, after=48 sectors
          State : clean
    Device UUID : 934abcd2:ead8a42a:ca23dd27:cd380990

Internal Bitmap : 8 sectors from superblock
    Update Time : Sat Feb 25 20:21:09 2023
  Bad Block Log : 512 entries available at offset 72 sectors
       Checksum : 87fc2008 - correct
         Events : 150294


   Device Role : Active device 1
   Array State : AA ('A' == active, '.' == missing, 'R' == replacing)
#mdadm --examine /dev/sdc
/dev/sdc:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : 95f02fbb:71f61cca:e24e932f:2dcfc5e0
           Name : MirrorRAID:0
  Creation Time : Sun Sep  7 17:57:53 2014
     Raid Level : raid1
   Raid Devices : 2

 Avail Dev Size : 976511024 sectors (465.64 GiB 499.97 GB)
     Array Size : 488255488 KiB (465.64 GiB 499.97 GB)
  Used Dev Size : 976510976 sectors (465.64 GiB 499.97 GB)
    Data Offset : 262144 sectors
   Super Offset : 8 sectors
   Unused Space : before=262056 sectors, after=48 sectors
          State : clean
    Device UUID : ce4a6223:22a98469:8486de1b:16f34071

Internal Bitmap : 8 sectors from superblock
    Update Time : Sat Feb 25 20:21:09 2023
  Bad Block Log : 512 entries available at offset 72 sectors
       Checksum : ecbb0d7c - correct
         Events : 150294


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

相關內容