Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testdisk recovers same files again and again in linux #143

Open
estatistics opened this issue Sep 16, 2023 · 3 comments
Open

Testdisk recovers same files again and again in linux #143

estatistics opened this issue Sep 16, 2023 · 3 comments

Comments

@estatistics
Copy link

estatistics commented Sep 16, 2023

I have a faulty disk (ext4 linux).
I started testdisk.
It analyzes the hdd disk and founds something like that structure

Folders:
"a" (with red color)
"copy a" (with red color)
"a" (with green color)
"copy a" (with green color)

I found out that some files may exists in specific folders but not all. However, testdisk recovers same files again and again.
In ext4 files/folders I think they are attached with hard links.
I think that testdisk, at least in ext4 format, it must have an option to not recover duplicated files eg. based on name/folder structure and size.

Also, it will be nice to provide to extract the directory tree only without data
and given that directory txt, to be able to provide testdisk with specific folders to recover eg. testdisk --recover folders.txt

TestDisk 7.1, Data Recovery Utility, July 2019 in linux debian.

@estatistics estatistics changed the title Testdisk recover same files again and again in linux Testdisk recovers same files again and again in linux Sep 16, 2023
@cgsecurity
Copy link
Owner

Hardlinks are not valid for directories.
Do you have the problem with copying both deleted and not deleted-files ? 'h' can use to hide deleted files.

@estatistics
Copy link
Author

estatistics commented Oct 8, 2023

I may not stated clearly my problem and enhancements

DIR A has files aa,ab,ac, DIR B has files ba bb bc DIR C has files ca cb cc.
Because directory structure has been faulty, some infinitive circulation becomes.
eg. ac becomes ac.DIR which contains DIR.B and DIR.A.

So recovering DIRA leads to recover DIRB and DIRA, and then again to recover DIRA which contains BIRB and DIRA.
This has happen 2 times and testdisk is infinitively recover only these data again and again.
DIR.C is never recovered and recovery for about a month didnt stop to recover in my computer!
Speed it was very low due to disk problems. Must be recovered same folders over 4 times again and again. My HDD had about ~3tb of data but recovered only ~1TB again and again for about 1 month!

  1. TESTDISK may output the current folder/file for recovery.
  2. TESTDISK may provide an option to explicity extract only the directory tree without file recovery
  3. TESTDISK may be able using dir_to_recover.txt, to recover specific files.
  4. TESTDISK must be able to keep a tree log. and the points that it is corrupted and leads to recovery circles, it must be able to break / skip same directory for recover if it has been already recovered.

Same - folder repetition - problem for SSD disk was also found when i had power brakes.

@cgsecurity
Copy link
Owner

If disk contains bad sectors, you should clone the disk to a new empty disk using ddrescue as described in https://www.cgsecurity.org/testdisk_doc/ddrescue.html and run testdisk against the clone

If you tried latest 7.2-WIP version, do you have the same problem ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants