When run, Microsoft Fdisk destroys some data.
While "checking disk integrity", FDISK writes hexadecimal F6h into the first
and 7th sectors on each track. If you have accidentally deleted a volume, do
not run fdisk! More info here
DOS version of TestDisk uses three BIOS calls to get the disk geometry. It gets the numbers of cylinder, head, sector from function 8/int 0x13, but this function is limited to small harddisk (maximum values are 1024 cylinders, 255 heads, 63 sectors: 8GB at best). If enhanced BIOS disk calls are avaible (check by calling function 0x41/int 0x13), it gets the disk size from function 0x48/int 0x13 and calculates the number of cylinder.
CHS (Cylinder, Head, Sector) value is limited by storage in the partition table to 1023,254,63. There are two ways to store the CHS value:
first way
convert LBA to CHS, store (cylinder & 0x3FF, head, sector)
It's what Partition Magic do.
second way
convert LBA to CHS if cylinder <= 1023,
store (cylinder & 0x3FF, head & 0xFF, sector & 0x3F)
else
store (1023, max_head, max_sector)
It's what Linux fdisk and TestDisk do.
When TestDisk check the partition table, it consider the two ways are correct. The second way is better because start CHS is always lower or egal to end CHS.
Exemple: The harddisk logical geometry is 255 heads per cylinder and 63 sectors per head. A partition begins at LBA=46781280 or CHS=2912,0,1. This partition ends at 3072,254,63.
NB: 1023 = 0x3FF (1023*255+254)*63+63-1=16450559 (2912*255+ 0)*63+ 1-1=46781280
Partition Magic considers the second way as invalid. TestDisk handle both without complaining.
Return to TestDisk main page