Clonezilla

如何複製帶有壞扇區的 PMBR 磁碟?

  • May 25, 2021

我正在嘗試使用 PMBR 分區和壞扇區複製 1TB 磁碟。它上面有工作的 Windows 分區,並且可以通過 MBR 啟動。

blkid不辨識分區

/dev/sdc: PTTYPE="PMBR"

gdisk /dev/sdc

   GPT fdisk (gdisk) version 1.0.7

Caution: invalid main GPT header, but valid backup; regenerating main header
from backup!

Caution! After loading partitions, the CRC doesn't check out!
Warning: Invalid CRC on main header data; loaded backup partition table.
Warning! Main and backup partition tables differ! Use the 'c' and 'e' options
on the recovery & transformation menu to examine the two tables.

Warning! One or more CRCs don't match. You should repair the disk!
Main header: ERROR
Backup header: OK
Main partition table: ERROR
Backup partition table: ERROR

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

Found valid MBR and corrupt GPT. Which do you want to use? (Using the
GPT MAY permit recovery of GPT data.)
1 - MBR
2 - GPT
3 - Create blank GPT

Your answer: 

我嘗試gdisk使用 ( 2) ( r) ( b) ( w) 但結果不想寫

Warning! Main partition table overlaps the first partition by 34 blocks!
You will need to delete this partition or resize it in another utility.

Warning! Secondary partition table overlaps the last partition by
17599083851618035976 blocks!
You will need to delete this partition or resize it in another utility.

Problem: partitions 121 and 119 overlap:
 Partition 121: 925735787758310161 to 13474437941687892909
 Partition 119: 11147454187938441805 to 15638604846186930334

Problem: partitions 121 and 120 overlap:
 Partition 121: 925735787758310161 to 13474437941687892909
 Partition 120: 3391649715396322562 to 7297187905800799496

Problem: partitions 122 and 120 overlap:
 Partition 122: 3391649715396322562 to 7297187905800799496
 Partition 120: 3391649715396322562 to 7297187905800799496

Problem: partitions 122 and 121 overlap:
 Partition 122: 3391649715396322562 to 7297187905800799496
 Partition 121: 925735787758310161 to 13474437941687892909

Problem: partitions 123 and 119 overlap:
 Partition 123: 925735787758310161 to 13474437941687892909
 Partition 119: 11147454187938441805 to 15638604846186930334

Problem: partitions 123 and 120 overlap:
 Partition 123: 925735787758310161 to 13474437941687892909
 Partition 120: 3391649715396322562 to 7297187905800799496

Problem: partitions 123 and 121 overlap:
 Partition 123: 925735787758310161 to 13474437941687892909
 Partition 121: 925735787758310161 to 13474437941687892909

Problem: partitions 123 and 122 overlap:
 Partition 123: 925735787758310161 to 13474437941687892909
 Partition 122: 3391649715396322562 to 7297187905800799496

Problem: partitions 124 and 119 overlap:
 Partition 124: 10336404087008029236 to 15113227714779688721
 Partition 119: 11147454187938441805 to 15638604846186930334

Problem: partitions 124 and 121 overlap:
 Partition 124: 10336404087008029236 to 15113227714779688721
 Partition 121: 925735787758310161 to 13474437941687892909

Problem: partitions 124 and 123 overlap:
 Partition 124: 10336404087008029236 to 15113227714779688721
 Partition 123: 925735787758310161 to 13474437941687892909
Aborting write operation!
Aborting write of new partition table.

clonezilla 無法辨識我嘗試過 gparted 的分區,Rescue system partitions 但它整晚都在掃描,什麼也沒有。

使用: cfdisk /dev/sdc 工作正常

                                                                             Disk: /dev/sdc
                                                       Size: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
                                                                   Label: dos, identifier: 0x9f9fd106

   Device                 Boot                              Start                   End               Sectors              Size            Id Type
>>  /dev/sdc1                                                    1                206846                206846              101M            ee GPT                        
   /dev/sdc2              *                                206848             617201663             616994816            294.2G             7 HPFS/NTFS/exFAT
   /dev/sdc3                                            617201664            1916342271            1299140608            619.5G             7 HPFS/NTFS/exFAT
   /dev/sdc4                                           1916342272            1953316862              36974591             17.6G            c0 unknown
   Free space                                          1953316864            1953525167                208304            101.7M     

                                

如何在 fedora 或 PartedMagic live 下掛載分區?謝謝

**始終從對磁碟進行扇區級備份開始。**案例如ddrescue,甚至類似的東西dd conv=noerror,notrunc,sync,或者你認為合適的任何東西來做。低級工具是首選,因為它們可以讓您更好地控制正在發生的事情。

我懷疑磁碟的某些前導扇區壞了。這就是為什麼恢復 GPT 不能很好地工作的原因。如果是這種情況(您可以通過讀取dmesg或檢查備份後的輸出dd或日誌文件來檢查這一點ddrescue),您可能會成功執行以下操作:將此扇區級備份轉儲到與失敗備份完全相同大小的設備上。然後嘗試恢復複製設備上的分區表。

另外,如果你得到的分區表cfdisk是正確的,你可以嘗試在核心中“手動”設置分區塊設備partxkpartx(請閱讀man partx詳細資訊)。


在不使用相同大小的附加設備的情況下執行所有恢復操作的有希望的方法是使用 qemu 虛擬磁碟。您設置了支持設備的映像覆蓋,這將是您的故障磁碟或更好的備份映像文件:

qemu-img create -f qcow2 -b /dev/sdX -F raw /tmp/snap.qcow2

/tmp必須有足夠的空間來容納所有“更新”的扇區,具體取決於可能從幾十兆字節到幾千兆字節不等的故障規模。sdX是您的故障設備。

現在,將映像作為網路塊設備附加到系統:

qemu-nbd -c /dev/nbd0 /tmp/snap.qcow2

您可能需要先載入模組nbd

對 的寫入/dev/nbd0將最終寫入snap.qcow2,如果有這樣的扇區,將從它執行讀取,如果映像中仍然沒有這樣的扇區,則從後端設備執行讀取。現在,在 上執行所有恢復操作/dev/nbd0,例如,嘗試在其上修復 GPT,然後恢復分區。

引用自:https://serverfault.com/questions/1064597