Testdisk restores only 0 byte files from ext4

Using TestDisk to undelete files
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
Richard
Posts: 3
Joined: 29 Mar 2019, 10:42

Testdisk restores only 0 byte files from ext4

#1 Post by Richard »

Hi,

because of my stupid i deleted all files im home with RM on my raspberry. I switched of the pi immediately and made an image from the whole sd-card. Then i tried to restore the files from the home dir directly from the image but i only could restore file that are 0 bytes big. Testdisk worked perfect so far on nfts partitions. But i have these problems when o try it with ext4. Had the same month ago.

What can i do? Is this limited by the ext4 file system?

Richard

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

Re: Testdisk restores only 0 byte files from ext4

#2 Post by cgrenier »

It's a limit (an optimization for fsck) of ext3/ext4. You have to use photorec to recover lost data from ext4.

Richard
Posts: 3
Joined: 29 Mar 2019, 10:42

Re: Testdisk restores only 0 byte files from ext4

#3 Post by Richard »

I tried it. Now i have a lot of folders called recup_dir.1, recup_dir.2 ... recup_dir.n and the files are named like f<numbers>. photorec can't restore the real folder structure so that i can navigate to the home dir and restore only the needed files?

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

Re: Testdisk restores only 0 byte files from ext4

#4 Post by recuperation »

Richard wrote: 30 Mar 2019, 08:32 I tried it. Now i have a lot of folders called recup_dir.1, recup_dir.2 ... recup_dir.n and the files are named like f<numbers>. photorec can't restore the real folder structure so that i can navigate to the home dir and restore only the needed files?
No. Photorec is just salvaging on the scrap yard based on the remaining information on the drive. That is what it's for.
You are using it because other information is not available (anymore).

Richard
Posts: 3
Joined: 29 Mar 2019, 10:42

Re: Testdisk restores only 0 byte files from ext4

#5 Post by Richard »

But how can i find my files in the home dir?

My situation is not really a "scrap yard". i've deleted some files with rm and shutdown the pi directly after that. There is no damaged sd card or anything else.

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

Re: Testdisk restores only 0 byte files from ext4

#6 Post by recuperation »

Richard wrote: 30 Mar 2019, 13:12 But how can i find my files in the home dir?
By knowing by heart what has been in the home dir and opening up each found file and checking.
My situation is not really a "scrap yard". i've deleted some files with rm and shutdown the pi directly after that. There is no damaged sd card or anything else.
What has been the scope of your search? There is an option to restrict the search to unallocated space.

Locked