Page 1 of 1

How do you guess disk geometry

Posted: 31 Oct 2016, 16:46
by PPCP
I am trying to recover data from a disk that had been improperly plugged into an external enclosing. When using testdisk (on entire disk), I've tried supplying several disk geometries.

If I change anything from the default geometry, testdisk detects it goes against what's written in my partitions, so I guess the default is OK. That is true except for number of cylinders.

How can I guess the correct number of disk cylinders? I've tried default value, some basic arithmetics to match disk size, and found no datasheet online (my disk is WD30EZRX, if you're luckier than me), with no results yet..

Re: How do you guess disk geometry

Posted: 01 Nov 2016, 08:37
by cgrenier
When using a raw disk image, no geometry information is available, so testdisk try to guess it using the partition table values.
Search autoset_geometry in https://git.cgsecurity.org/cgit/testdis ... hdaccess.c for details
Modern partionning tools creates partitions on 1-MB boundary and not anymore on cylinder boundary, so guessing right or wrong the original heads per cylinder and sectors per head has no impact.