Re: convert: LBA -> inode # -> filename



I am working in the block layer. I use EXT{2,3} file system for my
work.

I have a trace data by blktrace which is supported in Linux kernel
2.6.
In each line of the trace data, the block number (LBA: Logical Block
Address) and access time is stored.

I want to know what the file, which has the block number, is. How
can I get the file name by its block number?

The old UNIX utility 'icheck' does this, but with block numbers
that are relative to the specific filesystem. So you would have to
subtract the LBA of the first block of the filesystem from the
absolute LBA of the device. The 'ncheck' utility translates from
inode number to path. You could also search the text output of
"ls -liR". For ext2/ext3: get the source for e2fsck, then modify it.

Note that because of hardlinks [/bin/ln], there can be more than one
filename associated with a particular block. Softlinks [/bin/ln -s]
may also confuse you.

--


.



Relevant Pages

  • Re: LBA in diskperf;
    ... the byteoffset by the LBA size. ... Windows 2k/XP/2k3 Filesystem and Driver Consulting ... the byte offset in the partition. ...
    (microsoft.public.development.device.drivers)
  • Re: LBA in diskperf;
    ... the byteoffset by the LBA size. ... Windows 2k/XP/2k3 Filesystem and Driver Consulting ... the byte offset in the partition. ...
    (microsoft.public.development.device.drivers)
  • Re: File LBA Lookup
    ... to find the LBA of the first 512KB block of a file's ... All that stuff is hidden in the filesystem implementations. ... try and recover a broken HFS filesystem, which I could dig out if it ...
    (uk.comp.sys.mac)