Request to improve TestDisk partition display

How to use TestDisk to recover lost partition
Forum rules
When asking for technical support:
- Search for posts on the same topic before posting a new question.
- Give clear, specific information in the title of your post.
- Include as many details as you can, MOST POSTS WILL GET ONLY ONE OR TWO ANSWERS.
- Post a follow up with a "Thank you" or "This worked!"
- When you learn something, use that knowledge to HELP ANOTHER USER LATER.
Before posting, please read https://www.cgsecurity.org/testdisk.pdf
Locked
Message
Author
SteveSi
Posts: 2
Joined: 30 May 2021, 13:30

Request to improve TestDisk partition display

#1 Post by SteveSi »

First, I must thank you very much for the marvellous TestDisk utility which I have used many times to recover data from drives.
However, with larger drives the CHS notation displayed by TestDisk is not very useful.
For MBR drives:
Separate the column headings with an empty line
It also does not display the partition type number which would be very useful (in hex). Type 07 is displayed as 'HPFS - NTFS' but can also be exFAT.

Most of all, it does not display the LBA addresses for Start, Size and calculated End for each partition.
These would be easy to add and would make it a lot easier to use (most other utilities use LBA)
It would also help if, as well as the partition size in sectors, you could also display the size in byte units - e.g. KiB, MiB, GiB, TiB.
When adding partitions to make a new partition table, I can easily look at the Start and End LBA numbers to see if they make sense.
TestDisk 6.10, Data Recovery Utility, July 2008
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

Disk /dev/sde - 500 GB / 465 GiB - CHS 60801 255 63
Current partition structure:
Partition Start End Size in sectors

1 P HPFS - NTFS 0 32 33 52885 177 28 849606656 [M2_1_NTFS]
2 P FAT32 LBA 52885 201 21 56675 17 14 60874752 [M2-2_FAT32]
3 P HPFS - NTFS 56675 25 55 60801 80 15 66287616 [M2_PTN3]
No partition is bootable
Maybe like this:
TestDisk 6.10, Data Recovery Utility, July 2008
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

Disk /dev/sde - 500 GB / 465 GiB - CHS 60801 255 63
Current partition structure:
(NEW LINE HERE]
Partition Start(CHS) End(CHS) Size in sectors
1 P HPFS - NTFS 0 32 33 52885 177 28 849606656 [M2_1_NTFS] LBA Start=2048 End=849608703 Size=849606656 (414847MiB)
2 P FAT32 LBA 52885 201 21 56675 17 14 60874752 [M2-2_FAT32] LBA Start=849610208 End=xxxxxx Size=xxxxxxx (xxxxMiB)
3 P HPFS - NTFS 56675 25 55 60801 80 15 66287616 [M2_PTN3] LBA Start=xxxxx End=xxxxxx Size=xxxxxxx (xxxxMiB)
No partition is bootable
Or perhaps you could add an option to display as CHS or LBA so the user could choose?
Many thanks.

recuperation
Posts: 2719
Joined: 04 Jan 2019, 09:48
Location: Hannover, Deutschland (Germany, Allemagne)

Re: Request to improve TestDisk partition display

#2 Post by recuperation »

Please note that the current version of the Testdisk package is 7.2 WIP.
If you don't use the most recent version anyway adding a new feature for you does not really look convincing.

With GPT in modern computers becoming more and more common Testdisk shows you exact LBA figures.

SteveSi
Posts: 2
Joined: 30 May 2021, 13:30

Re: Request to improve TestDisk partition display

#3 Post by SteveSi »

Thanks for reply. I did use 7.2 but somehow I seem to have taken the screenshots with an old version!

According to wiki, location offset 8 of the MBR partition table entry contains the LBA start address
https://en.wikipedia.org/wiki/Master_boot_record
'0x08 4 bytes LBA of first absolute sector in the partition[f]'
This must be used for larger drives and so must be valid.
It is used instead of the old CHS values and so it ought to be displayed?
Adding the LBA Start address and End address would be most useful.

P.S. Once Analyse has started with 7.2 I am having trouble pressing S to stop it??? It does not stop... I also don't see any progress indicator but HDD LED is flashing.
Have to close the console window to stop it.

User avatar
cgrenier
Site Admin
Posts: 5432
Joined: 18 Feb 2012, 15:08
Location: Le Perreux Sur Marne, France
Contact:

Re: Request to improve TestDisk partition display

#4 Post by cgrenier »

I don't plan to add LBA display for PC/Intel partition table in the interactive text interface but "testdisk -lu" lists the LBA address of all partitions.

Locked