I am trying to recover partitioning information using TestDisk. To try things out I copied all data from the original harddisc to another physical drive using dd as follows:
$ dd if=/dev/sda of=/dev/sdb bs=4096 conv=notrunc,noerror,sync
Running TestDisk on the original drive shows up like this:
Disc /dev/sda - 500 GB / 465 GiB - CHS 969021 16 63
Warning: the current number of heads per cylinder is 16
but the correct value may be 255
You can use the Geometry menu to change this value.
It's something to try if
- some partitions are not found by TestDisk
- or the partition table can not be written because partitions overlaps.
And after continuing without changing anything "Quick analyze" outputs:
Disk /dev/sda - 500 GB / 465 GiB - CHS 969021 16 63
Partition Start End Size in sectors
* HPFS - NTFS 2 0 33 205 3 19 204800 [System-reserviert]
P HPFS - NTFS 205 3 20 203174 9 41 204593152 [W764]
P Linux 203176 10 11 305359 3 51 103000064
L Linux 313112 6 7 373707 2 50 61079552
HPFS - NTFS 373707 2 51 969022 15 47 600078336 [DATA]
HPFS - NTFS 373707 2 58 969020 15 63 600076329
Running TestDisk "Quick analyze" on the test drive show up like this:
Disk /dev/sdb - 500 GB / 465 GiB - CHS 969021 255 63
Partition Start End Size in sectors
HPFS - NTFS 0 32 33 12 223 19 204800 [System-reserviert]
HPFS - NTFS 12 223 20 12748 53 41 204593152 [W764]
Linux 12748 86 11 19159 202 51 103000064
Linux 19646 68 7 23448 74 50 61079552
HPFS - NTFS 23448 74 51 60801 112 47 600078336 [DATA]
The discs are not by the same brand. The test drive is a SSD. It seems as if the partitioning information is not copied to the test drive. Why?
The output of sfdisk is the same for both discs. Here for /dev/sda:
$ sudo sfdisk -d /dev/sda
# partition table of /dev/sda
unit: sectors
/dev/sda1 : start=376696782, size=600076386, Id= 7, bootable
/dev/sda2 : start= 0, size= 0, Id= 0, bootable
/dev/sda3 : start= 0, size= 0, Id= 0, bootable
/dev/sda4 : start= 0, size= 0, Id= 0, bootable
Here is the output of parted. The disc model differs - the other data is the same:
$ sudo parted /dev/sda print
Model: Disk Name (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File systems Flags
1 193GB 500GB 307GB primary ntfs boot
The geometry (as seen by the kernel) for the S-ATA disc ...
$ sudo sfdisk -g /dev/sda
/dev/sda: 969021 cyclinders, 16 heads, 63 sectors/track
... and for the SSD disc
$ sudo sfdisk -g /dev/sdb
/dev/sdb: 60801 cyclinders, 255 heads, 63 sectors/track