On Tuesday 27 April 2004 09:43, Eric Dondelinger wrote:
Hi guys,
I'm currently preparing a course (for tomorrow, it's almost done).
In this course, I explain the classic UNIX filesystem (stuff like
inodes etc.).
Now, I'd like to show the students "live" what the directory entries
look like - they are files containing a table with the relation inode
number to filename.
IIRC it used to be that you could simply open such a file and look
at the raw contents (hexdump or whatever) - this though doesn't work
any more, if I try to open a directory directly with vi, cat, less,
hexdump, xxd, od, it doesn't work.
Does someone have an idea how I could get a close look at such a
directory entry? Maybe how to directly access an inode, without
going through the filename? [inode numbers can be had by using
ls -i, I'd have liked to directly look at the directory entry
itself].
I asked around the office, the usual suspects have as little ideas
as I do...
Greets & thanks in advance,
Eric
Dear Eric
have you tried testdisk? You may display raw sectors with it and also
directory entries with inode numbers. I just had a look for you, I didn't
find out though how to display the directory entries in raw format.
It's a rather uncomfortable program, I used it once to analyze a messy fat
partition table (Windows wouldn't boot because of wrong chs to lba
translation, really weard why it somehow still needs chs). Perhaps you find
out how it can be used for your goal.