lsmounts

(List mountpoints found in a directory)

SYNOPSIS

lsmounts [-hLlqrv] [directory ...]

DESCRIPTION

lsmounts finds all AFS mount points present in the list of directories given on the command line (or in the current directory if no directory is given) and prints out a report of all mount points and what volumes they're mount points for. It uses fs lsmount to check each directory present in the given directories to see if it's a mount point.

The default output is a human-readable report. If what is wanted instead is a simple list of volumes mounted under the given directories, use the -l option.

If lsmounts should recurse into all given directories, pass it the -r option. Be very careful with this, as with all recursive finds in AFS, as you could potentially traverse a very large directory structure. lsmounts will cross mount points. Every 1000 directories it inspects, it will print out a status message unless -q is given, and it will keep track of volumes it has already seen and will not recurse into them again and will not recurse into backup volumes.

OPTIONS

-h, --help

Print out this documentation (which is done simply by feeding the script to perldoc -t).

-L, --load

For each mount point that is found, loadmtpt will be invoked on that path to load it into the mount point database if it isn't already recorded. Mount points for volumes ending in .backup or .readonly will not be recorded.

-l, --list

Print out a simple list of volumes for which mount points were found, rather than a human-readable report of both volumes and mount points.

-q, --quiet

Don't print out a status message every 1000 directories. Only print out the list of mount points found.

-R, --recurse

Recurse into the given directories rather than just checking their top-level contents. This option will cross mount points; be careful. See above for full details.

-r, --safe-recurse

Recurse into the given directories rather than just checking their top-level contents, but do not recurse into any volumes that are found under the given directories.

-v, --version

Print out the version of lsmounts and exit.

CONFIGURATION

lsmounts loads configuration settings from /etc/afs-admin-tools/config if that file exists. If it exists, it must be Perl code suitable for loading with require. This means that each line of the configuration file should be of the form:

    our $VARIABLE = VALUE;

where $VARIABLE is the configuration variable being set and VALUE is the value to set it to (which should be enclosed in quotes if it's not a number). The file should end with:

    1;

so that Perl knows the file was loaded correctly.

The supported configuration variables are:

$FS

The full path to the AFS fs utility. If this variable is not set, lsmounts defaults to looking for fs on the user's PATH.

$LOADMTPT

The full path to the loadmtpt utility from the afs-mountpoints package. This is only used in conjunction with the -L option. If this variable is not set, lsmounts defaults to looking for loadmtpt on the user's PATH.

EXAMPLES

The following command displays a report of all volume mount points in the directory /afs/ir:

    lsmounts /afs/ir

The following command displays a simple list of all volumes found mounted under ~rra, descending through its directory structure recursively. If there are other volumes mounted under that directory, they will be searched through as well:

    lsmounts -lr ~rra

Recurse through /afs/ir/data, looking for mount points and loading any mount point that is found but without crossing mount points. lsmounts itself won't produce any output; all the output will be that of loadmtpt:

    lsmounts -qrL /afs/ir/data

Do the same thing, but do cross mount points (but do not recurse into backup volumes or volumes that have already been visited).

    lsmounts -qRL /afs/ir/data

AUTHORS

Original Perl script written by Neil Crellin <neilc@stanford.edu>, as was the original recursive modification of that script. Extensively modified by Russ Allbery <eagle@eyrie.org> to merge the two scripts, add the human-readable output, allow multiple command-line arguments for the non-recursive case, and add the ability to run loadmtpt on discovered volumes.

COPYRIGHT AND LICENSE

Copyright 1998, 1999, 2003, 2004, 2011 The Board of Trustees of the Leland Stanford Junior University.

This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

fs(1), fs_lsmount(1), loadmtpt(1)

This script is part of the afs-admin-tools package. The most recent version is available from the afs-admin-tools web page at <http://www.eyrie.org/~eagle/software/afs-admin-tools/>.

Last spun 2014-08-10 from POD modified 2014-04-14