[OpenAFS] Mountpoint to volume map, volume to mountpoint map [was "2 problems for me newbie... "]

Dexter 'Kim' Kimball dhk@ccre.com
Fri, 17 Sep 2004 16:52:27 -0600


I haven't got anything that builds the map.  If anyone else does please
contribute if possible.  

If you

    cat <concatenated output of salvage -showmounts> | awk '{print
$6,$9,$NF}' | sed 's/[()]//g'

it will output a file with lines of the form


          A                                         B
C
Volume-containing-mountpoint  path-to-mountpoint-relative-to-root-node-of-A
name-of-volume-mounted-at-B

Example output:

testvolV /W testvolW
testvolV /a/b/c/d/e/f/Z testvolZ

which means "relative to the root node of testvolV I found a mountpoint ./W
to volume testvolW"
and         "relative to the root node of testvolV I found a mountpoint
./a/b/c/d/e/f/Z to volume testvolZ"


So if testvolV is mounted at

/afs/<cell>/testvolV

then you know that

/afs/<cell>/testvolV/W is a mount point to volume testvolW, or conversely
that testvolW is mounted at /afs/<cell>/testvolV/W

and that

/afs/<cell>/testvolV/a/b/c/d/e/f/Z is a mountpoint to volume testvolZ, or
conversely that testvolZ is mounted at /afs/<cell>/testvolV/a/b/c/d/e/f/Z

I haven't scripted the rest yet, hoping to find that someone else has done
it and can contribute same.  

It shouldn't be necessary to run any vos command to complete the
mountpoint|volume, volume|mountpoint map.

Hope this helps.

Kim



I figured I'd find the rest of the script somewhere
On 9/17/2004 12:36:27 PM, Dave Blakemore (daveblakemore@ca.ibm.com) wrote:
> Thanks Kim,
> 
> I kinda figured out my problem.
> 
> I am just installing some new afs servers and had added a new one to 
> the cell,  a couple of volumes had been created on the server for test 
> proposes running -showmounts produced no results because the only 
> volumes on the server had no mountpoints within them trying it now on 
> one of my production servers I get the appropriate output, but see it  
> reports on mount points within volumes...  I was hoping for a direct 
> "volume" to "mountpoint" reference rather than "parent volume" to 
> "mountpoint" reference.
> 
> What I am hoping to do, and trying to figure out the best way of doing 
> ...
> 
> is generating is a mountpoint to volume cross reference table such 
> that given a specific volume I can tell where it is mounted.
> 
> The problem was always getting a list of mountpoints.
> Right now I am looking at running salvager -showmounts on all the 
> servers,
> 
> cutting out the mountpoint, combining these outputs from each of the 
> servers, and then doing a vos e on each mountpoint.
> 
> Can you think of a better way?   Do you do anything similar?
> 
> --
> Dave Blakemore
> 
> 
>