| Russ Allbery > Software > lsmounts | lsmounts Changes > |
(List mountpoints found in a directory)
lsmounts [-hLlqrv] [directory ...]
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.
Print out this documentation (which is done simply by feeding the script
to perldoc -t).
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.
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.
Don't print out a status message every 1000 directories. Only print out the list of mount points found.
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.
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.
Print out the version of lsmounts and exit.
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, decending 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
fs(1), fs_lsmount(1), loadmtpt(1)
The current version of this program is available from its web page at <http://www.eyrie.org/~eagle/software/lsmounts/>.
Original Perl script written by Neil Crellin <neilc@stanford.edu>, as was the original recursive modification of that script. Extensively modified by Russ Allbery <rra@stanford.edu> 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 1998, 1999, 2003, 2004 Board of Trustees, Leland Stanford Jr. University.
This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.
| Russ Allbery > Software > lsmounts | lsmounts Changes > |