[OpenAFS] afs file id's

Chaskiel M Grundman cg2v@andrew.cmu.edu
Wed, 04 Sep 2002 17:35:58 -0400


--On Wednesday, September 04, 2002 13:21:11 -0700 "Matthew N. Andrews" 
<matt@slackers.net> wrote:

> Hello, is there a tool that will allow me to determine what the name of a
> file with a given FID
There are two ways of doing this that don't involve writing code.

One is to compute the virtual inode number corresponding to the 
volume/vnode pair, and then use find to locate the file. The inode number 
can be computed as follows. Shift the volume number 16 bits to the left 
(and discard the 16 high bits), and add that to the vnode number (in most 
cases this will be an 'or' operation). The inode number for your example, 
536892583.761, is 1420231417.


The other way to do this is with a volume dump and the afsdump_scan tool 
(it's included in the openafs source in the src/tests directory)

Get the smallest possible incremental dump (which will include all the 
directories, and very few, if any, files):
vos dump <volid> now <dump-filename>

then run afsdump_scan as follows:

afsdump_scan -Ppv <dump-filename> | grep -A1 <vnode>/<uniq>
(if you do not have gnu grep, you will have to search for the entry 
manually.)