iSCSIディスクを回復する方法

iSCSIディスクを回復する方法

Linuxサーバー(RHEL7)でiSCSIディスクを実行しています。ディスクには、Windows NTFSファイルシステムを持つ仮想ディスクにマップされるdisk01.imgというループデバイスを含む汎用ext4パーティションがあります。 WindowsとLinuxシステム間のイーサネット接続が失われるまで、すべてが大丈夫でした。 WindowsはNTFSボリュームを確認する必要があると判断し、最終的に再フォーマットすることをお勧めします。受け入れる前に、Linuxサーバーの/ savedirにdisk01.imgファイルを保存しました。これでdisk01.imgを復元しようとして問題が発生しました。

[root@server ~]# losetup -P /dev/loop1 /savedir/disk01.img
[root@server ~]# mount -t ntfs /dev/loop1 /mount/point
Failed to read bootsector (size=0)
Failed to sync device /dev/loop1: Input/output error
Failed to mount '/dev/loop1': Ongeldig argument
The device '/dev/loop1' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?

NTFSボリュームが破損している可能性があると思います。空のNTFSパーティションを持つUSBディスクにdisk01.imgファイルを追加し、USBディスクをWindowsに移植してchkdskを実行して失敗した場合は、別の方法でファイルを修復してみてください。写真記録も同じだ。それとも間違ったコードを使用していますか?

編集:fdiskの結果(オランダ語)

[root@server ~]# fdisk -l /savedir/disk01.img

Schijf /savedir/disk01.img: 750.2 GB, 750155323392 bytes, 1465147116 sectoren
Eenheid = sectoren van 1 * 512 = 512 bytes

Sectorgrootte (logischl/fysiek): 512 bytes / 512 bytes
in-/uitvoergrootte (minimaal/optimaal): 512 bytes / 512 bytes

[root@server ~]#

編集2:NTFSボリュームが破損しているため、losstup -Pは機能しますが空のパーティションが作成されます。 iSCSIセクタオフセットを使用して/savedir/disk01.imgをマウントする必要があるかもしれません。

mount -o loop,offset=512 /savedir/disk01.img /mount/point

しかし、正しいオフセットを見つけるのに問題があります(NTFS署名の検索、* .imgファイルの16進ダンプと新しく作成された仮想ディスクの16進ダンプの比較)。注:ファイルを解析するために、disk01.imgのddコピーをWindowsに再移植しました。この退屈な作業を続けています。 disk01.imgでNTFSファイルシステムの先頭を探す方が良い選択です。

編集3. TestDiskを4回実行した後に解決できない幾何学的問題があるようです。出力:

losetup -P /dev/loop1 /savedir/disk01.img
testdisk /dev/loop1

Disk /dev/loop1 - 750 GB / 698 GiB - 1465147116 sectors
... ... ...
  Linux filesys. data            0 1465147111 1465147112
  Linux filesys. data            0 1465147111 1465147112
Warning: number of heads/cylinder mismatches 255 (NTFS) != 1 (HD)
Warning: number of sectors per track mismatches 63 (NTFS) != 1 (HD)
Warning: number of heads/cylinder mismatches 255 (NTFS) != 1 (HD)
Warning: number of sectors per track mismatches 63 (NTFS) != 1 (HD)
  MS Data                100452352 1526511615 1426059264
  Linux filesys. data            0 1465147111 1465147112
... ... ...
  Linux filesys. data    730080712 2195227823 1465147112
  Linux filesys. data    730090720 2195237831 1465147112
... ... ...
  Linux filesys. data    730093536 2195240647 1465147112
  Linux filesys. data            0 1465147111 1465147112
Warning: number of heads/cylinder mismatches 255 (NTFS) != 1 (HD)
Warning: number of sectors per track mismatches 63 (NTFS) != 1 (HD)
Warning: number of heads/cylinder mismatches 255 (NTFS) != 1 (HD)
Warning: number of sectors per track mismatches 63 (NTFS) != 1 (HD)
  MS Data               1346517247 2772576510 1426059264

------------------------------------------------------

-- After Reboot --

  Linux                          0 1465147111 1465147112
  Linux                          0 1465147111 1465147112
check_FAT: can't read FAT boot sector
Invalid FAT boot sector
 0 D FAT16 LBA             3179978961 3795078107  615099147
  FAT16 LBA             3179978961 3795078107  615099147
  Linux                          0 1465147111 1465147112
Invalid FAT boot sector
 0 D FAT12                  202831329 1489073369 1286242041
  FAT12                  202831329 1489073369 1286242041
  Linux                          0 1465147111 1465147112
Invalid NTFS or exFAT boot
 0 D HPFS - NTFS           2833862451 3582746086  748883636
  HPFS - NTFS           2833862451 3582746086  748883636
Warning: number of heads/cylinder mismatches 255 (NTFS) != 1 (HD)
Warning: number of sectors per track mismatches 63 (NTFS) != 1 (HD)
Warning: number of heads/cylinder mismatches 255 (NTFS) != 1 (HD)
Warning: number of sectors per track mismatches 63 (NTFS) != 1 (HD)
  HPFS - NTFS            100452352 1526511615 1426059264


Disk /dev/loop1 - 750 GB / 698 GiB - 1465147116 sectors

The harddisk (750 GB / 698 GiB) seems too small! (< 1943 GB / 1809 GiB)
Check the harddisk size: HD jumper settings, BIOS detection...

The following partitions can't be recovered:
     Partition               Start        End    Size in sectors
>  HPFS - NTFS            100452352 1526511615 1426059264
   FAT12                  202831329 1489073369 1286242041
   Linux                  730069008 2195218167 1465149160
   Linux                  730071112 2195218223 1465147112
   Linux                  730079744 2195226855 1465147112
   Linux                  730080712 2195227823 1465147112
   Linux                  730090720 2195237831 1465147112
   Linux                  730093536 2195240647 1465147112
   HPFS - NTFS           1346517247 2772576510 1426059264
   HPFS - NTFS           1465145007 2930290014 1465145008


NTFS, blocksize=4096, 730 GB / 679 GiB

--------------------------------------

-- After adding TestDisk MBR, Reboot

  Linux                          0 1465147111 1465147112
  Linux                          0 1465147111 1465147112
  Linux                          0 1465147111 1465147112
  Linux                          0 1465147111 1465147112
check_FAT: can't read FAT boot sector
Invalid FAT boot sector
 0 D FAT16 LBA             3179978961 3795078107  615099147
  FAT16 LBA             3179978961 3795078107  615099147
  Linux                          0 1465147111 1465147112
  Linux                          0 1465147111 1465147112
Invalid FAT boot sector
 0 D FAT12                  202831329 1489073369 1286242041
  FAT12                  202831329 1489073369 1286242041
  Linux                          0 1465147111 1465147112
Invalid NTFS or exFAT boot
 0 D HPFS - NTFS           2833862451 3582746086  748883636
  HPFS - NTFS           2833862451 3582746086  748883636
Warning: number of heads/cylinder mismatches 255 (NTFS) != 1 (HD)
Warning: number of sectors per track mismatches 63 (NTFS) != 1 (HD)
Warning: number of heads/cylinder mismatches 255 (NTFS) != 1 (HD)
Warning: number of sectors per track mismatches 63 (NTFS) != 1 (HD)
  HPFS - NTFS            100452352 1526511615 1426059264

-------------------------------------

-- After Reboot, running Deeper Analysis ---

Disk /dev/loop1 - 750 GB / 698 GiB - 1465147116 sectors


  No partition          36028797018963967 1465147115 1465147117

Enter the ending sector 

--------------------------------------

ベストアンサー1

マウント失敗は、イメージ/dev/loop1ファイルが有効なパーティションイメージではないことを示します。 iSCSIディスクとして使用されるイメージのコピーなので、パーティションテーブルを含むフルディスクイメージであることを望みます。

ただし、fdisk -l /savedir/disk01.img認識されたパーティションテーブルが存在しないことを示します。 iSCSIディスクがMicrosoft Storage Spaces設定の一部として使用されていても、少なくとも一つパーティションが存在します。

MBRパーティションテーブルのみを認識する以前のバージョンがあり、イメージがfdiskGPTパーティションテーブルを使用している場合でも、少なくともGPTを検出する必要があります。保護MBRそして0xee型の仮想パーティションエントリです。

これは、パーティションテーブルが破損しているか上書きされる可能性があることを示します。フルディスクループデバイスを使用して、testdiskファイルシステムの開始と終了を見つけて、パーティションテーブルを再構築できることを確認できます。

testdisk /dev/loop1

あるいは、最新バージョンのWindowsでは、通常、ディスクの最初から正確に1MiB離れた場所にディスクの最初のパーティションの先頭を配置します。したがって、次のことを試すことができます。

mount -o loop,offset=1M /savedir/disk01.img /mount/point

おすすめ記事