[OpenAFS] Finding the 'mountpoint' of a volume

Tino Schwarze tino.schwarze@informatik.tu-chemnitz.de
Fri, 24 May 2002 14:04:59 +0200


On Fri, May 24, 2002 at 01:57:46PM +0200, Turbo Fredriksson wrote:

>     >> I'm writing a script that let me easily backup a volume, but I
>     >> need to know the exact mountpoint of the volume, so I can mount
>     >> the backup volume inside 'VOLUME/OldFiles'...
>     >> 
>     >> vos examine don't give me this information...
> 
>     Tino> I see two ways of achieving what you want: 1. always create
>     Tino> OldFiles (or name it BACKUP) in each volume and create the
>     Tino> backup volume on volume creation time
> 
> This is what I'm trying to do. But to be able to 'create OldFiles in
> each volume', I need to know WHERE the volume is!

No, you don't need to know where it is mounted. See below.

>     Tino> 2. just mount the
>     Tino> volume somewhere temporary, create the mountpoint to BACKUP
>     Tino> and unmount the volume again. (Yes, a volume can be mounted
>     Tino> multiple times, wherever you want.)
> 
> The 'point' of HAVING OldFiles (or BACKUP if you prefere) is that it's
> EASILY accessible. And where is easier than in the root of the volume!?

You misunderstood me. (Or I was not clear enough.) Given, you want to
backup $VOLUME. You create $VOLUME.backup by running "vos backup
$VOLUME" or similar. Now you want to create OldFiles within $VOLUME.
Well, just mount the volume somewhere:

fs mkmount /afs/your-cell/backupsystem/tmp/$VOLUME $VOLUME
if [ ! -e /afs/your-cell/backupsystem/tmp/$VOLUME/OldFiles ] ; then
    fs mkmount /afs/your-cell/backupsystem/tmp/$VOLUME/OldFiles $VOLUME.backup
fi
fs rmmount /afs/your-cell/backupsystem/tmp/$VOLUME

> With a little shell hacking, I came up with this, close enough (for the
> time beeing)...

Well. You'll get into trouble. Volume mount points can be circular.
(I could for example mount root.afs into my home directory.)

I repeat: A volume can be mounted everywhere, multiple times.

Hope that helps! Tino.

-- 
             * LINUX - Where do you want to be tomorrow? *
                  http://www.tu-chemnitz.de/linux/tag/