I know that in Unix (specifically, Mac OS X) the superblock stores information about the layout of data on the disk, including the disk addresses at which the inodes begin and end. I want to scan the list of inodes in my program to look for deleted files. How can I find the disk address at which the inodes begin? I have looked at the statfs command but it does not provide this information.
I know that in Unix (specifically, Mac OS X) the superblock stores information about
Share
Since you mention Mac OS X, let’s assume you mean to do this for HFS+ only. The Wikipedia page provides some information about possible ways to start, for instance it says this about the on-disk layout:
It becomes more complicated, after that. Read up on B* trees, for instance.
I’m no Mac OS user, but it would surprise me if there weren’t already tools written to scan for deleted files, perhaps some are open source and could provide a more concrete starting point?