Testdisk not working properly

This problem appears when trying to recover deleted files.

First of all, I’ve used Testdisk successfully to recover files from an NTFS partition. The issue I have is when I try to do the same from ext4 partitions. Furthermore there are articles on the web which contradict each other when explaining how to do this.

I’ve tried testing this out by deliberately deleting a few files from my Home folder, then followed this article, which seems to be the clearest in explaining this. However towards the bottom of the article when given the option of listing files, only those that already exist ( ie a current listing of my user directory) are shown. Nothing ever shows up as deleted.

I’m stumped.

Which part exactly?
Towards the bottom it goes over regular actions for listing, such as ls which should only produce existing files. That part of the article is assuming that you successfully recovered the files during previous operations.

from what I know:
testdisk will show you files that it finds
deleted or not - does not matter

but just files - not the original names, or the structures they where stored in
just the files (without name) - just the content

Perhaps it can recover the directory structure also - perhaps

If you look at the listing, not only does it list those files that already exist, but also after those files shows those that have been deleted (in red).

No, thats not what ls does.
But I suppose we can take this as confirmation you do indeed mean from within testdisk, ex:

We can now see the files that belong to the dave account. The entries in red have been deleted. We navigate through the files and directories until we locate the files we want to recover.

And not at the bottom of the article, which is outside of, and after using, testdisk, ex:

Let’s take another look at the recovered files using the -l (long listing) option:

ls -l

Sorry. I don’t wish to be rude, but what are you talking about??

Where did I mention anything about running the ls command or what ls does? I know what the command ls does. I’m talking about a problem I’m having retrieving deleted files within Testdisk. Yes/no? This article is about using Testdisk - yes/no?

What do you think I mean? Why do you think I referred you to this article if it wasn’t about the problem I’m having with Testdisk that I’m discussing? If English isn’t your first language then I apologise. But if you are just going to obfuscate and reduce every sentence I’ve written into a question of semantics then it’s not being helpful.

If you read this article it clearly shows that when listing for deleted files/folders within a user’s home folder (Dave) that you a get a listing of all folders and files present, together with those shown as deleted (in red) - Yes/no?

So … when doing a test run, when I delete files none of them show up in the listing, or deleted in red. And I’m trying to find out why this is,…not that I’m optimistic about finding a solution here.

At the bottom of the article it instructs the user to do things like ls … and you werent very explanatory about what exactly you were doing … which is why I asked for clarification.
Have fun, I guess.

using testdisk on NTFS vs EXT4 has yielded totally opposite result for me, almost no use with EXT4.

recommend you try testing with extundelete, ext4magic instead

Testdisk is working as testdisk is supposed to work.

The general recommendation is

  • ensure you plenty diskspace
  • before any attempt to rescue anything
    • create an image file from the disk you want to salvage
  • mount the image on a loop device
  • only work from the image
  • any salvage files is saved on another external device

search for tools like

  • ddrescue
  • dc3dd
  • dcfldd

Use phrases like forensic dd to learn how to process dd images without altering the content of the device image.

There is likely other tools - these are suggestions …

At last, someone who has actually tried Testdisk and posted something helpful and relevant even though it’s brief.

You’re agreeing with what I was saying in my OP viz:
I’ve used Testdisk successfully to recover files from an NTFS partition. The issue I have is when I try to do the same from ext4 partitions.”.

The question still remains how do I recover deleted files with Testdisk? That article I referred to, along with a few others clearly doesn’t work for Linux, and is misleading, even though I find their articles normally to be good.

I’ve not heard of this extundelete, but thnx for that suggestion. I’ll have a look at it if you’ve definitely tried it and know that it works in retrieving deleted files on ext4.

Just as a final note, this has to be the worst forum I’ve ever encountered re Linux. There seem to be a clique of people on here who deliberately try to BS users who are having whatever issues with Linux. And not just me. I’ve seen other Linux posters being messed around in an obviously unhelpful and similar way.

Partition Recovery and File Undelete

Right at the top is the feature list of the program.

Recovering/undeleting files from ext file systems beside anything else than ext2 is not among those features. :man_shrugging:

There is the option of mounting ext3/4 filesystems as ext2 - perhaps that would facilitate progress using this tool … IDK
but as it is, it is not advertized to be able to do what you want to use it for.

I hope this was as unhelpful as anything else you got here …


I thought I saw that somewhere at the time, but checked my article link again and don’t see that info. Whereabouts is it mentioned in there? I see it’s on the listing of your link, but every other recovery aspect, eg recovering partitions includes ext4 ones is mentioned. In my article link near the top they mention recovering files within ext4, and show them in an image.

If that really is an anomaly - not recovering deleted files within ext4 - you’d think they’d have made a serious mention of that in my article link.

Don’t take it personally. :wink: You were being helpful and what you pointed out was certainly relevant.

I never do.
Totally useless and unwarranted in every way imaginable.