Page 1 of 1

Testdisk restores only 0 byte files from ext4

Posted: 29 Mar 2019, 10:53
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

Re: Testdisk restores only 0 byte files from ext4

Posted: 29 Mar 2019, 18:27
by cgrenier
It's a limit (an optimization for fsck) of ext3/ext4. You have to use photorec to recover lost data from ext4.

Re: Testdisk restores only 0 byte files from ext4

Posted: 30 Mar 2019, 08:32
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?

Re: Testdisk restores only 0 byte files from ext4

Posted: 30 Mar 2019, 09:07
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).

Re: Testdisk restores only 0 byte files from ext4

Posted: 30 Mar 2019, 13:12
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.

Re: Testdisk restores only 0 byte files from ext4

Posted: 30 Mar 2019, 14:16
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.