Photorec recovery from reserved disk space on ext4 (SSD)?

Using PhotoRec to recover lost data
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
Post Reply
Message
Author
photorec1
Posts: 6
Joined: 15 Nov 2023, 19:30

Photorec recovery from reserved disk space on ext4 (SSD)?

#1 Post by photorec1 »

Does Photorec recover files from the (about 5%) reserved disk space on a ext4 file system which can be accessed only from the (root) system?

E.g. if you overwrite the free disk space with zeros on a SSD, will Photorec recover deleted files from the reserved space? I assume not.

Does anyone know if the reserved disk space in Linux/Debian is build at ext4 installation only and doesn't change if there is plenty of free space available, i.e. it will not contain recently deleted files/fractions of files, only ones from the time when the filesystem was created?

Thx

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

Re: Photorec recovery from reserved disk space on ext4 (SSD)?

#2 Post by recuperation »

photorec1 wrote: 15 Nov 2023, 19:52 Does Photorec recover files from the (about 5%) reserved disk space on a ext4 file system which can be accessed only from the (root) system?
You are reasoning on file system level. Photorec operates one level below, on sector level, though:

PhotoRec ignores the file system and goes after the underlying data, so it will still work even if your media's file system has been severely damaged or reformatted.

source:
https://www.cgsecurity.org/wiki/PhotoRec

photorec1
Posts: 6
Joined: 15 Nov 2023, 19:30

Re: Photorec recovery from reserved disk space on ext4 (SSD)?

#3 Post by photorec1 »

ok, so does this mean, on a linux system, photorec will recover files even from the reserved space and even if it is started by a user/non-root?

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

Re: Photorec recovery from reserved disk space on ext4 (SSD)?

#4 Post by recuperation »

With Photorec operating on sector level checking the whole disk it does not know and doesn't need to know what myspace, your space and whatever space there is.
For Photorec the disk is nothing more than a series of consecutive sectors.

Only in case when searching within the free space of a partition Photorec has to be able to understand the file system used to distinguish between free space and used space. It is the file system that keeps track of this information and Photorec needs to know how to decode this information.

I won't answer the other question about the necessary access rights.
If common sense does not tell you if linux users without admin rights should be able to read or write any disk sector they would like to just try running Photorec without those rights and see what this gives! ;)

photorec1
Posts: 6
Joined: 15 Nov 2023, 19:30

Re: Photorec recovery from reserved disk space on ext4 (SSD)?

#5 Post by photorec1 »

you are talking about (your space, my space, free and used space) on the file system level, which is irrelevant to photorec, which i know!

but i am talking about the reserved space by linux and the ssd controller that will be set aside for e.g. wear leveling purposes. this space is not available for formatting / disk partitioning and is set aside by the hardware (and sometimes accessible by the root user of linux)!

what about this space?

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

Re: Photorec recovery from reserved disk space on ext4 (SSD)?

#6 Post by recuperation »

photorec1 wrote: 17 Nov 2023, 18:45 you are talking about (your space, my space, free and used space) on the file system level, which is irrelevant to photorec, which i know!

but i am talking about the reserved space by linux and the ssd controller that will be set aside for e.g. wear leveling purposes. this space is not available for formatting / disk partitioning and is set aside by the hardware (and sometimes accessible by the root user of linux)!

what about this space?
You were asking about "reserved disk space on ext4" and did not mention the internals of an SSD.
"reserved disk space on ext4" is a well-defined term.
For a precise answer you need to ask a precise question. Otherwise the answer might not fit to what you were thinking about but not saying.

The internals of an SSD are beyond your and my control and Photorec, as any other standard data recovery software has no means of accessing it.

Post Reply