How to clone PMBR disk with bad sectors?
I'm trying to clone 1TB disk with PMBR partition and bad sectors. Which has working Windows partitions on it, and is bootable via MBR. blkid
doesn't recognize partitions
/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:
I tried in gdisk
with (2
) (r
) (b
) (w
) but result didn't want to write
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 doesn't recognize partitions
I tried gparted and Rescue system partitions
but it was scanning all night and nothing.
using: cfdisk /dev/sdc
works fine
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
How can I mount partitions under fedora or PartedMagic live? Thanks
I ended up using tips from Nikita, and made emulation qemu-img create -f qcow2 -b /dev/sdc -F raw /tmp/snap.qcow2
dnf install nbd
modprobe nbd
qemu-nbd -c /dev/nbd0 /tmp/snap.qcow2
gdisk /dev/ndb0
Then I used 2
, r
(recover), l
(load MBR and create GPT - as GPT partition was corrupted), w
(write to disk) clonezilla
didn't want to work as new disk was smaller and even though they suggest to use -C
to skip checking target disk size in commandline, but it doesn't work.
So command line for direct mirror would be (with clonezilla) sbin/ocs-onthefly -g auto -e1 auto -e2 -j2 -r -rescue -icds -C -v -sfsck -k -pa choose -f nbd1 -t sdb
I had to manually create partitions in the new disk, format them, mount
them and use rsync
The last step is to boot into Windows install USB - Repair mode. Go to command prompt
diskpart
inside choose list vol
- To list Volumes sel vol X
- Select volume of the first FAT32 partition for UEFI boot assign letter b:
- Assign letter to be able to write boot efi boot bcdboot c:\Windows /l en-us /s c: /f All
write MBR record if you need legacy boot (Assuming System disk is under C:) bcdboot c:\Windows /s b: /f UEFI
- Write EFI boot record to EFI partition so you can boot on new machines.
It has to be done manually, but it would actually be quicker then playing with clonezilla, ddrescue, trying to save/copy partitions. So if you come accross similar problem you can save some time.
Regards