Bad starting head (CHS and LBA don't match)
Posted: 15 Sep 2019, 19:34
Trying to understand the undelete mechanism I am reading the testdisk source code. And I noticed something which I don't understand: In function i386_entry2partition, at point:
in this case start.head is 255 and disk_car->geom.heads_per_cylinder is 255 which lead to error from subject (Bad starting head (CHS and LBA don't match).
I have tested this code on 8GB USB stick formated as exFAT. However, when I run testdisk_win.exe on this USB stick, at "Analyse" option, I got
this could be the cause for this error ? I doubt, because this stick is usable without any error ...
The fact is that static list_part_t* read_part_i386(disk_t* disk_car, const int verbose, const int saveheader) is not return me the list_part_t object correctly ...
Can you tell me what is going wrong here ?
Code: Select all
if (start.head >= disk_car->geom.heads_per_cylinder)
{
if (partition->errcode == BAD_NOERR)
partition->errcode = BAD_SH;
}
I have tested this code on 8GB USB stick formated as exFAT. However, when I run testdisk_win.exe on this USB stick, at "Analyse" option, I got
Code: Select all
Current partition structure:
Partition Start End Size in sectors
1 * HPFS - NTFS 0 1 1 983 36 13 15794113
Bad sector count.
The fact is that static list_part_t* read_part_i386(disk_t* disk_car, const int verbose, const int saveheader) is not return me the list_part_t object correctly ...
Can you tell me what is going wrong here ?