How to find the physical address of a specific HDD space?

New to Debian (Or Linux in general)? Ask your questions here!

How to find the physical address of a specific HDD space?

Postby hack3rcon » 2019-12-04 05:43

Hello,
I want to find the address of a free space in HDD. For example, I want to know that at which address "/home" started and finished.
The "filefrag" command can work for files.

Thank you.
hack3rcon
 
Posts: 339
Joined: 2015-02-16 09:54

Re: How to find the physical address of a specific HDD space

Postby p.H » 2019-12-04 21:48

filefrag works on directories too. Directories are just special files.
But what is the relationship between the blocks allocated to a directory, "specific space" (what specific space ?) and "free space" (what free space ?) ?
p.H
 
Posts: 1263
Joined: 2017-09-17 07:12

Re: How to find the physical address of a specific HDD space

Postby CwF » 2019-12-05 15:38

I've used a hex editor to directly view the disk, paid work using windows tools long ago... The files within /home will not be in a region recognizable as /home since they are not. As p.H. stated the directory is a special file and not analogous to a partition. The files can be anywhere within the partition mixed with files from other directories within the same partition. Recovery relies on the file headers and a little magic to recognize the last sector, the next header -1. I would copy and paste from the disk editor to a file with the proper extension and attempt to open it, success or failure then obvious. Certain file types can have extra cruft or be clipped and still open, some need the exact real length.

I can list what I use if needed. I still have the functionality in an XP vm. I still occasionally need it for a data logger that barfs every so often by incorrectly closing the log file. The telltale is a 2k file that should be MB's. So I pull out all the data between headers to a file, open the file, and it is a tolerant format that I can trim back to clean and resave.

Foremost may be useful, it can decipher the headers of common file types and automate the process. Or some hex editor and do it manually. In a disk/hex editor you will see the structure and the addresses.
CwF
 
Posts: 571
Joined: 2018-06-20 15:16


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable