dd イメージが大きすぎて回復できません。

dd イメージが大きすぎて回復できません。

ddを使って画像を作成しました。

sudo dd if=/dev/sda of=/path_to_external_drive/backup.img

今、すべてのパーティションが正常にマウントされた後にシステムを復元したいと思います。私がするとき

sudo dd if=backup.img of=/dev/sda

システムを起動しようとするまで、エラーメッセージは表示されません。

sudo fdisk -lBIOSがパーティションを見つけることができない理由を知りたかったので、次のエラーメッセージが表示されました。

パーティション 1 は物理セクタ境界では開始されません。

だから、Live StickでDisk Image Writerを使ってみましたが、41kBの画像が大きすぎることがわかりました。

どうすればこれが起こりますか?どうすれば解決できますか?新しいSSDを購入する以外にシステムを復元する他の方法はありますか?

fdisk -l backup.img:

fdisk -backup.imgの-l fdisk -l /dev/sda:

GPT PMBR size mismatch (976773247 != 976773167) will be corrected by w(rite).

Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
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: 0x635f93a2

Device     Boot Start       End   Sectors   Size Id Type
/dev/sda1           1 976773247 976773247 465.8G ee GPT

Partition 1 does not start on physical sector boundary.

gdisk -l /dev/sda:

GPT fdisk (gdisk) version 1.0.1

Warning! Disk size is smaller than the main header indicates! Loading
secondary header from the last sector of the disk! You should use 'v' to
verify disk integrity, and perhaps options on the experts' menu to repair
the disk.
Caution: invalid backup GPT header, but valid main header; regenerating
backup header from main header.

Warning! One or more CRCs don't match. You should repair the disk!

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: damaged

****************************************************************************
Caution: Found protective or hybrid MBR and corrupt GPT. Using GPT, but disk
verification and recovery are STRONGLY recommended.
****************************************************************************

Disk /dev/sda: 976773168 sectors, 465.8 GiB  
Logical sector size: 512 bytes  
Disk identifier (GUID): 8DC2A4AA-C369-4ED8-B876-DCE0418A1BD0  
Partition table holds up to 128 entries  
First usable sector is 34, last usable sector is 976773214  
Partitions will be aligned on 2048-sector boundaries

Total free space is 4157 sectors (2.0 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name  
   1            2048          923647   450.0 MiB   2700  Basic data partition  
   2          923648         1128447   100.0 MiB   EF00  EFI system partition  
   3         1128448         1161215   16.0 MiB    0C01  Microsoft reserved ...  
   4         1161216       669571071   318.7 GiB   0700  Basic data partition  
   5       669571072       960290815   138.6 GiB   8300  
   6       960290816       976771071   7.9 GiB     8200  

ベストアンサー1

イメージファイルは、ディスク(976773248 - 976773168セクタ)より40KB大きいです。ddイメージ全体をディスクに書き込むことはできません。あなたのddコマンドに「残りのスペースがない」などの警告が表示されているようです。

しかし、あなたは幸運です。最後の(6番目)パーティションはスワップパーティションです。gdisk and mkswap以下を使用して、最後のパーティションのサイズを変更し、パーティションテーブルを変更できます。

$gdisk /dev/sda

  1. 最後のパーティションの削除
  2. gptパーティションテーブルの回復(自動的に実行する必要があります)
  3. 最後のパーティションを再作成します(以前より小さくなります)。

次に、新しいスワップパーティションをフォーマットします。

$ mkswap /dev/sda6

対話型の使用に関するgdisk注意事項:

gdisk /dev/sda私はあなたに何を見せるか全く予測できません。ヘルプについては「h」と入力してください。最後のパーティションを削除するには、「d」と入力してから「6」と入力します。 「n」と「6」は最後のパーティションを再作成します。終了し、「w」を使用して変更を作成します。 "w"で終了しないと、gdiskは何も書きません。わからない場合は、いつでも「q」または「ctrl-c」を使用して終了/キャンセルできます。

おすすめ記事