147501Spendry\input texinfo @c -*-texinfo-*- 247501Spendry@c 347501Spendry@c Copyright (c) 1989 Jan-Simon Pendry 447501Spendry@c Copyright (c) 1989 Imperial College of Science, Technology & Medicine 547501Spendry@c Copyright (c) 1989 The Regents of the University of California. 647501Spendry@c All rights reserved. 747501Spendry@c 847501Spendry@c This code is derived from software contributed to Berkeley by 947501Spendry@c Jan-Simon Pendry at Imperial College, London. 1047501Spendry@c 11*49684Spendry@c Redistribution and use in source and binary forms, with or without 12*49684Spendry@c modification, are permitted provided that the following conditions 13*49684Spendry@c are met: 14*49684Spendry@c 1. Redistributions of source code must retain the above copyright 15*49684Spendry@c notice, this list of conditions and the following disclaimer. 16*49684Spendry@c 2. Redistributions in binary form must reproduce the above copyright 17*49684Spendry@c notice, this list of conditions and the following disclaimer in the 18*49684Spendry@c documentation and/or other materials provided with the distribution. 19*49684Spendry@c 3. All advertising materials mentioning features or use of this software 20*49684Spendry@c must display the following acknowledgement: 21*49684Spendry@c This product includes software developed by the University of 22*49684Spendry@c California, Berkeley and its contributors. 23*49684Spendry@c 4. Neither the name of the University nor the names of its contributors 24*49684Spendry@c may be used to endorse or promote products derived from this software 25*49684Spendry@c without specific prior written permission. 2647501Spendry@c 27*49684Spendry@c THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 28*49684Spendry@c ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 29*49684Spendry@c IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 30*49684Spendry@c ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 31*49684Spendry@c FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 32*49684Spendry@c DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 33*49684Spendry@c OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 34*49684Spendry@c HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 35*49684Spendry@c LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36*49684Spendry@c OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3747501Spendry@c 38*49684Spendry@c @(#)amdref.texinfo 1.3 (Berkeley) 05/12/91 39*49684Spendry@c 40*49684Spendry@c $Id: amdref.texinfo,v 5.2.1.6 91/05/07 22:20:47 jsp Alpha $ 41*49684Spendry@c 4247501Spendry@setfilename /usr/local/emacs/info/amd 4347501Spendry@tex 4447501Spendry\overfullrule=0pt 4547501Spendry@end tex 4647501Spendry 4747501Spendry@settitle 4.4 BSD Automounter Reference Manual 4847501Spendry@titlepage 4947501Spendry@sp 6 5047501Spendry@center @titlefont{Amd} 5147501Spendry@sp 2 5247501Spendry@center @titlefont{The 4.4 BSD Automounter} 5347501Spendry@sp 2 5447501Spendry@center @titlefont{Reference Manual} 5547501Spendry@sp 2 5647501Spendry@center @authorfont{Jan-Simon Pendry} 5747501Spendry@sp 5847501Spendry@center @i{and} 5947501Spendry@sp 6047501Spendry@center @authorfont{Nick Williams} 6147501Spendry@sp 4 6247501Spendry@center Last updated March 1991 6347501Spendry@center Documentation for software revision 5.3 Alpha 6447501Spendry@page 6547501SpendryCopyright @copyright{} 1989 Jan-Simon Pendry 6647501Spendry@sp -1 6747501SpendryCopyright @copyright{} 1989 Imperial College of Science, Technology & Medicine 6847501Spendry@sp -1 6947501SpendryCopyright @copyright{} 1989 The Regents of the University of California. 7047501Spendry@sp 0 7147501SpendryAll Rights Reserved. 7247501Spendry@vskip 1ex 7347501SpendryPermission to copy this document, or any portion of it, as 7447501Spendrynecessary for use of this software is granted provided this 7547501Spendrycopyright notice and statement of permission are included. 7647501Spendry@end titlepage 7747501Spendry@page 7847501Spendry@ifinfo 7947501Spendry@node Top, License, , (DIR) 8047501Spendry 8147501SpendryAmd - The 4.4 BSD Automounter 8247501Spendry***************************** 8347501Spendry 8447501SpendryAmd is the 4.4 BSD Automounter. This Info file describes how 8547501Spendryto use and understand Amd. 8647501Spendry@end ifinfo 8747501Spendry 8847501Spendry@menu 8947501Spendry* License:: Explains the terms and conditions for using 9047501Spendry and distributing Amd. 9147501Spendry* Distrib:: How to get the latest Amd distribution. 9247501Spendry* Overview:: An introduction to Automounting concepts. 9347501Spendry* Supported Platforms:: Machines and Systems supported by Amd. 9447501Spendry* Mount Maps:: Details of mount maps 9547501Spendry* Amd Command Line Options:: All the Amd command line options explained. 9647501Spendry* Filesystem Types:: The different mount types supported by Amd. 9747501Spendry* Run-time Administration:: How to start, stop and control Amd. 9847501Spendry* FSinfo:: The FSinfo filesystem management tool. 9947501Spendry* Examples:: Some examples showing how Amd might be used. 10047501Spendry 10147501SpendryIndexes 10247501Spendry* Index:: An item for each concept. 10347501Spendry@end menu 10447501Spendry 10547501Spendry@iftex 10647501Spendry@unnumbered Preface 10747501Spendry 10847501SpendryThis manual documents the use of the 4.4 BSD automounter---@i{Amd}. 10947501SpendryThis is primarily a reference manual. Unfortunately, no tutorial 11047501Spendryexists. 11147501Spendry 11247501SpendryThis manual comes in two forms: the published form and the Info form. 11347501SpendryThe Info form is for on-line perusal with the INFO program which is 11447501Spendrydistributed along with GNU Emacs. Both forms contain substantially the 11547501Spendrysame text and are generated from a common source file, which is 11647501Spendrydistributed with the @i{Amd} source. 11747501Spendry@end iftex 11847501Spendry 11947501Spendry@node License, Distrib, Top, Top 12047501Spendry@unnumbered License 12147501Spendry@cindex License Information 12247501Spendry 12347501Spendry@i{Amd} is not in the public domain; it is copyrighted and there are 12447501Spendryrestrictions on its distribution. 12547501Spendry 12647501SpendryRedistribution and use in source and binary forms are permitted provided 12747501Spendrythat: (1) source distributions retain this entire copyright notice and 12847501Spendrycomment, and (2) distributions including binaries display the following 12947501Spendryacknowledgement: ``This product includes software developed by The 13047501SpendryUniversity of California, Berkeley and its Contributors'' in the 13147501Spendrydocumentation or other materials provided with the distribution and in 13247501Spendryall advertising materials mentioning features or use of this software. 13347501Spendryneither the name of the University nor the names of its Contributors may 13447501Spendrybe used to endorse or promote products derived from this software 13547501Spendrywithout specific prior written permission. 13647501Spendry 13747501SpendryTHIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED 13847501SpendryWARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 13947501SpendryMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 14047501Spendry 14147501Spendry@node Distrib, Overview, License, Top 14247501Spendry@unnumbered Source Distribution 14347501Spendry@cindex Source code distribution 14447501Spendry@cindex Obtaining the source code 14547501Spendry 14647501SpendryIf you have access to the Internet, you can get the latest distribution 14747501Spendryversion of @i{Amd} from host @file{usc.edu} using anonymous FTP. Move to 14847501Spendrythe directory @file{/pub/amd} on that host and fetch the file @file{amd.tar.Z}. 14947501Spendry 15047501SpendryIf you are in the UK, you can get the latest distribution version of 15147501Spendry@i{Amd} from the UKnet info-server. Start by sending email to 15247501Spendry@file{info-server@@doc.ic.ac.uk}. 15347501Spendry 15447501SpendrySites on the UK JANET network can get the latest distribution by using 15547501Spendryanonymous NIFTP to fetch the file @samp{<AMD>amd.tar.Z} from host 15647501Spendry@samp{uk.ac.imperial.doc.src}. 15747501Spendry 15847501SpendryRevision 5.2 was part of the 4.3 BSD Reno distribution. 15947501Spendry 16047501Spendry@unnumberedsec Bug Reports 16147501Spendry@cindex Bug reports 16247501Spendry 16347501SpendrySend all bug reports to @file{jsp@@doc.ic.ac.uk} quoting the details of 16447501Spendrythe release and your configuration. These can be obtained by running 16547501Spendrythe command @samp{amd -v}. 16647501Spendry 16747501Spendry@unnumberedsec Mailing List 16847501Spendry@cindex Mailing list 16947501Spendry 17047501SpendryThere is a mailing list for people interested in keeping uptodate with 17147501Spendrydevelopments. To subscribe, send a note to @file{amd-workers-request@@acl.lanl.gov}. 17247501Spendry 17347501Spendry@node Intro, Index, Distrib, Top 17447501Spendry@unnumbered Introduction 17547501Spendry@cindex Introduction 17647501Spendry 17747501SpendryAn @dfn{automounter} maintains a cache of mounted filesystems. 17847501SpendryFilesystems are mounted on demand when they are first referenced, 17947501Spendryand unmounted after a period of inactivity. 18047501Spendry 18147501Spendry@i{Amd} may be used as a replacement for Sun's automounter. The choice 18247501Spendryof which filesystem to mount can be controlled dynamically with 18347501Spendry@dfn{selectors}. Selectors allow decisions of the form ``hostname is 18447501Spendry@var{this},'' or ``architecture is not @var{that}.'' Selectors may be 18547501Spendrycombined arbitrarily. @i{Amd} also supports a variety of filesystem 18647501Spendrytypes, including NFS, UFS and the novel @dfn{program} filesystem. The 18747501Spendrycombination of selectors and multiple filesystem types allows identical 18847501Spendryconfiguration files to be used on all machines so reducing the 18947501Spendryadministrative overhead. 19047501Spendry 19147501Spendry@i{Amd} ensures that it will not hang if a remote server goes down. 19247501SpendryMoreover, @i{Amd} can determine when a remote server has become 19347501Spendryinaccessible and then mount replacement filesystems as and when they 19447501Spendrybecome available. 19547501Spendry 19647501Spendry@i{Amd} contains no proprietary source code and has been ported to 19747501Spendrynumerous flavours of Unix. 19847501Spendry 19947501Spendry@node Overview, Supported Platforms, Distrib, Top 20047501Spendry@chapter Overview 20147501Spendry 20247501Spendry@i{Amd} maintains a cache of mounted filesystems. Filesystems are 20347501Spendry@dfn{demand-mounted} when they are first referenced, and unmounted after 20447501Spendrya period of inactivity. @i{Amd} may be used as a replacement for Sun's 20547501Spendry@b{automount}(8) program. It contains no proprietary source code and 20647501Spendryhas been ported to numerous flavours of Unix. @xref{Supported Operating 20747501SpendrySystems}.@refill 20847501Spendry 20947501Spendry@i{Amd} was designed as the basis for experimenting with filesystem 21047501Spendrylayout and management. Although @i{Amd} has many direct applications it 21147501Spendryis loaded with additional features which have little practical use. At 21247501Spendrysome point the infrequently used components may be removed to streamline 21347501Spendrythe production system. 21447501Spendry 21547501Spendry@c @i{Amd} supports the notion of @dfn{replicated} filesystems by evaluating 21647501Spendry@c each member of a list of possible filesystem locations in parallel. 21747501Spendry@c @i{Amd} checks that each cached mapping remains valid. Should a mapping be 21847501Spendry@c lost -- such as happens when a fileserver goes down -- @i{Amd} automatically 21947501Spendry@c selects a replacement should one be available. 22047501Spendry@c 22147501Spendry@menu 22247501Spendry* Fundamentals:: 22347501Spendry* Filesystems and Volumes:: 22447501Spendry* Volume Naming:: 22547501Spendry* Volume Binding:: 22647501Spendry* Operational Principles:: 22747501Spendry* Mounting a Volume:: 22847501Spendry* Automatic Unmounting:: 22947501Spendry* Keep-alives:: 23047501Spendry* Non-blocking Operation:: 23147501Spendry@end menu 23247501Spendry 23347501Spendry@node Fundamentals, Filesystems and Volumes, Overview, Overview 23447501Spendry@comment node-name, next, previous, up 23547501Spendry@section Fundamentals 23647501Spendry@cindex Automounter fundamentals 23747501Spendry 23847501SpendryThe fundamental concept behind @i{Amd} is the ability to separate the 23947501Spendryname used to refer to a file from the name used to refer to its physical 24047501Spendrystorage location. This allows the same files to be accessed with the 24147501Spendrysame name regardless of where in the network the name is used. This is 24247501Spendryvery different from placing @file{/n/hostname} in front of the pathname 24347501Spendrysince that includes location dependent information which may change if 24447501Spendryfiles are moved to another machine. 24547501Spendry 24647501SpendryBy placing the required mappings in a centrally administered database, 24747501Spendryfilesystems can be re-organised without requiring changes to 24847501Spendryconfiguration files, shell scripts and so on. 24947501Spendry 25047501Spendry@node Filesystems and Volumes, Volume Naming, Fundamentals, Overview 25147501Spendry@comment node-name, next, previous, up 25247501Spendry@section Filesystems and Volumes 25347501Spendry@cindex Filesystem 25447501Spendry@cindex Volume 25547501Spendry@cindex Fileserver 25647501Spendry@cindex sublink 25747501Spendry 25847501Spendry@i{Amd} views the world as a set of fileservers, each containg one or 25947501Spendrymore filesystems where each filesystem contains one or more 26047501Spendry@dfn{volumes}. Here the term @dfn{volume} is used to refer to a 26147501Spendrycoherent set of files such as a user's home directory or a @TeX{} 26247501Spendrydistribution.@refill 26347501Spendry 26447501SpendryIn order to access the contents of a volume, @i{Amd} must be told in 26547501Spendrywhich filesystem the volume resides and which host owns the filesystem. 26647501SpendryBy default the host is assumed to be local and the volume is assumed to 26747501Spendrybe the entire filesystem. If a filesystem contains more than one 26847501Spendryvolume, then a @dfn{sublink} is used to refer to the sub-directory 26947501Spendrywithin the filesystem where the volume can be found. 27047501Spendry 27147501Spendry@node Volume Naming, Volume Binding, Filesystems and Volumes, Overview 27247501Spendry@comment node-name, next, previous, up 27347501Spendry@section Volume Naming 27447501Spendry@cindex Volume names 27547501Spendry@cindex Network-wide naming 27647501Spendry@cindex Replicated volumes 27747501Spendry@cindex Duplicated volumes 27847501Spendry@cindex Replacement volumes 27947501Spendry 28047501SpendryVolume names are defined to be unique across the entire network. A 28147501Spendryvolume name is the pathname to the volume's root as known by the users 28247501Spendryof that volume. Since this name uniquely identifies the volume 28347501Spendrycontents, all volumes can be named and accessed from each host, subject 28447501Spendryto administrative controls. 28547501Spendry 28647501SpendryVolumes may be replicated or duplicated. Replicated volumes contain 28747501Spendryidentical copies of the same data and reside at two or more locations in 28847501Spendrythe network. Each of the replicated volumes can be used 28947501Spendryinterchangeably. Duplicated volumes each have the same name but contain 29047501Spendrydifferent, though functionally identical, data. For example, 29147501Spendry@samp{/vol/tex} might be the name of a @TeX{} distribution which varied 29247501Spendryfor each machine architecture.@refill 29347501Spendry 29447501Spendry@i{Amd} provides facilities to take advantage of both replicated and 29547501Spendryduplicated volumes. Configuration options allow a single set of 29647501Spendryconfiguration data to be shared across an entire network by taking 29747501Spendryadvantage of replicated and duplicated volumes. 29847501Spendry 29947501Spendry@i{Amd} can take advantage of replacement volumes by mounting them as 30047501Spendryrequired should an active fileserver become unavailable. 30147501Spendry 30247501Spendry@node Volume Binding, Operational Principles, Volume Naming, Overview 30347501Spendry@comment node-name, next, previous, up 30447501Spendry@section Volume Binding 30547501Spendry@cindex Volume binding 30647501Spendry@cindex Unix namespace 30747501Spendry@cindex Namespace 30847501Spendry@cindex Binding names to filesystems 30947501Spendry 31047501SpendryUnix implements a namespace of hierarchically mounted filesystems. Two 31147501Spendryforms of binding between names and files are provided. A @dfn{hard 31247501Spendrylink} completes the binding when the name is added to the filesystem. A 31347501Spendry@dfn{soft link} delays the binding until the name is accessed. An 31447501Spendry@dfn{automounter} adds a further form in which the binding of name to 31547501Spendryfilesystem is delayed until the name is accessed.@refill 31647501Spendry 31747501SpendryThe target volume, in its general form, is a tuple (host, filesystem, 31847501Spendrysublink) which can be used to name the physical location of any volume 31947501Spendryin the network. 32047501Spendry 32147501SpendryWhen a target is referenced, @i{Amd} ignores the sublink element and 32247501Spendrydetermines whether the required filesystem is already mounted. This is 32347501Spendrydone by computing the local mount point for the filesystem and checking 32447501Spendryfor an existing filesystem mounted at the same place. If such a 32547501Spendryfilesystem already exists then it is assumed to be functionally 32647501Spendryidentical to the target filesystem. By default there is a one-to-one 32747501Spendrymapping between the pair (host, filesystem) and the local mount point so 32847501Spendrythis assumption is valid. 32947501Spendry 33047501Spendry@node Operational Principles, Mounting a Volume, Volume Binding, Overview 33147501Spendry@comment node-name, next, previous, up 33247501Spendry@section Operational Principles 33347501Spendry@cindex Operational principles 33447501Spendry 33547501Spendry@i{Amd} operates by introducing new mount points into the namespace. 33647501SpendryThese are called @dfn{automount} points. The kernel sees these 33747501Spendryautomount points as NFS filesystems being served by @i{Amd}. Having 33847501Spendryattached itself to the namespace, @i{Amd} is now able to control the 33947501Spendryview the rest of the system has of those mount points. RPC calls are 34047501Spendryreceived from the kernel one at a time. 34147501Spendry 34247501SpendryWhen a @dfn{lookup} call is received @i{Amd} checks whether the name is 34347501Spendryalready known. If it is not, the required volume is mounted. A 34447501Spendrysymbolic link pointing to the volume root is then returned. Once the 34547501Spendrysymbolic link is returned, the kernel will send all other requests 34647501Spendrydirect to the mounted filesystem. 34747501Spendry 34847501SpendryIf a volume is not yet mounted, @i{Amd} consults a configuration 34947501Spendry@dfn{mount-map} corresponding to the automount point. @i{Amd} then 35047501Spendrymakes a runtime decision on what and where to mount a filesystem based 35147501Spendryon the information obtained from the map. 35247501Spendry 35347501Spendry@i{Amd} does not implement all the NFS requests; only those relevant 35447501Spendryto name binding such as @dfn{lookup}, @dfn{readlink} and @dfn{readdir}. 35547501SpendrySome other calls are also implemented but most simply return an error 35647501Spendrycode; for example @dfn{mkdir} always returns ``read-only filesystem''. 35747501Spendry 35847501Spendry@node Mounting a Volume, Automatic Unmounting, Operational Principles, Overview 35947501Spendry@comment node-name, next, previous, up 36047501Spendry@section Mounting a Volume 36147501Spendry@cindex Mounting a volume 36247501Spendry@cindex Location lists 36347501Spendry@cindex Alternate locations 36447501Spendry@cindex Mount retries 36547501Spendry@cindex Background mounts 36647501Spendry 36747501SpendryEach automount point has a corresponding mount map. The mount map 36847501Spendrycontains a list of key--value pairs. The key is the name of the volume 36947501Spendryto be mounted. The value is a list of locations describing where the 37047501Spendryfilesystem is stored in the network. In the source for the map the 37147501Spendryvalue would look like 37247501Spendry 37347501Spendry@display 37447501Spendrylocation1 location2 @dots{} locationN 37547501Spendry@end display 37647501Spendry 37747501Spendry@i{Amd} examines each location in turn. Each location may contain 37847501Spendry@dfn{selectors} which control whether @i{Amd} can use that location. 37947501SpendryFor example, the location may be restricted to use by certain hosts. 38047501SpendryThose locations which cannot be used are ignored. 38147501Spendry 38247501Spendry@i{Amd} attempts to mount the filesystem described by each remaining 38347501Spendrylocation until a mount succeeds or @i{Amd} can no longer proceed. The 38447501Spendrylatter can occur in three ways: 38547501Spendry 38647501Spendry@itemize @bullet 38747501Spendry@item 38847501SpendryIf none of the locations could be used, or if all of the locations 38947501Spendrycaused an error, then the last error is returned. 39047501Spendry 39147501Spendry@item 39247501SpendryIf a location could be used but was being mounted in the background then 39347501Spendry@i{Amd} marks that mount as being ``in progress'' and continues with 39447501Spendrythe next request; no reply is sent to the kernel. 39547501Spendry 39647501Spendry@item 39747501SpendryLastly, one or more of the mounts may have been @dfn{deferred}. A mount 39847501Spendryis deferred if extra information is required before the mount can 39947501Spendryproceed. When the information becomes available the mount will take 40047501Spendryplace, but in the mean time no reply is sent to the kernel. If the 40147501Spendrymount is deferred, @i{Amd} continues to try any remaining locations. 40247501Spendry@end itemize 40347501Spendry 40447501SpendryOnce a volume has been mounted, @i{Amd} establishes a @dfn{volume 40547501Spendrymapping} which is used to satisfy subsequent requests.@refill 40647501Spendry 40747501Spendry@node Automatic Unmounting, Keep-alives, Mounting a Volume, Overview 40847501Spendry@comment node-name, next, previous, up 40947501Spendry@section Automatic Unmounting 41047501Spendry 41147501SpendryTo avoid an ever increasing number of filesystem mounts, @i{Amd} removes 41247501Spendryvolume mappings which have not been used recently. A time-to-live 41347501Spendryinterval is associated with each mapping and when that expires the 41447501Spendrymapping is removed. When the last reference to a filesystem is removed, 41547501Spendrythat filesystem is unmounted. If the unmount fails, for example the 41647501Spendryfilesystem is still busy, the mapping is re-instated and its 41747501Spendrytime-to-live interval is extended. The global default for this grace 41847501Spendryperiod is controlled by the ``-w'' command-line option (@pxref{-w 41947501SpendryOption, -w}). It is also possible to set this value on a per-mount 42047501Spendrybasis (@pxref{opts Option, opts, opts}).@refill 42147501Spendry 42247501SpendryFilesystems can be forcefully timed out using the @i{Amq} command. 42347501Spendry@xref{Run-time Administration}. 42447501Spendry 42547501Spendry@node Keep-alives, Non-blocking Operation, Automatic Unmounting, Overview 42647501Spendry@comment node-name, next, previous, up 42747501Spendry@section Keep-alives 42847501Spendry@cindex Keep-alives 42947501Spendry@cindex Server crashes 43047501Spendry@cindex NFS ping 43147501Spendry 43247501SpendryUse of some filesystem types requires the presence of a server on 43347501Spendryanother machine. If a machine crashes then it is of no concern to 43447501Spendryprocesses on that machine that the filesystem is unavailable. However, 43547501Spendryto processes on a remote host using that machine as a fileserver this 43647501Spendryevent is important. This situation is most widely recognised when an 43747501SpendryNFS server crashes and the behaviour observed on client machines is that 43847501Spendrymore and more processes hang. In order to provide the possibility of 43947501Spendryrecovery, @i{Amd} implements a @dfn{keep-alive} interval timer for some 44047501Spendryfilesystem types. Currently only NFS makes use of this service. 44147501Spendry 44247501SpendryThe basis of the NFS keep-alive implementation is the observation that 44347501Spendrymost sites maintain replicated copies of common system data such as 44447501Spendrymanual pages, most or all programs, system source code and so on. If 44547501Spendryone of those servers goes down it would be reasonable to mount one of 44647501Spendrythe others as a replacement. 44747501Spendry 44847501SpendryThe first part of the process is to keep track of which fileservers are 44947501Spendryup and which are down. @i{Amd} does this by sending RPC requests to the 45047501Spendryservers' NFS @code{NullProc} and checking whether a reply is returned. 45147501SpendryWhile the server state is uncertain the requests are re-transmitted at 45247501Spendrythree second intervals and if no reply is received after four attempts 45347501Spendrythe server is marked down. If a reply is received the fileserver is 45447501Spendrymarked up and stays in that state for 30 seconds at which time another 45547501SpendryNFS ping is sent. 45647501Spendry 45747501SpendryOnce a fileserver is marked down, requests continue to be sent every 30 45847501Spendryseconds in order to determine when the fileserver comes back up. During 45947501Spendrythis time any reference through @i{Amd} to the filesystems on that 46047501Spendryserver fail with the error ``Operation would block''. If a replacement 46147501Spendryvolume is available then it will be mounted, otherwise the error is 46247501Spendryreturned to the user. 46347501Spendry 46447501Spendry@c @i{Amd} keeps track of which servers are up and which are down. 46547501Spendry@c It does this by sending RPC requests to the servers' NFS {\sc NullProc} and 46647501Spendry@c checking whether a reply is returned. If no replies are received after a 46747501Spendry@c short period, @i{Amd} marks the fileserver @dfn{down}. 46847501Spendry@c RPC requests continue to be sent so that it will notice when a fileserver 46947501Spendry@c comes back up. 47047501Spendry@c ICMP echo packets \cite{rfc:icmp} are not used because it is the availability 47147501Spendry@c of the NFS service that is important, not the existence of a base kernel. 47247501Spendry@c Whenever a reference to a fileserver which is down is made via @i{Amd}, an alternate 47347501Spendry@c filesystem is mounted if one is available. 47447501Spendry@c 47547501SpendryAlthough this action does not protect user files, which are unique on 47647501Spendrythe network, or processes which do not access files via @i{Amd} or 47747501Spendryalready have open files on the hung filesystem, it can prevent most new 47847501Spendryprocesses from hanging. 47947501Spendry 48047501SpendryBy default, fileserver state is not maintained for NFS/TCP mounts. The 48147501Spendryremote fileserver is always assumed to be up. 48247501Spendry@c 48347501Spendry@c With a suitable combination of filesystem management and mount-maps, 48447501Spendry@c machines can be protected against most server downtime. This can be 48547501Spendry@c enhanced by allocating boot-servers dynamically which allows a diskless 48647501Spendry@c workstation to be quickly restarted if necessary. Once the root filesystem 48747501Spendry@c is mounted, @i{Amd} can be started and allowed to mount the remainder of 48847501Spendry@c the filesystem from whichever fileservers are available. 48947501Spendry 49047501Spendry@node Non-blocking Operation, , Keep-alives, Overview 49147501Spendry@comment node-name, next, previous, up 49247501Spendry@section Non-blocking Operation 49347501Spendry@cindex Non-blocking operation 49447501Spendry@cindex Multiple-threaded server 49547501Spendry@cindex RPC retries 49647501Spendry 49747501SpendrySince there is only one instance of @i{Amd} for each automount point, 49847501Spendryand usually only one instance on each machine, it is important that it 49947501Spendryis always available to service kernel calls. @i{Amd} goes to great 50047501Spendrylengths to ensure that it does not block in a system call. As a last 50147501Spendryresort @i{Amd} will fork before it attempts a system call that may block 50247501Spendryindefinitely, such as mounting an NFS filesystem. Other tasks such as 50347501Spendryobtaining filehandle information for an NFS filesystem, are done using a 50447501Spendrypurpose built non-blocking RPC library which is integrated with 50547501Spendry@i{Amd}'s task scheduler. This library is also used to implement NFS 50647501Spendrykeep-alives (@pxref{Keep-alives}). 50747501Spendry 50847501SpendryWhenever a mount is deferred or backgrounded, @i{Amd} must wait for it 50947501Spendryto complete before replying to the kernel. However, this would cause 51047501Spendry@i{Amd} to block waiting for a reply to be constructed. Rather than do 51147501Spendrythis, @i{Amd} simply @dfn{drops} the call under the assumption that the 51247501Spendrykernel RPC mechanism will automatically retry the request. 51347501Spendry 51447501Spendry@node Supported Platforms, Mount Maps, Overview, Top 51547501Spendry@comment node-name, next, previous, up 51647501Spendry@chapter Supported Platforms 51747501Spendry 51847501Spendry@i{Amd} has been ported to a wide variety of machines and operating systems. 51947501SpendryThe table below lists those platforms supported by the current release. 52047501Spendry 52147501Spendry@menu 52247501Spendry* Supported Operating Systems:: 52347501Spendry* Supported Machine Architectures:: 52447501Spendry@end menu 52547501Spendry 52647501Spendry@node Supported Operating Systems, Supported Machine Architectures, Supported Platforms, Supported Platforms 52747501Spendry@comment node-name, next, previous, up 52847501Spendry@section Supported Operating Systems 52947501Spendry@cindex Operating system names 53047501Spendry@cindex Operating systems supported by Amd 53147501Spendry@cindex Supported operating systems 53247501Spendry 53347501SpendryThe following operating systems are currently supported by @i{Amd}. 53447501Spendry@i{Amd}'s conventional name for each system is given. 53547501Spendry 53647501Spendry@table @code 53747501Spendry@item acis43 53847501Spendry4.3 BSD for IBM RT. Contributed by Jan-Simon Pendry @t{<jsp@@doc.ic.ac.uk>} 53947501Spendry@item aix3 54047501SpendryAIX 3.1. Contributed by Jan-Simon Pendry @t{<jsp@@doc.ic.ac.uk>} 54147501Spendry@item aux 54247501SpendrySystem V for Mac-II. Contributed by Julian Onions @t{<jpo@@cs.nott.ac.uk>} 54347501Spendry@item bsd44 54447501Spendry4.4 BSD. Contributed by Jan-Simon Pendry @t{<jsp@@doc.ic.ac.uk>} 54547501Spendry@item concentrix 54647501SpendryConcentrix 5.0. Contributed by Sjoerd Mullender @t{<sjoerd@@cwi.nl>} 54747501Spendry@item convex 54847501SpendryConvex OS 7.1. Contributed by Eitan Mizrotsky @t{<eitan@@shumuji.ac.il>} 54947501Spendry@item dgux 55047501SpendryData General DG/UX. Contributed by Mark Davies @t{<mark@@comp.vuw.ac.nz>} 55147501Spendry@item fpx4 55247501SpendryCelerity FPX 4.1/2. Contributed by Stephen Pope @t{<scp@@grizzly.acl.lanl.gov>} 55347501Spendry@item hcx 55447501SpendryHarris HCX/UX. Contributed by Chris Metcalf @t{<metcalf@@masala.lcs.mit.edu>} 55547501Spendry@item hlh42 55647501SpendryHLH OTS 1.@i{x} (4.2 BSD). Contributed by Jan-Simon Pendry @t{<jsp@@doc.ic.ac.uk>} 55747501Spendry@item hpux 55847501SpendryHP-UX 6.@i{x} or 7.0. Contributed by Jan-Simon Pendry @t{<jsp@@doc.ic.ac.uk>} 55947501Spendry@item irix 56047501SpendrySGI Irix. Contributed by Scott R. Presnell @t{<srp@@cgl.ucsf.edu>} 56147501Spendry@item next 56247501SpendryMach for NeXT. Contributed by Bill Trost @t{<trost%reed@@cse.ogi.edu>} 56347501Spendry@item pyrOSx 56447501SpendryPyramid OSx. Contributed by Stefan Petri @t{<petri@@tubsibr.UUCP>} 56547501Spendry@item riscix 56647501SpendryAcorn RISC iX. Contributed by Piete Brooks @t{<pb@@cam.cl.ac.uk>} 56747501Spendry@item sos3 56847501SpendrySunOS 3.4 & 3.5. Contributed by Jan-Simon Pendry @t{<jsp@@doc.ic.ac.uk>} 56947501Spendry@item sos4 57047501SpendrySunOS 4.@i{x}. Contributed by Jan-Simon Pendry @t{<jsp@@doc.ic.ac.uk>} 57147501Spendry@item u2_2 57247501SpendryUltrix 2.2. Contributed by Piete Brooks @t{<pb@@cam.cl.ac.uk>} 57347501Spendry@item u3_0 57447501SpendryUltrix 3. Contributed by Piete Brooks @t{<pb@@cam.cl.ac.uk>} 57547501Spendry@item u4_0 57647501SpendryUltrix 4.0. Contributed by Chris Lindblad @t{<cjl@@ai.mit.edu>} 57747501Spendry@item umax43 57847501SpendryUmax 4.3 BSD. Contributed by Sjoerd Mullender @t{<sjoerd@@cwi.nl>} 57947501Spendry@item utek 58047501SpendryUtek 4.0. Contributed by Bill Trost @t{<trost%reed@@cse.ogi.edu>} 58147501Spendry@item xinu43 58247501Spendrymt Xinu MORE/bsd. Contributed by Jan-Simon Pendry @t{<jsp@@doc.ic.ac.uk>} 58347501Spendry@end table 58447501Spendry 58547501Spendry@node Supported Machine Architectures, , Supported Operating Systems, Supported Platforms 58647501Spendry@comment node-name, next, previous, up 58747501Spendry@section Supported Machine Architectures 58847501Spendry@cindex Supported machine architectures 58947501Spendry@cindex Machine architecture names 59047501Spendry@cindex Machine architectures supported by Amd 59147501Spendry 59247501Spendry@table @code 59347501Spendry@item alliant 59447501SpendryAlliant FX/4 59547501Spendry@item arm 59647501SpendryAcorn ARM 59747501Spendry@item aviion 59847501SpendryData General AViiON 59947501Spendry@item encore 60047501SpendryEncore 60147501Spendry@item fps500 60247501SpendryFPS Model 500 60347501Spendry@item hp9000 60447501SpendryHP 9000/300 family 60547501Spendry@item hp9k8 60647501SpendryHP 9000/800 family 60747501Spendry@item ibm032 60847501SpendryIBM RT 60947501Spendry@item ibm6000 61047501SpendryIBM RISC System/6000 61147501Spendry@item iris4d 61247501SpendrySGI Iris 4D 61347501Spendry@item macII 61447501SpendryApple Mac II 61547501Spendry@item mips 61647501SpendryMIPS RISC 61747501Spendry@item multimax 61847501SpendryEncore Multimax 61947501Spendry@item orion105 62047501SpendryHLH Orion 1/05 62147501Spendry@item sun3 62247501SpendrySun-3 family 62347501Spendry@item sun4 62447501SpendrySun-4 family 62547501Spendry@item tahoe 62647501SpendryTahoe family 62747501Spendry@item vax 62847501SpendryDEC Vax 62947501Spendry@end table 63047501Spendry 63147501Spendry@node Mount Maps, Amd Command Line Options, Supported Platforms, Top 63247501Spendry@comment node-name, next, previous, up 63347501Spendry@chapter Mount Maps 63447501Spendry@cindex Mount maps 63547501Spendry@cindex Automounter configuration maps 63647501Spendry@cindex Mount information 63747501Spendry 63847501Spendry@i{Amd} has no built-in knowledge of machines or filesystems. 63947501SpendryExternal @dfn{mount-maps} are used to provide the required information. 64047501SpendrySpecifically, @i{Amd} needs to know when and under what conditions it 64147501Spendryshould mount filesystems. 64247501Spendry 64347501SpendryThe map entry corresponding to the requested name contains a list of 64447501Spendrypossible locations from which to resolve the request. Each location 64547501Spendryspecifies filesystem type, information required by that filesystem (for 64647501Spendryexample the block special device in the case of UFS), and some 64747501Spendryinformation describing where to mount the filesystem (@pxref{fs Option}). A 64847501Spendrylocation may also contain @dfn{selectors} (@pxref{Selectors}).@refill 64947501Spendry 65047501Spendry@menu 65147501Spendry* Map Types:: 65247501Spendry* Key Lookup:: 65347501Spendry* Location Format:: 65447501Spendry@end menu 65547501Spendry 65647501Spendry@node Map Types, Key Lookup, Mount Maps, Mount Maps 65747501Spendry@comment node-name, next, previous, up 65847501Spendry@section Map Types 65947501Spendry@cindex Mount map types 66047501Spendry@cindex Map types 66147501Spendry@cindex Configuration map types 66247501Spendry@cindex Types of mount map 66347501Spendry@cindex Types of configuration map 66447501Spendry@cindex Determining the map type 66547501Spendry 66647501SpendryA mount-map provides the run-time configuration information to @i{Amd}. 66747501SpendryMaps can be implemented in many ways. Some of the forms supported by 66847501Spendry@i{Amd} are regular files, ndbm databases, NIS maps the @dfn{Hesiod} 66947501Spendryname server and even the password file. 67047501Spendry 67147501SpendryA mount-map @dfn{name} is a sequence of characters. When an automount 67247501Spendrypoint is created a handle on the mount-map is obtained. For each map 67347501Spendrytype configured @i{Amd} attempts to reference the a map of the 67447501Spendryappropriate type. If a map is found, @i{Amd} notes the type for future 67547501Spendryuse and deletes the reference, for example closing any open file 67647501Spendrydescriptors. The available maps are configure when @i{Amd} is built and 67747501Spendrycan be displayed by running the command @samp{amd -v}. 67847501Spendry 67947501SpendryBy default, @i{Amd} caches data in a mode dependent on the type of map. 68047501SpendryThis is the same as specifying @samp{cache:=mapdefault} and selects a 68147501Spendrysuitable default cache mode depending on the map type. The individual 68247501Spendrydefaults are described below. The @var{cache} option can be specified 68347501Spendryon automount points to alter the caching behaviour (@pxref{Automount 68447501SpendryFilesystem}).@refill 68547501Spendry 68647501SpendryThe following map types have been implemented, though some are not 68747501Spendryavailable on all machines. Run the command @samp{amd -v} to obtain a 68847501Spendrylist of map types configured on your machine. 68947501Spendry 69047501Spendry@menu 69147501Spendry* File maps:: 69247501Spendry* ndbm maps:: 69347501Spendry* NIS maps:: 69447501Spendry* Hesiod maps:: 69547501Spendry* Password maps:: 69647501Spendry* Union maps:: 69747501Spendry@end menu 69847501Spendry 69947501Spendry@node File maps, ndbm maps, Map Types, Map Types 70047501Spendry@comment node-name, next, previous, up 70147501Spendry@subsection File maps 70247501Spendry@cindex File maps 70347501Spendry@cindex Flat file maps 70447501Spendry@cindex File map syntactic conventions 70547501Spendry 70647501SpendryWhen @i{Amd} searches a file for a map entry it does a simple scan of 70747501Spendrythe file and supports both comments and continuation lines. 70847501Spendry 70947501SpendryContinuation lines are indicated by a backslash character (@samp{\}) as 71047501Spendrythe last character of a line in the file. The backslash, newline character 71147501Spendry@emph{and any leading white space on the following line} are discarded. A maximum 71247501Spendryline length of 2047 characters is enforced after continuation lines are read 71347501Spendrybut before comments are stripped. Each line must end with 71447501Spendrya newline character; that is newlines are terminators, not separators. 71547501SpendryThe following examples illustrate this: 71647501Spendry 71747501Spendry@example 71847501Spendrykey valA valB; \ 71947501Spendry valC 72047501Spendry@end example 72147501Spendry 72247501Spendryspecifies @emph{three} locations, and is identical to 72347501Spendry 72447501Spendry@example 72547501Spendrykey valA valB; valC 72647501Spendry@end example 72747501Spendry 72847501SpendryHowever, 72947501Spendry 73047501Spendry@example 73147501Spendrykey valA valB;\ 73247501Spendry valC 73347501Spendry@end example 73447501Spendry 73547501Spendryspecifies only @emph{two} locations, and is identical to 73647501Spendry 73747501Spendry@example 73847501Spendrykey valA valB;valC 73947501Spendry@end example 74047501Spendry 74147501SpendryAfter a complete line has been read from the file, including 74247501Spendrycontinuations, @i{Amd} determines whether there is a comment on the 74347501Spendryline. A comment begins with a hash (``@samp{#}'') character and 74447501Spendrycontinues to the end of the line. There is no way to escape or change 74547501Spendrythe comment lead-in character. 74647501Spendry 74747501SpendryNote that continuation lines and comment support @dfn{only} apply to 74847501Spendryfile maps, or ndbm maps built with the @code{mk-amd-map} program. 74947501Spendry 75047501SpendryWhen caching is enabled, file maps have a default cache mode of 75147501Spendry@code{all} (@pxref{Automount Filesystem}). 75247501Spendry 75347501Spendry@node ndbm maps, NIS maps, File maps, Map Types 75447501Spendry@comment node-name, next, previous, up 75547501Spendry@subsection ndbm maps 75647501Spendry@cindex ndbm maps 75747501Spendry 75847501SpendryAn ndbm map may be used as a fast access form of a file map. The program, 75947501Spendry@code{mk-amd-map}, converts a normal map file into an ndbm database. 76047501SpendryThis program supports the same continuation and comment conventions that 76147501Spendryare provided for file maps. Note that ndbm format files may @emph{not} 76247501Spendrybe sharable across machine architectures. The notion of speed generally 76347501Spendryonly applies to large maps; a small map, less than a single disk block, 76447501Spendryis almost certainly better implemented as a file map. 76547501Spendry 76647501Spendryndbm maps do not support cache mode @samp{all} and, when caching is 76747501Spendryenabled, have a default cache mode of @samp{inc} (@pxref{Automount Filesystem}). 76847501Spendry 76947501Spendry@node NIS maps, Hesiod maps, ndbm maps, Map Types 77047501Spendry@comment node-name, next, previous, up 77147501Spendry@subsection NIS maps 77247501Spendry@cindex NIS (YP) maps 77347501Spendry 77447501SpendryWhen using NIS (formerly YP), an @i{Amd} map is implemented directly 77547501Spendryby the underlying NIS map. Comments and continuation lines are 77647501Spendry@emph{not} supported in the automounter and must be stripped when 77747501Spendryconstructing the NIS server's database. 77847501Spendry 77947501SpendryNIS maps do not support cache mode @code{all} and, when caching is 78047501Spendryenabled, have a default cache mode of @code{inc} (@pxref{Automount Filesystem}). 78147501Spendry 78247501SpendryThe following rule illustrates what could be added to your NIS @file{Makefile}, 78347501Spendryin this case causing the @file{amd.home} map to be rebuilt: 78447501Spendry@example 78547501Spendry$(YPTSDIR)/amd.home.time: $(ETCDIR)/amd.home 78647501Spendry -@@sed -e "s/#.*$$//" -e "/^$$/d" $(ETCDIR)/amd.home | \ 78747501Spendry awk '{ \ 78847501Spendry for (i = 1; i <= NF; i++) \ 78947501Spendry if (i == NF) { \ 79047501Spendry if (substr($$i, length($$i), 1) == "\\") \ 79147501Spendry printf("%s", substr($$i, 1, length($$i) - 1)); \ 79247501Spendry else \ 79347501Spendry printf("%s\n", $$i); \ 79447501Spendry } \ 79547501Spendry else \ 79647501Spendry printf("%s ", $$i); \ 79747501Spendry }' | \ 79847501Spendry $(MAKEDBM) - $(YPDBDIR)/amd.home; \ 79947501Spendry touch $(YPTSDIR)/amd.home.time; \ 80047501Spendry echo "updated amd.home"; \ 80147501Spendry if [ ! $(NOPUSH) ]; then \ 80247501Spendry $(YPPUSH) amd.home; \ 80347501Spendry echo "pushed amd.home"; \ 80447501Spendry else \ 80547501Spendry : ; \ 80647501Spendry fi 80747501Spendry@end example 80847501Spendry 80947501SpendryHere @code{$(YPTSDIR)} contains the time stamp files, and @code{$(YPDBDIR)} contains 81047501Spendrythe dbm format NIS files. 81147501Spendry 81247501Spendry@node Hesiod maps, Password maps, NIS maps, Map Types 81347501Spendry@comment node-name, next, previous, up 81447501Spendry@subsection Hesiod maps 81547501Spendry@cindex Hesiod maps 81647501Spendry 81747501SpendryWhen the map name begins with the string @samp{hesiod.} lookups are made 81847501Spendryusing the @dfn{Hesiod} name server. The string following the dot is 81947501Spendryused as a name qualifier and is prepended with the key being located. 82047501SpendryThe entire string is then resolved in the @code{automount} context. For 82147501Spendryexample, if the the key is @samp{jsp} and map name is 82247501Spendry@samp{hesiod.homes} then @dfn{Hesiod} is asked to resolve 82347501Spendry@samp{jsp.homes.automount}. 82447501Spendry 82547501SpendryHesiod maps do not support cache mode @samp{all} and, when caching is 82647501Spendryenabled, have a default cache mode of @samp{inc} (@pxref{Automount Filesystem}). 82747501Spendry 82847501SpendryThe following is an example of a @dfn{Hesiod} map entry: 82947501Spendry 83047501Spendry@example 83147501Spendryjsp.homes.automount HS TXT "rfs:=/home/charm;rhost:=charm;sublink:=jsp" 83247501Spendrynjw.homes.automount HS TXT "rfs:=/home/dylan/dk2;rhost:=dylan;sublink:=njw" 83347501Spendry@end example 83447501Spendry 83547501Spendry@node Password maps, Union maps, Hesiod maps, Map Types 83647501Spendry@comment node-name, next, previous, up 83747501Spendry@subsection Password maps 83847501Spendry@cindex Password file maps 83947501Spendry@cindex /etc/passwd maps 84047501Spendry@cindex User maps, automatic generation 84147501Spendry@cindex Automatic generation of user maps 84247501Spendry@cindex Using the password file as a map 84347501Spendry 84447501SpendryThe password map support is unlike the four previous map types. When 84547501Spendrythe map name is the string @file{/etc/passwd} @i{Amd} can lookup a user 84647501Spendryname in the password file and re-arrange the home directory field to 84747501Spendryproduce a usable map entry. 84847501Spendry 84947501Spendry@i{Amd} assumes the home directory has the format 85047501Spendry`@t{/}@i{anydir}@t{/}@i{dom1}@t{/../}@i{domN}@t{/}@i{login}'. 85147501Spendry@c @footnote{This interpretation is not necessarily exactly what you want.} 85247501SpendryIt breaks this string into a map entry where @code{$@{rfs@}} has the 85347501Spendryvalue `@t{/}@i{anydir}@t{/}@i{domN}', @code{$@{rhost@}} has the value 85447501Spendry`@i{domN}@t{.}@i{...}@t{.}@i{dom1}', and @code{$@{sublink@}} has the 85547501Spendryvalue @samp{login}.@refill 85647501Spendry 85747501SpendryThus if the password file entry was 85847501Spendry 85947501Spendry@example 86047501Spendry/home/achilles/jsp 86147501Spendry@end example 86247501Spendry 86347501Spendrythe map entry used by @i{Amd} would be 86447501Spendry 86547501Spendry@example 86647501Spendryrfs:=/home/achilles;rhost:=achilles;sublink:=jsp 86747501Spendry@end example 86847501Spendry 86947501SpendrySimilarly, if the password file entry was 87047501Spendry 87147501Spendry@example 87247501Spendry/home/cc/sugar/mjh 87347501Spendry@end example 87447501Spendry 87547501Spendrythe map entry used by @i{Amd} would be 87647501Spendry 87747501Spendry@example 87847501Spendryrfs:=/home/sugar;rhost:=sugar.cc;sublink:=jsp 87947501Spendry@end example 88047501Spendry 88147501Spendry@node Union maps, Map Types, Password maps, Map Types 88247501Spendry@comment node-name, next, previous, up 88347501Spendry@subsection Union maps 88447501Spendry@cindex Union file maps 88547501Spendry 88647501SpendryThe union map support is provided specifically for use with the union 88747501Spendryfilesystem, @pxref{Union Filesystem}. 88847501Spendry 88947501SpendryIt is identified by the string @samp{union:} which is followed by a 89047501Spendrycolon separated list of directories. The directories are read in order, 89147501Spendryand the names of all entries are recorded in the map cache. Later 89247501Spendrydirectories take precedence over earlier ones. The union filesystem 89347501Spendrytype then uses the map cache to determine the union of the names in all 89447501Spendrythe directories. 89547501Spendry 89647501Spendry@c subsection Gdbm 89747501Spendry 89847501Spendry@node Key Lookup, Location Format, Map Types, Mount Maps 89947501Spendry@comment node-name, next, previous, up 90047501Spendry@section How keys are looked up 90147501Spendry@cindex Key lookup 90247501Spendry@cindex Map lookup 90347501Spendry@cindex Looking up keys 90447501Spendry@cindex How keys are looked up 90547501Spendry@cindex Wildcards in maps 90647501Spendry 90747501SpendryThe key is located in the map whose type was determined when the 90847501Spendryautomount point was first created. In general the key is a pathname 90947501Spendrycomponent. In some circumstances this may be modified by variable 91047501Spendryexpansion (@pxref{Variable Expansion}) and prefixing. If the automount 91147501Spendrypoint has a prefix, specified by the @var{pref} option, then that is 91247501Spendryprepended to the search key before the map is searched. 91347501Spendry 91447501SpendryIf the map cache is a @samp{regexp} cache then the key is treated as an 91547501Spendryegrep-style regular expression, otherwise a normal string comparison is 91647501Spendrymade. 91747501Spendry 91847501SpendryIf the key cannot be found then a @dfn{wildcard} match is attempted. 91947501Spendry@i{Amd} repeatedly strips the basename from the key, appends @samp{/*} and 92047501Spendryattempts a lookup. Finally, @i{Amd} attempts to locate the special key @samp{*}. 92147501Spendry 92247501Spendry@group 92347501SpendryFor example, the following sequence would be checked if @file{home/dylan/dk2} was 92447501Spendrybeing located: 92547501Spendry 92647501Spendry@example 92747501Spendry home/dylan/dk2 92847501Spendry home/dylan/* 92947501Spendry home/* 93047501Spendry * 93147501Spendry@end example 93247501Spendry@end group 93347501Spendry 93447501SpendryAt any point when a wildcard is found, @i{Amd} proceeds as if an exact 93547501Spendrymatch had been found and the value field is then used to resolve the 93647501Spendrymount request, otherwise an error code is propagated back to the kernel. 93747501Spendry(@pxref{Filesystem Types}).@refill 93847501Spendry 93947501Spendry@node Location Format, , Key Lookup, Mount Maps 94047501Spendry@comment node-name, next, previous, up 94147501Spendry@section Location Format 94247501Spendry@cindex Location format 94347501Spendry@cindex Map entry format 94447501Spendry@cindex How locations are parsed 94547501Spendry 94647501SpendryThe value field from the lookup provides the information required to 94747501Spendrymount a filesystem. The information is parsed according to the syntax 94847501Spendryshown below. 94947501Spendry 95047501Spendry@display 95147501Spendry@i{location-list}: 95247501Spendry @i{location-selection} 95347501Spendry @i{location-list} @i{white-space} @t{||} @i{white-space} @i{location-selection} 95447501Spendry@i{location-selection}: 95547501Spendry @i{location} 95647501Spendry @i{location-selection} @i{white-space} @i{location} 95747501Spendry@i{location}: 95847501Spendry @i{location-info} 95947501Spendry @t{-}@i{location-info} 96047501Spendry @t{-} 96147501Spendry@i{location-info}: 96247501Spendry @i{sel-or-opt} 96347501Spendry @i{location-info}@t{;}@i{sel-or-opt} 96447501Spendry @t{;} 96547501Spendry@i{sel-or-opt}: 96647501Spendry @i{selection} 96747501Spendry @i{opt-ass} 96847501Spendry@i{selection}: 96947501Spendry selector@t{==}@i{value} 97047501Spendry selector@t{!=}@i{value} 97147501Spendry@i{opt-ass}: 97247501Spendry option@t{:=}@i{value} 97347501Spendry@i{white-space}: 97447501Spendry space 97547501Spendry tab 97647501Spendry@end display 97747501Spendry 97847501SpendryNote that unquoted whitespace is not allowed in a location description. 97947501SpendryWhite space is only allowed, and is mandatory, where shown with non-terminal 98047501Spendry@samp{white-space}. 98147501Spendry 98247501SpendryA @dfn{location-selection} is a list of possible volumes with which to 98347501Spendrysatisfy the request. @dfn{location-selection}s are separated by the 98447501Spendry@samp{||} operator. The effect of this operator is to prevent use of 98547501Spendrylocation-selections to its right if any of the location-selections on 98647501Spendryits left were selected whether or not any of them were successfully 98747501Spendrymounted (@pxref{Selectors}).@refill 98847501Spendry 98947501SpendryThe location-selection, and singleton @dfn{location-list}, 99047501Spendry@samp{type:=ufs;dev:=/dev/xd1g} would inform @i{Amd} to mount a UFS 99147501Spendryfilesystem from the block special device @file{/dev/xd1g}. 99247501Spendry 99347501SpendryThe @dfn{sel-or-opt} component is either the name of an option required 99447501Spendryby a specific filesystem, or it is the name of a built-in, predefined 99547501Spendryselector such as the architecture type. The value may be quoted with 99647501Spendrydouble quotes @samp{"}, for example 99747501Spendry@samp{type:="ufs";dev:="/dev/xd1g"}. These quotes are stripped when the 99847501Spendryvalue is parsed and there is no way to get a double quote into a value 99947501Spendryfield. Double quotes are used to get white space into a value field, 100047501Spendrywhich is needed for the program filesystem (@pxref{Program Filesystem}).@refill 100147501Spendry 100247501Spendry@menu 100347501Spendry* Map Defaults:: 100447501Spendry* Variable Expansion:: 100547501Spendry* Selectors:: 100647501Spendry* Map Options:: 100747501Spendry@end menu 100847501Spendry 100947501Spendry@node Map Defaults, Variable Expansion, Location Format, Location Format 101047501Spendry@comment node-name, next, previous, up 101147501Spendry@subsection Map Defaults 101247501Spendry@cindex Map defaults 101347501Spendry@cindex How to set default map parameters 101447501Spendry@cindex Setting default map parameters 101547501Spendry 101647501SpendryA location beginning with a dash @samp{-} is used to specify default 101747501Spendryvalues for subsequent locations. Any previously specified defaults in 101847501Spendrythe location-list are discarded. The default string can be empty in 101947501Spendrywhich case no defaults apply. 102047501Spendry 102147501SpendryThe location @samp{-fs:=/mnt;opts:=ro} would set the local mount point 102247501Spendryto @file{/mnt} and cause mounts to be read-only by default. Defaults 102347501Spendryspecified this way are appended to, and so override, any global map 102447501Spendrydefaults given with @samp{/defaults}). 102547501Spendry@c 102647501Spendry@c A @samp{/defaults} value @dfn{gdef} and a location list 102747501Spendry@c \begin{quote} 102847501Spendry@c $@samp{-}@dfn{def}_a $\verb*+ +$ @dfn{loc}_{a_1} $\verb*+ +$ @dfn{loc}_{a_2} $\verb*+ +$ @samp{-}@dfn{def}_b $\verb*+ +$ @dfn{loc}_{b_1} \ldots$ 102947501Spendry@c \end{quote} 103047501Spendry@c is equivalent to 103147501Spendry@c \begin{quote} 103247501Spendry@c $@samp{-}@dfn{gdef}@samp{;}@dfn{def}_a $\verb*+ +$ @dfn{loc}_{a_1} $\verb*+ +$ @dfn{loc}_{a_2} $\verb*+ +$ @samp{-}@dfn{gdef}@samp{;}@dfn{def}_b $\verb*+ +$ @dfn{loc}_{b_1} \ldots$ 103347501Spendry@c \end{quote} 103447501Spendry@c which is equivalent to 103547501Spendry@c \begin{quote} 103647501Spendry@c $@dfn{gdef}@samp{;}@dfn{def}_a@samp{;}@dfn{loc}_{a_1} $\verb*+ +$@dfn{gdef}@samp{;}@dfn{def}_a@samp{;}@dfn{loc}_{a_2} $\verb*+ +$@dfn{gdef}@samp{;}@dfn{def}_b@samp{;}@dfn{loc}_{b_1} \ldots$ 103747501Spendry@c\end{quote} 103847501Spendry 103947501Spendry@node Variable Expansion, Selectors, Map Defaults, Location Format 104047501Spendry@comment node-name, next, previous, up 104147501Spendry@subsection Variable Expansion 104247501Spendry@cindex Variable expansion 104347501Spendry@cindex How variables are expanded 104447501Spendry@cindex Pathname operators 104547501Spendry@cindex Domain stripping 104647501Spendry@cindex Domainname operators 104747501Spendry@cindex Stripping the local domain name 104847501Spendry@cindex Environment variables 104947501Spendry@cindex How to access environment variables in maps 105047501Spendry 105147501SpendryTo allow generic location specifications @i{Amd} does variable expansion 105247501Spendryon each location and also on some of the option strings. Any option or 105347501Spendryselector appearing in the form @code{$@dfn{var}} is replaced by the 105447501Spendrycurrent value of that option or selector. For example, if the value of 105547501Spendry@code{$@{key@}} was @samp{bin}, @code{$@{autodir@}} was @samp{/a} and 105647501Spendry@code{$@{fs@}} was `@t{$@{autodir@}}@t{/local/}@t{$@{key@}}' then 105747501Spendryafter expansion @code{$@{fs@}} would have the value @samp{/a/local/bin}. 105847501SpendryAny environment variable can be accessed in a similar way.@refill 105947501Spendry 106047501SpendryTwo pathname operators are available when expanding a variable. If the 106147501Spendryvariable name begins with @samp{/} then only the last component of 106247501Spendrythen pathname is substituted. For example, if @code{$@{path@}} was 106347501Spendry@samp{/foo/bar} then @code{$@{/path@}} would be expanded to @samp{bar}. 106447501SpendrySimilarly, if the variable name ends with @samp{/} then all but the 106547501Spendrylast component of the pathname is substituted. In the previous example, 106647501Spendry@code{$@{path/@}} would be expanded to @samp{/foo}.@refill 106747501Spendry 106847501SpendryTwo domain name operators are also provided. If the variable name 106947501Spendrybegins with @samp{.} then only the domain part of the name is 107047501Spendrysubstituted. For example, if @code{$@{rhost@}} was 107147501Spendry@samp{swan.doc.ic.ac.uk} then @code{$@{.rhost@}} would be expanded to 107247501Spendry@samp{doc.ic.ac.uk}. Similarly, if the variable name ends with @samp{.} 107347501Spendrythen only the host component is substituted. In the previous example, 107447501Spendry@code{$@{rhost.@}} would be expanded to @samp{swan}.@refill 107547501Spendry 107647501SpendryVariable expansion is a two phase process. Before a location is parsed, 107747501Spendryall references to selectors, @i{eg} @code{$@{path@}}, are expanded. The 107847501Spendrylocation is then parsed, selections are evaluated and option assignments 107947501Spendryrecorded. If there were no selections or they all succeeded the 108047501Spendrylocation is used and the values of the following options are expanded in 108147501Spendrythe order given: @var{sublink}, @var{rfs}, @var{fs}, @var{opts}, 108247501Spendry@var{mount} and @var{unmount}. 108347501Spendry 108447501SpendryNote that expansion of option values is done after @dfn{all} assignments 108547501Spendryhave been completed and not in a purely left to right order as is done 108647501Spendryby the shell. This generally has the desired effect but care must be 108747501Spendrytaken if one of the options references another, in which case the 108847501Spendryordering can become significant. 108947501Spendry 109047501SpendryThere are two special cases concerning variable expansion: 109147501Spendry 109247501Spendry@enumerate 109347501Spendry@item 109447501Spendrybefore a map is consulted, any selectors in the name received 109547501Spendryfrom the kernel are expanded. For example, if the request from the 109647501Spendrykernel was for `@t{$@{arch@}}@t{.bin}' and the machine architecture 109747501Spendrywas @samp{vax}, the value given to @code{$@{key@}} would be 109847501Spendry@samp{vax.bin}.@refill 109947501Spendry 110047501Spendry@item 110147501Spendrythe value of @code{$@{rhost@}} is expanded and normalized before the 110247501Spendryother options are expanded. The normalization process strips any local 110347501Spendrysub-domain components. For example, if @code{$@{domain@}} was 110447501Spendry@samp{Berkeley.EDU} and @code{$@{rhost@}} was initially 110547501Spendry@samp{snow.Berkeley.EDU}, after the normalization it would simply be 110647501Spendry@samp{snow}. Hostname normalization is currently done in a 110747501Spendry@emph{case-dependent} manner.@refill 110847501Spendry@end enumerate 110947501Spendry 111047501Spendry@node Selectors, Map Options, Variable Expansion, Location Format 111147501Spendry@comment node-name, next, previous, up 111247501Spendry@subsection Selectors 111347501Spendry@cindex Selectors 111447501Spendry 111547501SpendrySelectors are used to control the use of a location. It is possible to 111647501Spendryshare a mount map between many machines in such a way that filesystem 111747501Spendrylocation, architecture and operating system differences are hidden from 111847501Spendrythe users. A selector of the form @samp{arch==sun3;os==sos4} would only 111947501Spendryapply on Sun-3s running SunOS 4.x. 112047501Spendry 112147501SpendrySelectors are evaluated left to right. If a selector fails then that 112247501Spendrylocation is ignored. Thus the selectors form a conjunction and the 112347501Spendrylocations form a disjunction. If all the locations are ignored or 112447501Spendryotherwise fail then @i{Amd} uses the @dfn{error} filesystem 112547501Spendry(@pxref{Error Filesystem}). This is equivalent to having a location 112647501Spendry@samp{type:=error} at the end of each mount-map entry.@refill 112747501Spendry 112847501SpendryThe selectors currently implemented are: 112947501Spendry 113047501Spendry@table @samp 113147501Spendry@cindex arch, mount selector 113247501Spendry@cindex Mount selector; arch 113347501Spendry@cindex Selector; arch 113447501Spendry@item arch 113547501Spendrythe machine architecture which was automatically determined at compile 113647501Spendrytime. The architecture type can be displayed by running the command 113747501Spendry@samp{amd -v}. @xref{Supported Machine Architectures}.@refill 113847501Spendry 113947501Spendry@item autodir 114047501Spendry@cindex autodir, mount selector 114147501Spendry@cindex Mount selector; autodir 114247501Spendry@cindex Selector; autodir 114347501Spendrythe default directory under which to mount filesystems. This may be 114447501Spendrychanged by the ``-a'' command line option. See the @var{fs} option. 114547501Spendry 114647501Spendry@item byte 114747501Spendry@cindex byte, mount selector 114847501Spendry@cindex Mount selector; byte 114947501Spendry@cindex Selector; byte 115047501Spendrythe machine's byte ordering. This is either @samp{little}, indicating 115147501Spendrylittle-endian, or @samp{big}, indicating big-endian. One possible use 115247501Spendryis to share @samp{rwho} databases (@pxref{rwho servers}). Another is to 115347501Spendryshare ndbm databases, however this use can be considered a courageous 115447501Spendryjuggling act. 115547501Spendry 115647501Spendry@item cluster 115747501Spendry@cindex cluster, mount selector 115847501Spendry@cindex Mount selector; cluster 115947501Spendry@cindex Selector; cluster 116047501Spendryis provided as a hook for the name of the local cluster. This can be 116147501Spendryused to decide which servers to use for copies of replicated 116247501Spendryfilesystems. @code{$@{cluster@}} defaults to the value of 116347501Spendry@code{$@{domain@}} unless a different value is set with the ``-C'' 116447501Spendrycommand line option. 116547501Spendry 116647501Spendry@item domain 116747501Spendry@cindex domain, mount selector 116847501Spendry@cindex Mount selector; domain 116947501Spendry@cindex Selector; domain 117047501Spendrythe local domain name as specified by the ``-d'' command line option. 117147501SpendrySee @samp{host}. 117247501Spendry 117347501Spendry@item host 117447501Spendry@cindex host, mount selector 117547501Spendry@cindex Mount selector; host 117647501Spendry@cindex Selector; host 117747501Spendrythe local hostname as determined by @b{gethostname}(2). If no domain 117847501Spendryname was specified on the command line and the hostname contains a 117947501Spendryperiod @samp{.} then the string before the period is used as the 118047501Spendryhost name, and the string after the period is assigned to 118147501Spendry@code{$@{domain@}}. For example, if the hostname is 118247501Spendry@samp{styx.doc.ic.ac.uk} then @code{host} would be @samp{styx} and 118347501Spendry@code{domain} would be @samp{doc.ic.ac.uk}. @code{hostd} would be 118447501Spendry@samp{styx.doc.ic.ac.uk}.@refill 118547501Spendry 118647501Spendry@item hostd 118747501Spendry@cindex hostd, mount selector 118847501Spendry@cindex Mount selector; hostd 118947501Spendry@cindex Selector; hostd 119047501Spendryis @code{$@{host@}} and @code{$@{domain@}} concatenated with a 119147501Spendry@samp{.} inserted between them if required. If @code{$@{domain@}} 119247501Spendryis an empty string then @code{$@{host@}} and @code{$@{hostd@}} will be 119347501Spendryidentical. 119447501Spendry 119547501Spendry@item karch 119647501Spendry@cindex karch, mount selector 119747501Spendry@cindex Mount selector; karch 119847501Spendry@cindex Selector; karch 119947501Spendryis provided as a hook for the kernel architecture. This is used on 120047501SpendrySunOS 4, for example, to distinguish between different @samp{/usr/kvm} 120147501Spendryvolumes. @code{$@{karch@}} defaults to the value of @code{$@{arch@}} 120247501Spendryunless a different value is set with the ``-k'' command line option. 120347501Spendry 120447501Spendry@item os 120547501Spendry@cindex os, mount selector 120647501Spendry@cindex Mount selector; os 120747501Spendry@cindex Selector; os 120847501Spendrythe operating system. Like the machine architecture, this is 120947501Spendryautomatically determined at compile time. The operating system name can 121047501Spendrybe displayed by running the command @samp{amd -v}. @xref{Supported 121147501SpendryOperating Systems}.@refill 121247501Spendry 121347501Spendry@end table 121447501Spendry 121547501SpendryThe following selectors are also provided. Unlike the other selectors, 121647501Spendrythey vary for each lookup. Note that when the name from the kernel is 121747501Spendryexpanded prior to a map lookup, these selectors are all defined as empty 121847501Spendrystrings. 121947501Spendry 122047501Spendry@table @samp 122147501Spendry@item key 122247501Spendry@cindex key, mount selector 122347501Spendry@cindex Mount selector; key 122447501Spendry@cindex Selector; key 122547501Spendrythe name being resolved. For example, if @file{/home} is an automount 122647501Spendrypoint, then accessing @file{/home/foo} would set @code{$@{key@}} to the 122747501Spendrystring @samp{foo}. The key is prefixed by the @var{pref} option set in 122847501Spendrythe parent mount point. The default prefix is an empty string. If the 122947501Spendryprefix was @file{blah/} then @code{$@{key@}} would be set to 123047501Spendry@file{blah/foo}.@refill 123147501Spendry 123247501Spendry@item map 123347501Spendry@cindex map, mount selector 123447501Spendry@cindex Mount selector; map 123547501Spendry@cindex Selector; map 123647501Spendrythe name of the mount map being used. 123747501Spendry 123847501Spendry@item path 123947501Spendry@cindex path, mount selector 124047501Spendry@cindex Mount selector; path 124147501Spendry@cindex Selector; path 124247501Spendrythe full pathname of the name being resolved. For example 124347501Spendry@file{/home/foo} in the example above. 124447501Spendry 124547501Spendry@item wire 124647501Spendry@cindex wire, mount selector 124747501Spendry@cindex Mount selector; wire 124847501Spendry@cindex Selector; wire 124947501Spendrythe name of the network to which the primary network interface is 125047501Spendryattached. If a symbolic name cannot be found in the networks or hosts 125147501Spendrydatabase then dotted IP address format is used. This value is also 125247501Spendryoutput by the ``-v'' option. 125347501Spendry 125447501Spendry@end table 125547501Spendry 125647501SpendrySelectors can be negated by using @samp{!=} instead of @samp{==}. For 125747501Spendryexample to select a location on all non-Vax machines the selector 125847501Spendry@samp{arch!=vax} would be used. 125947501Spendry 126047501Spendry@node Map Options, , Selectors, Location Format 126147501Spendry@comment node-name, next, previous, up 126247501Spendry@subsection Map Options 126347501Spendry@cindex Map options 126447501Spendry@cindex Setting map options 126547501Spendry 126647501SpendryOptions are parsed concurrently with selectors. The difference is that 126747501Spendrywhen an option is seen the string following the @samp{:=} is 126847501Spendryrecorded for later use. As a minimum the @var{type} option must be 126947501Spendryspecified. Each filesystem type has other options which must also be 127047501Spendryspecified. @xref{Filesystem Types}, for details on the filesystem 127147501Spendryspecific options.@refill 127247501Spendry 127347501SpendrySuperfluous option specifications are ignored and are not reported 127447501Spendryas errors. 127547501Spendry 127647501SpendryThe following options apply to more than one filesystem type. 127747501Spendry 127847501Spendry@menu 127947501Spendry* delay Option:: 128047501Spendry* fs Option:: 128147501Spendry* opts Option:: 128247501Spendry* sublink Option:: 128347501Spendry* type Option:: 128447501Spendry@end menu 128547501Spendry 128647501Spendry@node delay Option, fs Option, Map Options, Map Options 128747501Spendry@comment node-name, next, previous, up 128847501Spendry@subsubsection delay Option 128947501Spendry@cindex Setting a delay on a mount location 129047501Spendry@cindex Delaying mounts from specific locations 129147501Spendry@cindex Primary server 129247501Spendry@cindex Secondary server 129347501Spendry@cindex delay, mount option 129447501Spendry@cindex Mount option; delay 129547501Spendry 129647501SpendryThe delay, in seconds, before an attempt will be made to mount from the current location. 129747501SpendryAuxilliary data, such as network address, file handles and so on are computed 129847501Spendryregardless of this value. 129947501Spendry 130047501SpendryA delay can be used to implement the notion of primary and secondary file servers. 130147501SpendryThe secondary servers would have a delay of a few seconds, 130247501Spendrythus giving the primary servers a chance to respond first. 130347501Spendry 130447501Spendry@node fs Option, opts Option, delay Option, Map Options 130547501Spendry@comment node-name, next, previous, up 130647501Spendry@subsubsection fs Option 130747501Spendry@cindex Setting the local mount point 130847501Spendry@cindex Overriding the default mount point 130947501Spendry@cindex fs, mount option 131047501Spendry@cindex Mount option; fs 131147501Spendry 131247501SpendryThe local mount point. The semantics of this option vary between 131347501Spendryfilesystems. 131447501Spendry 131547501SpendryFor NFS and UFS filesystems the value of @code{$@{fs@}} is used as the 131647501Spendrylocal mount point. For other filesystem types it has other meanings 131747501Spendrywhich are described in the section describing the respective filesystem 131847501Spendrytype. It is important that this string uniquely identifies the 131947501Spendryfilesystem being mounted. To satisfy this requirement, it should 132047501Spendrycontain the name of the host on which the filesystem is resident and the 132147501Spendrypathname of the filesystem on the local or remote host. 132247501Spendry 132347501SpendryThe reason for requiring the hostname is clear if replicated filesystems 132447501Spendryare considered. If a fileserver goes down and a replacement filesystem 132547501Spendryis mounted then the @dfn{local} mount point @dfn{must} be different from 132647501Spendrythat of the filesystem which is hung. Some encoding of the filesystem 132747501Spendryname is required if more than one filesystem is to be mounted from any 132847501Spendrygiven host. 132947501Spendry 133047501SpendryIf the hostname is first in the path then all mounts from a particular 133147501Spendryhost will be gathered below a single directory. If that server goes 133247501Spendrydown then the hung mount points are less likely to be accidentally 133347501Spendryreferenced, for example when @b{getwd}(3) traverses the namespace to 133447501Spendryfind the pathname of the current directory. 133547501Spendry 133647501SpendryThe @samp{fs} option defaults to 133747501Spendry@code{$@{autodir@}/$@{rhost@}$@{rfs@}}. In addition, 133847501Spendry@samp{rhost} defaults to the local host name (@code{$@{host@}}) and 133947501Spendry@samp{rfs} defaults to the value of @code{$@{path@}}, which is the full 134047501Spendrypath of the requested file; @samp{/home/foo} in the example above 134147501Spendry(@pxref{Selectors}). @code{$@{autodir@}} defaults to @samp{/a} but may 134247501Spendrybe changed with the ``-a'' command line option. Sun's automounter 134347501Spendrydefaults to @samp{/tmp_mnt}. Note that there is no @samp{/} between 134447501Spendrythe @code{$@{rhost@}} and @code{$@{rfs@}} since @code{$@{rfs@}} begins 134547501Spendrywith a @samp{/}.@refill 134647501Spendry 134747501Spendry@node opts Option, sublink Option, fs Option, Map Options 134847501Spendry@comment node-name, next, previous, up 134947501Spendry@subsubsection opts Option 135047501Spendry@cindex Setting system mount options 135147501Spendry@cindex Passing parameters to the mount system call 135247501Spendry@cindex mount system call 135347501Spendry@cindex mount system call flags 135447501Spendry@cindex The mount system call 135547501Spendry@cindex opts, mount option 135647501Spendry@cindex Mount option; opts 135747501Spendry 135847501SpendryThe options to pass to the mount system call. A leading @samp{-} is 135947501Spendrysilently ignored. The mount options supported generally correspond to 136047501Spendrythose used by @b{mount}(8) and are listed below. Some additional 136147501Spendrypseudo-options are interpreted by @i{Amd} and are also listed. 136247501Spendry 136347501SpendryUnless specifically overridden, each of the system default mount options 136447501Spendryapplies. Any options not recognised are ignored. If no options list is 136547501Spendrysupplied the string @samp{rw,defaults} is used and all the system 136647501Spendrydefault mount options apply. Options which are not applicable for a 136747501Spendryparticular operating system are silently ignored. For example, only 4.4 136847501SpendryBSD is known to implement the @code{compress} and @code{spongy} options. 136947501Spendry 137047501Spendry@table @code 137147501Spendry@item compress 137247501SpendryUse NFS compression protocol. 137347501Spendry@item grpid 137447501SpendryUse BSD directory group-id semantics. 137547501Spendry@item intr 137647501SpendryAllow keyboard interrupts on hard mounts. 137747501Spendry@item noconn 137847501SpendryDon't make a connection on datagram transports. 137947501Spendry@item nocto 138047501SpendryNo close-to-open consistency. 138147501Spendry@item nodevs 138247501SpendryDon't allow local special devices on this filesystem. 138347501Spendry@item nosuid 138447501SpendryDon't allow set-uid or set-gid executables on this filesystem. 138547501Spendry@item quota 138647501SpendryEnable quota checking on this mount. 138747501Spendry@item retrans=@i{n} 138847501SpendryThe number of NFS retransmits made before a user error is generated by a 138947501Spendry@samp{soft} mounted filesystem, and before a @samp{hard} mounted 139047501Spendryfilesystem reports @samp{NFS server @dfn{yoyo} not responding still 139147501Spendrytrying}. 139247501Spendry@item ro 139347501SpendryMount this filesystem readonly. 139447501Spendry@item rsize=@var{n} 139547501SpendryThe NFS read packet size. You may need to set this if you are using 139647501SpendryNFS/UDP through a gateway. 139747501Spendry@item soft 139847501SpendryGive up after @dfn{retrans} retransmissions. 139947501Spendry@item spongy 140047501SpendryLike @samp{soft} for status requests, and @samp{hard} for data transfers. 140147501Spendry@item tcp 140247501SpendryUse TCP/IP instead of UDP/IP, ignored if the NFS implementation does not 140347501Spendrysupport TCP/IP mounts. 140447501Spendry@item timeo=@var{n} 140547501SpendryThe NFS timeout, in tenth-seconds, before a request is retransmitted. 140647501Spendry@item wsize=@var{n} 140747501SpendryThe NFS write packet size. You may need to set this if you are using 140847501SpendryNFS/UDP through a gateway. 140947501Spendry@end table 141047501Spendry 141147501SpendryThe following options are implemented by @i{Amd}, rather than being 141247501Spendrypassed to the kernel. 141347501Spendry 141447501Spendry@table @code 141547501Spendry@item nounmount 141647501SpendryConfigures the mount so that its time-to-live will 141747501Spendrynever expire. This is also the default for some filesystem types. 141847501Spendry@c 141947501Spendry@c Implementation broken: 142047501Spendry@item ping=@var{n} 142147501SpendryThe interval, in seconds, between keep-alive pings. When four 142247501Spendryconsecutive pings have failed the mount point is marked as hung. This 142347501Spendryinterval defaults to 30 seconds. If the ping interval is less then or 142447501Spendryequal to zero, no pings are sent and the host is assumed to be always 142547501Spendryup. By default, pings are not sent for an NFS/TCP mount. 142647501Spendry@item retry=@var{n} 142747501SpendryThe number of times to retry the mount system call. 142847501Spendry@item utimeout=@var{n} 142947501SpendryThe interval, in seconds, by which the mount's 143047501Spendrytime-to-live is extended after an unmount attempt 143147501Spendryhas failed. In fact the interval is extended before the unmount is 143247501Spendryattempted to avoid thrashing. The default value is 120 seconds (two 143347501Spendryminutes) or as set by the ``-w'' command line option. 143447501Spendry@end table 143547501Spendry 143647501Spendry@node sublink Option, type Option, opts Option, Map Options 143747501Spendry@comment node-name, next, previous, up 143847501Spendry@subsubsection sublink Option 143947501Spendry@cindex Setting the sublink option 144047501Spendry@cindex sublink, mount option 144147501Spendry@cindex Mount option; sublink 144247501Spendry 144347501SpendryThe subdirectory within the mounted filesystem to which the reference 144447501Spendryshould point. This can be used to prevent duplicate mounts in cases 144547501Spendrywhere multiple directories in the same mounted filesystem are used. 144647501Spendry 144747501Spendry@node type Option, Map Options, sublink Option, Map Options 144847501Spendry@comment node-name, next, previous, up 144947501Spendry@subsubsection type Option 145047501Spendry@cindex Setting the filesystem type option 145147501Spendry@cindex type, mount option 145247501Spendry@cindex Mount option; type 145347501Spendry 145447501SpendryThe filesystem type to be used. @xref{Filesystem Types}, for a full 145547501Spendrydescription of each type.@refill 145647501Spendry 145747501Spendry@node Amd Command Line Options, Filesystem Types, Mount Maps, Top 145847501Spendry@comment node-name, next, previous, up 145947501Spendry@chapter @i{Amd} Command Line Options 146047501Spendry@cindex Command line options, Amd 146147501Spendry@cindex Amd command line options 146247501Spendry@cindex Overriding defaults on the command line 146347501Spendry 146447501SpendryMany of @i{Amd}'s parameters can be set from the command line. The 146547501Spendrycommand line is also used to specify automount points and maps. 146647501Spendry 146747501SpendryThe general format of a command line is 146847501Spendry 146947501Spendry@example 147047501Spendryamd [@i{options}] { @i{directory} @i{map-name} [-@i{map-options}] } ... 147147501Spendry@end example 147247501Spendry 147347501SpendryFor each directory and map-name given, @i{Amd} establishes an 147447501Spendryautomount point. The @dfn{map-options} may be any sequence of options 147547501Spendryor selectors---@pxref{Location Format}. The @dfn{map-options} 147647501Spendryapply only to @i{Amd}'s mount point. 147747501Spendry 147847501Spendry@samp{type:=toplvl;cache:=mapdefault;fs:=$@{map@}} is the default value for the 147947501Spendrymap options. Default options for a map are read from a special entry in 148047501Spendrythe map whose key is the string @samp{/defaults}. When default options 148147501Spendryare given they are prepended to any options specified in the mount-map 148247501Spendrylocations as explained in. @xref{Map Defaults}, for more details. 148347501Spendry 148447501SpendryThe @dfn{options} are any combination of those listed below. 148547501Spendry 148647501SpendryOnce the command line has been parsed, the automount points are mounted. 148747501SpendryThe mount points are created if they do not already exist, in which case they 148847501Spendrywill be removed when @i{Amd} exits. 148947501SpendryFinally, @i{Amd} disassociates itself from its controlling terminal and 149047501Spendryforks into the background. 149147501Spendry 149247501SpendryNote: Even if @i{Amd} has been built with @samp{-DDEBUG} it will still 149347501Spendrybackground itself and disassociate itself from the controlling terminal. 149447501SpendryTo use a debugger it is necessary to specify @samp{-D nodaemon} on the 149547501Spendrycommand line. 149647501Spendry 149747501Spendry@menu 149847501Spendry* -a Option:: Automount directory. 149947501Spendry* -c Option:: Cache timeout interval. 150047501Spendry* -d Option:: Domain name. 150147501Spendry* -k Option:: Kernel architecture. 150247501Spendry* -l Option:: Log file. 150347501Spendry* -n Option:: Hostname normalisation. 150447501Spendry* -p Option:: Output process id. 150547501Spendry* -r Option:: Restart existing mounts. 150647501Spendry* -t Option:: Kernel RPC timeout. 150747501Spendry* -v Option:: Version information. 150847501Spendry* -w Option:: Wait interval after failed unmount. 150947501Spendry* -x Option:: Log options. 151047501Spendry* -y Option:: NIS domain. 151147501Spendry* -C-Option:: Cluster name. 151247501Spendry* -D-Option:: Debug flags. 151347501Spendry@end menu 151447501Spendry 151547501Spendry@node -a Option, -c Option, Amd Command Line Options, Amd Command Line Options 151647501Spendry@comment node-name, next, previous, up 151747501Spendry@section @code{-a} @var{directory} 151847501Spendry@cindex Automount directory 151947501Spendry@cindex Setting the default mount directory 152047501Spendry 152147501SpendrySpecifies the default mount directory. This option changes the variable 152247501Spendry@code{$@{autodir@}} which otherwise defaults to @file{/a}. For example, 152347501Spendrysome sites prefer @file{/amd}. 152447501Spendry 152547501Spendry@example 152647501Spendryamd -a /amd ... 152747501Spendry@end example 152847501Spendry 152947501Spendry@node -c Option, -d Option, -a Option, Amd Command Line Options 153047501Spendry@comment node-name, next, previous, up 153147501Spendry@section @code{-c} @var{cache-interval} 153247501Spendry@cindex Cache interval 153347501Spendry@cindex Interval before a filesystem times out 153447501Spendry@cindex Setting the interval before a filesystem times out 153547501Spendry@cindex Changing the interval before a filesystem times out 153647501Spendry 153747501SpendrySelects the period, in seconds, for which a name is cached by @i{Amd}. 153847501SpendryIf no reference is made to the volume in this period, @i{Amd} discards 153947501Spendrythe volume name to filesystem mapping. 154047501Spendry 154147501SpendryOnce the last reference to a filesystem has been removed, @i{Amd} 154247501Spendryattempts to unmount the filesystem. If the unmount fails the interval 154347501Spendryis extended by a further period as specified by the @samp{-w} command 154447501Spendryline option or by the @samp{utimeout} mount option. 154547501Spendry 154647501SpendryThe default @dfn{cache-interval} is 300 seconds (five minutes). 154747501Spendry 154847501Spendry@node -d Option, -k Option, -a Option, Amd Command Line Options 154947501Spendry@comment node-name, next, previous, up 155047501Spendry@section @code{-d} @var{domain} 155147501Spendry@cindex Domain name 155247501Spendry@cindex Setting the local domain name 155347501Spendry@cindex Overriding the local domain name 155447501Spendry 155547501SpendrySpecifies the host's domain. This sets the internal variable 155647501Spendry@code{$@{domain@}} and affects the @code{$@{hostd@}} variable. 155747501Spendry 155847501SpendryIf this option is not specified and the hostname already contains the 155947501Spendrylocal domain then that is used, otherwise the default value of 156047501Spendry@code{$@{domain@}} is @samp{unknown.domain}. 156147501Spendry 156247501SpendryFor example, if the local domain was @samp{doc.ic.ac.uk}, @i{Amd} could 156347501Spendrybe started as follows: 156447501Spendry 156547501Spendry@example 156647501Spendryamd -d doc.ic.ac.uk ... 156747501Spendry@end example 156847501Spendry 156947501Spendry@node -k Option, -l Option, -d Option, Amd Command Line Options 157047501Spendry@comment node-name, next, previous, up 157147501Spendry@section @code{-k} @var{kernel-architecture} 157247501Spendry@cindex Setting the Kernel architecture 157347501Spendry 157447501SpendrySpecifies the kernel architecture of the system. This is usually the 157547501Spendryoutput of @samp{arch -k} and its only effect is to set the variable 157647501Spendry@code{$@{karch@}}. If this option is not given, @code{$@{karch@}} has 157747501Spendrythe same value as @code{$@{arch@}}. 157847501Spendry 157947501SpendryThis would be used as follows: 158047501Spendry 158147501Spendry@example 158247501Spendryamd -k `arch -k` ... 158347501Spendry@end example 158447501Spendry 158547501Spendry@node -l Option, -n Option, -k Option, Amd Command Line Options 158647501Spendry@comment node-name, next, previous, up 158747501Spendry@section @code{-l} @var{log-option} 158847501Spendry@cindex Log filename 158947501Spendry@cindex Setting the log file 159047501Spendry@cindex Using syslog to log errors 159147501Spendry@cindex syslog 159247501Spendry 159347501SpendrySelects the form of logging to be made. Two special @dfn{log-options} 159447501Spendryare recognised. 159547501Spendry 159647501Spendry@enumerate 159747501Spendry@item 159847501SpendryIf @dfn{log-option} is the string @samp{syslog}, @i{Amd} will use the 159947501Spendry@b{syslog}(3) mechanism.@refill 160047501Spendry 160147501Spendry@item 160247501SpendryIf @dfn{log-option} is the string @samp{/dev/stderr}, @i{Amd} will use 160347501Spendrystandard error, which is also the default target for log messages. To 160447501Spendryimplement this, @i{Amd} simulates the effect of the @samp{/dev/fd} 160547501Spendrydriver. 160647501Spendry@end enumerate 160747501Spendry 160847501SpendryAny other string is taken as a filename to use for logging. Log 160947501Spendrymessages are appended to the file if it already exists, otherwise a new 161047501Spendryfile is created. The file is opened once and then held open, rather 161147501Spendrythan being re-opened for each message. 161247501Spendry 161347501SpendryIf the @samp{syslog} option is specified but the system does not support 161447501Spendrysyslog or if the named file cannot be opened or created, @i{Amd} will 161547501Spendryuse standard error. Error messages generated before @i{Amd} has 161647501Spendryfinished parsing the command line are printed on standard error. 161747501Spendry 161847501SpendryUsing @samp{syslog} is usually best, in which case @i{Amd} would be 161947501Spendrystarted as follows: 162047501Spendry 162147501Spendry@example 162247501Spendryamd -l syslog ... 162347501Spendry@end example 162447501Spendry 162547501Spendry@node -n Option, -p Option, -l Option, Amd Command Line Options 162647501Spendry@comment node-name, next, previous, up 162747501Spendry@section @code{-n} 162847501Spendry@cindex Hostname normalisation 162947501Spendry@cindex Aliased hostnames 163047501Spendry@cindex Resolving aliased hostnames 163147501Spendry@cindex Normalising hostnames 163247501Spendry 163347501SpendryNormalises the remote hostname before using it. Normalisation is done 163447501Spendryby replacing the value of @code{$@{rhost@}} with the primary name 163547501Spendryreturned by a hostname lookup. 163647501Spendry 163747501SpendryThis option should be used if several names are used to refer to a 163847501Spendrysingle host in a mount map. 163947501Spendry 164047501Spendry@node -p Option, -t Option, -n Option, Amd Command Line Options 164147501Spendry@comment node-name, next, previous, up 164247501Spendry@section @code{-p} 164347501Spendry@cindex Process id 164447501Spendry@cindex Displaying the process id 164547501Spendry@cindex process id of Amd daemon 164647501Spendry@cindex pid file, creating with -p option 164747501Spendry@cindex Creating a pid file 164847501Spendry 164947501SpendryCauses @i{Amd}'s process id to be printed on standard output. 165047501SpendryThis can be redirected to a suitable file for use with kill: 165147501Spendry 165247501Spendry@example 165347501Spendryamd -p > /var/run/amd.pid ... 165447501Spendry@end example 165547501Spendry 165647501SpendryThis option only has an affect if @i{Amd} is running in daemon mode. 165747501SpendryIf @i{Amd} is started with the @code{-D nodaemon} debug flag, this 165847501Spendryoption is ignored. 165947501Spendry 166047501Spendry@node -r Option, -t Option, -p Option, Amd Command Line Options 166147501Spendry@comment node-name, next, previous, up 166247501Spendry@section @code{-r} 166347501Spendry@cindex Restarting existing mounts 166447501Spendry@cindex Picking up existing mounts 166547501Spendry 166647501SpendryTells @i{Amd} to restart existing mounts (@pxref{Inheritance Filesystem}). 166747501Spendry@c @dfn{This option will be made the default in the next release.} 166847501Spendry 166947501Spendry@node -t Option, -v Option, -r Option, Amd Command Line Options 167047501Spendry@comment node-name, next, previous, up 167147501Spendry@section @code{-t} @var{timeout.retransmit} 167247501Spendry@cindex Setting Amd's RPC parameters 167347501Spendry 167447501SpendrySpecifies the RPC @dfn{timeout} and @dfn{retransmit} intervals used by 167547501Spendrythe kernel to communicate to @i{Amd}. These are used to set the 167647501Spendry@samp{timeo} and @samp{retrans} mount options. 167747501Spendry 167847501Spendry@i{Amd} relies on the kernel RPC retransmit mechanism to trigger mount 167947501Spendryretries. The value of this parameter changes the retry interval. Too 168047501Spendrylong an interval gives poor interactive response, too short an interval 168147501Spendrycauses excessive retries. 168247501Spendry 168347501Spendry@node -v Option, -w Option, -t Option, Amd Command Line Options 168447501Spendry@comment node-name, next, previous, up 168547501Spendry@section @code{-v} 168647501Spendry@cindex Version information 168747501Spendry@cindex Discovering version information 168847501Spendry@cindex How to discover your version of Amd 168947501Spendry 169047501SpendryPrint version information on standard error and then exit. The output 169147501Spendryis of the form: 169247501Spendry 169347501Spendry@example 169447501Spendryamd 5.2.1.11 of 91/03/17 18:04:05 5.3Alpha11 #0: Sun Mar 17 18:07:28 GMT 1991 169547501SpendryBuilt by pendry@@vangogh.Berkeley.EDU for a hp300 running bsd44 (big-endian). 169647501SpendryMap support for: root, passwd, union, file, error. 169747501SpendryFS: ufs, nfs, nfsx, host, link, program, union, auto, direct, toplvl, error. 169847501SpendryPrimary network is 128.32.130.0. 169947501Spendry@end example 170047501Spendry 170147501SpendryThe information includes the version number, release date and name of 170247501Spendrythe release. The architecture (@pxref{Supported Machine Architectures}), 170347501Spendryoperating system (@pxref{Supported Operating Systems}) 170447501Spendryand byte ordering are also printed as they appear in the @code{$@{os@}}, 170547501Spendry@code{$@{arch@}} and @code{$@{byte@}} variables.@refill 170647501Spendry 170747501Spendry@node -w Option, -x Option, -v Option, Amd Command Line Options 170847501Spendry@comment node-name, next, previous, up 170947501Spendry@section @code{-w} @var{wait-timeout} 171047501Spendry@cindex Setting the interval between unmount attempts 171147501Spendry@cindex unmount attempt backoff interval 171247501Spendry 171347501SpendrySelects the interval in seconds between unmount attempts after the 171447501Spendryinitial time-to-live has expired. 171547501Spendry 171647501SpendryThis defaults to 120 seconds (two minutes). 171747501Spendry 171847501Spendry@node -x Option, -y Option, -w Option, Amd Command Line Options 171947501Spendry@comment node-name, next, previous, up 172047501Spendry@section @code{-x} @var{opts} 172147501Spendry@cindex Log message selection 172247501Spendry@cindex Selecting specific log messages 172347501Spendry@cindex How to select log messages 172447501Spendry@cindex syslog priorities 172547501Spendry 172647501SpendrySpecifies the type and verbosity of log messages. @dfn{opts} is 172747501Spendrya comma separated list selected from the following options: 172847501Spendry 172947501Spendry@table @code 173047501Spendry@item fatal 173147501SpendryFatal errors 173247501Spendry@item error 173347501SpendryNon-fatal errors 173447501Spendry@item user 173547501SpendryNon-fatal user errors 173647501Spendry@item warn 173747501SpendryRecoverable errors 173847501Spendry@item warning 173947501SpendryAlias for @code{warn} 174047501Spendry@item info 174147501SpendryInformation messages 174247501Spendry@item map 174347501SpendryMount map usage 174447501Spendry@item stats 174547501SpendryAdditional statistics 174647501Spendry@item all 174747501SpendryAll of the above 174847501Spendry@end table 174947501Spendry 175047501SpendryInitially a set of default logging flags is enabled. This is as if 175147501Spendry@samp{-x all,nomap,nostats} had been selected. The command line is 175247501Spendryparsed and logging is controlled by the ``-x'' option. The very first 175347501Spendryset of logging flags is saved and can not be subsequently disabled using 175447501Spendry@i{Amq}. This default set of options is useful for general production 175547501Spendryuse.@refill 175647501Spendry 175747501SpendryThe @samp{info} messages include details of what is mounted and 175847501Spendryunmounted and when filesystems have timed out. If you want to have the 175947501Spendrydefault set of messages without the @samp{info} messages then you simply 176047501Spendryneed @samp{-x noinfo}. The messages given by @samp{user} relate to 176147501Spendryerrors in the mount maps, so these are useful when new maps are 176247501Spendryinstalled. The following table lists the syslog priorites used for each 176347501Spendryof the message types.@refill 176447501Spendry 176547501Spendry@table @code 176647501Spendry@item fatal 176747501SpendryLOG_CRIT 176847501Spendry@item error 176947501SpendryLOG_ERR 177047501Spendry@item user 177147501SpendryLOG_WARNING 177247501Spendry@item warning 177347501SpendryLOG_WARNING 177447501Spendry@item info 177547501SpendryLOG_INFO 177647501Spendry@item debug 177747501SpendryLOG_DEBUG 177847501Spendry@item map 177947501SpendryLOG_DEBUG 178047501Spendry@item stats 178147501SpendryLOG_INFO 178247501Spendry@end table 178347501Spendry 178447501Spendry 178547501SpendryThe options can be prefixed by the string @samp{no} to indicate 178647501Spendrythat this option should be turned off. For example, to obtain all 178747501Spendrybut @samp{info} messages the option @samp{-x all,noinfo} would be used. 178847501Spendry 178947501SpendryIf @i{Amd} was built with debugging enabled the @code{debug} option is 179047501Spendryautomatically enabled regardless of the command line options. 179147501Spendry 179247501Spendry@node -y Option, -C-Option, -x Option, Amd Command Line Options 179347501Spendry@comment node-name, next, previous, up 179447501Spendry@section @code{-y} @var{NIS-domain} 179547501Spendry@cindex NIS (YP) domain name 179647501Spendry@cindex Overriding the NIS (YP) domain name 179747501Spendry@cindex Setting the NIS (YP) domain name 179847501Spendry@cindex YP domain name 179947501Spendry 180047501SpendrySelects an alternate NIS domain. This is useful for debugging and 180147501Spendrycross-domain shared mounting. If this flag is specified, @i{Amd} 180247501Spendryimmediately attempts to bind to a server for this domain. 180347501Spendry@c @i{Amd} refers to NIS maps when it starts, unless the ``-m'' option 180447501Spendry@c is specified, and whenever required in a mount map. 180547501Spendry 180647501Spendry@node -C-Option, -D-Option, -y Option, Amd Command Line Options 180747501Spendry@comment node-name, next, previous, up 180847501Spendry@section @code{-C} @var{cluster-name} 180947501Spendry@cindex Cluster names 181047501Spendry@cindex Setting the cluster name 181147501Spendry 181247501SpendrySpecifies the name of the cluster of which the local machine is a member. 181347501SpendryThe only effect is to set the variable @code{$@{cluster@}}. 181447501SpendryThe @dfn{cluster-name} is will usually obtained by running another command which uses 181547501Spendrya database to map the local hostname into a cluster name. 181647501Spendry@code{$@{cluster@}} can then be used as a selector to restrict mounting of 181747501Spendryreplicated data. 181847501SpendryIf this option is not given, @code{$@{cluster@}} has the same value as @code{$@{domain@}}. 181947501SpendryThis would be used as follows: 182047501Spendry 182147501Spendry@example 182247501Spendryamd -C `clustername` ... 182347501Spendry@end example 182447501Spendry 182547501Spendry@node -D-Option, , -C-Option, Amd Command Line Options 182647501Spendry@comment node-name, next, previous, up 182747501Spendry@section @code{-D} @var{opts} 182847501Spendry@cindex Debug options 182947501Spendry@cindex Setting debug flags 183047501Spendry 183147501SpendryControls the verbosity and coverage of the debugging trace; @dfn{opts} 183247501Spendryis a comma separated list of debugging options. The ``-D'' option is 183347501Spendryonly available if @i{Amd} was compiled with @samp{-DDEBUG}. The memory 183447501Spendrydebugging facilities are only available if @i{Amd} was compiled with 183547501Spendry@samp{-DDEBUG_MEM} (in addition to @samp{-DDEBUG}). 183647501Spendry 183747501SpendryThe most common options to use are @samp{-D trace} and @samp{-D test} 183847501Spendry(which turns on all the useful debug options). See the program source 183947501Spendryfor a more detailed explanation of the available options. 184047501Spendry 184147501Spendry@node Filesystem Types, Run-time Administration, Amd Command Line Options, Top 184247501Spendry@comment node-name, next, previous, up 184347501Spendry@chapter Filesystem Types 184447501Spendry@cindex Filesystem types 184547501Spendry@cindex Mount types 184647501Spendry@cindex Types of filesystem 184747501Spendry 184847501SpendryTo mount a volume, @i{Amd} must be told the type of filesystem to be 184947501Spendryused. Each filesystem type typically requires additional information 185047501Spendrysuch as the fileserver name for NFS. 185147501Spendry 185247501SpendryFrom the point of view of @i{Amd}, a @dfn{filesystem} is anything that 185347501Spendrycan resolve an incoming name lookup. An important feature is support 185447501Spendryfor multiple filesystem types. Some of these filesystems are 185547501Spendryimplemented in the local kernel and some on remote fileservers, whilst 185647501Spendrythe others are implemented internally by @i{Amd}.@refill 185747501Spendry 185847501SpendryThe two common filesystem types are UFS and NFS. Four other user 185947501Spendryaccessible filesystems (@samp{link}, @samp{program}, @samp{auto} and 186047501Spendry@samp{direct}) are also implemented internally by @i{Amd} and these are 186147501Spendrydescribed below. There are two additional filesystem types internal to 186247501Spendry@i{Amd} which are not directly accessible to the user (@samp{inherit} 186347501Spendryand @samp{error}). Their use is described since they may still have an 186447501Spendryeffect visible to the user.@refill 186547501Spendry 186647501Spendry@menu 186747501Spendry* Network Filesystem:: A single NFS filesystem. 186847501Spendry* Network Host Filesystem:: NFS mount a host's entire export tree. 186947501Spendry* Network Filesystem Group:: An atomic group of NFS filesystems. 187047501Spendry* Unix Filesystem:: Native disk filesystem. 187147501Spendry* Program Filesystem:: Generic Program mounts. 187247501Spendry* Symbolic Link Filesystem:: Local link referencing existing filesystem. 187347501Spendry* Automount Filesystem:: 187447501Spendry* Direct Automount Filesystem:: 187547501Spendry* Union Filesystem:: 187647501Spendry* Error Filesystem:: 187747501Spendry* Top-level Filesystem:: 187847501Spendry* Root Filesystem:: 187947501Spendry* Inheritance Filesystem:: 188047501Spendry@end menu 188147501Spendry 188247501Spendry@node Network Filesystem, Network Host Filesystem, Filesystem Types, Filesystem Types 188347501Spendry@comment node-name, next, previous, up 188447501Spendry@section Network Filesystem (@samp{type:=nfs}) 188547501Spendry@cindex NFS 188647501Spendry@cindex Mounting an NFS filesystem 188747501Spendry@cindex How to mount and NFS filesystem 188847501Spendry@cindex nfs, filesystem type 188947501Spendry@cindex Filesystem type; nfs 189047501Spendry 189147501SpendryThe @dfn{nfs} filesystem type provides access to Sun's NFS. 189247501Spendry 189347501Spendry@noindent 189447501SpendryThe following options must be specified: 189547501Spendry 189647501Spendry@table @code 189747501Spendry@cindex rhost, mount option 189847501Spendry@cindex Mount option; rhost 189947501Spendry@item rhost 190047501Spendrythe remote fileserver. This must be an entry in the hosts database. IP 190147501Spendryaddresses are not accepted. The default value is taken 190247501Spendryfrom the local host name (@code{$@{host@}}) if no other value is 190347501Spendryspecified. 190447501Spendry 190547501Spendry@cindex rfs, mount option 190647501Spendry@cindex Mount option; rfs 190747501Spendry@item rfs 190847501Spendrythe remote filesystem. 190947501SpendryIf no value is specified for this option, an internal default of 191047501Spendry@code{$@{path@}} is used. 191147501Spendry@end table 191247501Spendry 191347501SpendryNFS mounts require a two stage process. First, the @dfn{file handle} of 191447501Spendrythe remote file system must be obtained from the server. Then a mount 191547501Spendrysystem call must be done on the local system. @i{Amd} keeps a cache 191647501Spendryof file handles for remote file systems. The cache entries have a 191747501Spendrylifetime of a few minutes. 191847501Spendry 191947501SpendryIf a required file handle is not in the cache, @i{Amd} sends a request 192047501Spendryto the remote server to obtain it. @i{Amd} @dfn{does not} wait for 192147501Spendrya response; it notes that one of the locations needs retrying, but 192247501Spendrycontinues with any remaining locations. When the file handle becomes 192347501Spendryavailable, and assuming none of the other locations was successfully 192447501Spendrymounted, @i{Amd} will retry the mount. This mechanism allows several 192547501SpendryNFS filesystems to be mounted in parallel. 192647501Spendry@c @footnote{The mechanism 192747501Spendry@c is general, however NFS is the only filesystem 192847501Spendry@c for which the required hooks have been written.} 192947501SpendryThe first one which responds with a valid file handle will be used. 193047501Spendry 193147501Spendry@noindent 193247501SpendryAn NFS entry might be: 193347501Spendry 193447501Spendry@example 193547501Spendryjsp host!=charm;type:=nfs;rhost:=charm;rfs:=/home/charm;sublink:=jsp 193647501Spendry@end example 193747501Spendry 193847501SpendryThe mount system call and any unmount attempts are always done 193947501Spendryin a new task to avoid the possibilty of blocking @i{Amd}. 194047501Spendry 194147501Spendry@node Network Host Filesystem, Network Filesystem Group, Network Filesystem, Filesystem Types 194247501Spendry@comment node-name, next, previous, up 194347501Spendry@section Network Host Filesystem (@samp{type:=host}) 194447501Spendry@cindex Network host filesystem 194547501Spendry@cindex Mounting entire export trees 194647501Spendry@cindex How to mount all NFS exported filesystems 194747501Spendry@cindex host, filesystem type 194847501Spendry@cindex Filesystem type; host 194947501Spendry 195047501Spendry@c NOTE: the current implementation of the @dfn{host} filesystem type 195147501Spendry@c sometimes fails to maintain a consistent view of the remote mount tree. 195247501Spendry@c This happens when the mount times out and only some of the remote mounts 195347501Spendry@c are successfully unmounted. To prevent this from occuring, use the 195447501Spendry@c @samp{nounmount} mount option. 195547501Spendry 195647501SpendryThe @dfn{host} filesystem allows access to the entire export tree of an 195747501SpendryNFS server. The implementation is layered above the @samp{nfs} 195847501Spendryimplementation so keep-alives work in the same way. The only option 195947501Spendrywhich needs to specified is @samp{rhost} which is the name of the 196047501Spendryfileserver to mount. 196147501Spendry 196247501SpendryThe @samp{host} filesystem type works by querying the mount daemon on 196347501Spendrythe given fileserver to obtain its export list. @i{Amd} then obtains 196447501Spendryfilehandles for each of the exported filesystems. Any errors at this 196547501Spendrystage cause that particular filesystem to be ignored. Finally each 196647501Spendryfilesystem is mounted. Again, errors are logged but ignored. One 196747501Spendrycommon reason for mounts to fail is that the mount point does not exist. 196847501SpendryAlthough @i{Amd} attempts to automatically create the mount point, it 196947501Spendrymay be on a remote filesystem to which @i{Amd} does not have write 197047501Spendrypermission. 197147501Spendry 197247501SpendryWhen an attempt to unmount a @samp{host} filesystem mount fails, @i{Amd} 197347501Spendryremounts any filesystems which had succesfully been unmounted. To do 197447501Spendrythis @i{Amd} queries the mount daemon again and obtains a fresh copy of 197547501Spendrythe export list. @i{Amd} then tries to mount any exported filesystems 197647501Spendrywhich are not currently mounted. 197747501Spendry 197847501SpendrySun's automounter provides a special @samp{-hosts} map. To achieve the 197947501Spendrysame effect with @i{Amd} requires two steps. First a mount map must 198047501Spendrybe created as follows: 198147501Spendry 198247501Spendry@example 198347501Spendry/defaults type:=host;fs:=$@{autodir@}/$@{rhost@}/root;rhost:=$@{key@} 198447501Spendry* opts:=rw,nosuid,grpid 198547501Spendry@end example 198647501Spendry 198747501Spendry@noindent 198847501Spendryand then start @i{Amd} with the following command 198947501Spendry 199047501Spendry@example 199147501Spendryamd /n net.map 199247501Spendry@end example 199347501Spendry 199447501Spendry@noindent 199547501Spendrywhere @samp{net.map} is the name of map described above. Note that the 199647501Spendryvalue of @code{$@{fs@}} is overridden in the map. This is done to avoid 199747501Spendrya clash between the mount tree and any other filesystem already mounted 199847501Spendryfrom the same fileserver. 199947501Spendry 200047501SpendryIf different mount options are needed for different hosts then 200147501Spendryadditional entries can be added to the map, for example 200247501Spendry 200347501Spendry@example 200447501Spendryhost2 opts:=ro,nosuid,soft 200547501Spendry@end example 200647501Spendry 200747501Spendry@noindent 200847501Spendrywould soft mount @samp{host2} read-only. 200947501Spendry 201047501Spendry@node Network Filesystem Group, Unix Filesystem, Network Host Filesystem, Filesystem Types 201147501Spendry@comment node-name, next, previous, up 201247501Spendry@section Network Filesystem Group (@samp{type:=nfsx}) 201347501Spendry@cindex Network filesystem group 201447501Spendry@cindex Atomic NFS mounts 201547501Spendry@cindex Mounting an atomic group of NFS filesystems 201647501Spendry@cindex How to mount an atomic group of NFS filesystems 201747501Spendry@cindex nfsx, filesystem type 201847501Spendry@cindex Filesystem type; nfsx 201947501Spendry 202047501SpendryThe @dfn{nfsx} filesystem allows a group of filesystems to be mounted 202147501Spendryfrom a single NFS server. The implementation is layered above the 202247501Spendry@samp{nfs} implementation so keep-alives work in the same way. 202347501Spendry 202447501SpendryThe options are the same as for the @samp{nfs} filesystem with one 202547501Spendrydifference. 202647501Spendry 202747501Spendry@noindent 202847501SpendryThe following options must be specified: 202947501Spendry 203047501Spendry@table @code 203147501Spendry@item rhost 203247501Spendrythe remote fileserver. This must be an entry in the hosts database. IP 203347501Spendryaddresses are not accepted. The default value is taken from the local 203447501Spendryhost name (@code{$@{host@}}) if no other value is specified. 203547501Spendry 203647501Spendry@item rfs 203747501Spendryas a list of filesystems to mount. The list is in the form of a comma 203847501Spendryseparated strings. 203947501Spendry@end table 204047501Spendry 204147501Spendry@noindent 204247501SpendryFor example: 204347501Spendry 204447501Spendry@example 2045*49684Spendrypub type:=nfsx;rhost:=gould;\ 2046*49684Spendry rfs:=/public,/,graphics,usenet;fs:=${autodir}/${rhost}/root 204747501Spendry@end example 204847501Spendry 204947501SpendryThe first string defines the root of the tree, and is applied as a 205047501Spendryprefix to the remaining members of the list which define the individual 205147501Spendryfilesystems. The first string is @emph{not} used as a filesystem name. 205247501SpendryA parallel operation is used to determine the local mount points to 205347501Spendryensure a consistent layout of a tree of mounts. 205447501Spendry 205547501SpendryHere, the @emph{three} filesystems, @samp{/public}, 205647501Spendry@samp{/public/graphics} and @samp{/public/usenet}, would be mounted.@refill 205747501Spendry 2058*49684SpendryA local mount point, @code{$@{fs@}}, @emph{must} be specified. The 2059*49684Spendrydefault local mount point will not work correctly in the general case. 2060*49684SpendryA suggestion is to use @samp{fs:=$@{autodir@}/$@{rhost@}/root}.@refill 2061*49684Spendry 206247501Spendry@node Unix Filesystem, Program Filesystem, Network Filesystem Group, Filesystem Types 206347501Spendry@comment node-name, next, previous, up 206447501Spendry@section Unix Filesystem (@samp{type:=ufs}) 206547501Spendry@cindex Unix filesystem 206647501Spendry@cindex UFS 206747501Spendry@cindex Mounting a UFS filesystem 206847501Spendry@cindex Mounting a local disk 206947501Spendry@cindex How to mount a UFS filesystems 207047501Spendry@cindex How to mount a local disk 207147501Spendry@cindex Disk filesystems 207247501Spendry@cindex ufs, filesystem type 207347501Spendry@cindex Filesystem type; ufs 207447501Spendry 207547501SpendryThe @dfn{ufs} filesystem type provides access to the system's 207647501Spendrystandard disk filesystem---usually a derivative of the Berkeley Fast Filesystem. 207747501Spendry 207847501Spendry@noindent 207947501SpendryThe following option must be specified: 208047501Spendry 208147501Spendry@table @code 208247501Spendry@cindex dev, mount option 208347501Spendry@cindex Mount option; dev 208447501Spendry@item dev 208547501Spendrythe block special device to be mounted. 208647501Spendry@end table 208747501Spendry 208847501SpendryA UFS entry might be: 208947501Spendry 209047501Spendry@example 209147501Spendryjsp host==charm;type:=ufs;dev:=/dev/xd0g;sublink:=jsp 209247501Spendry@end example 209347501Spendry 209447501Spendry@node Program Filesystem, Symbolic Link Filesystem, Unix Filesystem, Filesystem Types 209547501Spendry@comment node-name, next, previous, up 209647501Spendry@section Program Filesystem (@samp{type:=program}) 209747501Spendry@cindex Program filesystem 209847501Spendry@cindex Mount a filesystem under program control 209947501Spendry@cindex program, filesystem type 210047501Spendry@cindex Filesystem type; program 210147501Spendry 210247501SpendryThe @dfn{program} filesystem type allows a program to be run whenever a 210347501Spendrymount or unmount is required. This allows easy addition of support for 210447501Spendryother filesystem types, such as MIT's Remote Virtual Disk (RVD) 210547501Spendrywhich has a programmatic interface via the commands 210647501Spendry@samp{rvdmount} and @samp{rvdunmount}. 210747501Spendry 210847501Spendry@noindent 210947501SpendryThe following options must be specified: 211047501Spendry 211147501Spendry@table @code 211247501Spendry@cindex mount, mount option 211347501Spendry@cindex Mount option; mount 211447501Spendry@item mount 211547501Spendrythe program which will perform the mount. 211647501Spendry 211747501Spendry@cindex unmount, mount option 211847501Spendry@cindex Mount option; unmount 211947501Spendry@item unmount 212047501Spendrythe program which will perform the unmount. 212147501Spendry@end table 212247501Spendry 212347501SpendryThe exit code from these two programs is interpreted as a Unix error 212447501Spendrycode. As usual, exit code zero indicates success. To execute the 212547501Spendryprogram @i{Amd} splits the string on whitespace to create an array of 212647501Spendrysubstrings. Single quotes @samp{'} can be used to quote whitespace 212747501Spendryif that is required in an argument. There is no way to escape or change 212847501Spendrythe quote character. 212947501Spendry 213047501SpendryTo run the program @samp{rvdmount} with a host name and filesystem as 213147501Spendryarguments would be specified by @samp{mount:="/etc/rvdmount rvdmount 213247501Spendryfserver $@{path@}"}. 213347501Spendry 213447501SpendryThe first element in the array is taken as the pathname of the program 213547501Spendryto execute. The other members of the array form the argument vector to 213647501Spendrybe passed to the program, @dfn{including argument zero}. This means 213747501Spendrythat the split string must have at least two elements. The program is 213847501Spendrydirectly executed by @i{Amd}, not via a shell. This means that scripts 213947501Spendrymust begin with a @code{#!} interpreter specification. 214047501Spendry 214147501SpendryIf a filesystem type is to be heavily used, it may be worthwhile adding 214247501Spendrya new filesystem type into @i{Amd}, but for most uses the program 214347501Spendryfilesystem should suffice. 214447501Spendry 214547501SpendryWhen the program is run, standard input and standard error are inherited 214647501Spendryfrom the current values used by @i{Amd}. Standard output is a 214747501Spendryduplicate of standard error. The value specified with the ``-l'' 214847501Spendrycommand line option has no effect on standard error. 214947501Spendry 215047501Spendry@node Symbolic Link Filesystem, Automount Filesystem, Program Filesystem, Filesystem Types 215147501Spendry@comment node-name, next, previous, up 215247501Spendry@section Symbolic Link Filesystem (@samp{type:=link}) 215347501Spendry@cindex Symbolic link filesystem 215447501Spendry@cindex Referencing part of the local name space 215547501Spendry@cindex Mounting part of the local name space 215647501Spendry@cindex How to reference part of the local name space 215747501Spendry@cindex link, filesystem type 215847501Spendry@cindex symlink, link filesystem type 215947501Spendry@cindex Filesystem type; link 216047501Spendry 216147501SpendryEach filesystem type creates a symbolic link to point from the volume 216247501Spendryname to the physical mount point. The @samp{link} filesystem does the 216347501Spendrysame without any other side effects. This allows any part of the 216447501Spendrymachines name space to be accessed via @i{Amd}. 216547501Spendry 216647501SpendryOne common use for the symlink filesystem is @file{/homes} which can be 216747501Spendrymade to contain an entry for each user which points to their 216847501Spendry(auto-mounted) home directory. Although this may seem rather expensive, 216947501Spendryit provides a great deal of administrative flexibility. 217047501Spendry 217147501Spendry@noindent 217247501SpendryThe following option must be defined: 217347501Spendry 217447501Spendry@table @code 217547501Spendry@item fs 217647501SpendryThe value of @var{fs} option specifies the destination of the link, as 217747501Spendrymodified by the @var{sublink} option. If @var{sublink} is non-null, it 217847501Spendryis appended to @code{$@{fs@}}@code{/} and the resulting string is used 217947501Spendryas the target. 218047501Spendry@end table 218147501Spendry 218247501SpendryThe @samp{link} filesystem can be though of as identical to the 218347501Spendry@samp{ufs} filesystem but without actually mounting anything. 218447501Spendry 218547501SpendryAn example entry might be: 218647501Spendry 218747501Spendry@example 218847501Spendryjsp host==charm;type:=link;fs:=/home/charm;sublink:=jsp 218947501Spendry@end example 219047501Spendrywhich would return a symbolic link pointing to @file{/home/charm/jsp}. 219147501Spendry 219247501Spendry@node Automount Filesystem, Direct Automount Filesystem, Symbolic Link Filesystem, Filesystem Types 219347501Spendry@comment node-name, next, previous, up 219447501Spendry@section Automount Filesystem (@samp{type:=auto}) 219547501Spendry@cindex Automount filesystem 219647501Spendry@cindex Map cache types 219747501Spendry@cindex Setting map cache parameters 219847501Spendry@cindex How to set map cache parameters 219947501Spendry@cindex How to start an indirect automount point 220047501Spendry@cindex auto, filesystem type 220147501Spendry@cindex Filesystem type; auto 220247501Spendry@cindex SIGHUP signal 220347501Spendry@cindex Map cache synchronising 220447501Spendry@cindex Synchronising the map cache 220547501Spendry@cindex Map cache options 220647501Spendry@cindex Regular expressions in maps 220747501Spendry 220847501SpendryThe @dfn{auto} filesystem type creates a new automount point below an 220947501Spendryexisting automount point. Top-level automount points appear as system 221047501Spendrymount points. An automount mount point can also appear as a 221147501Spendrysub-directory of an existing automount point. This allows some 221247501Spendryadditional structure to be added, for example to mimic the mount tree of 221347501Spendryanother machine. 221447501Spendry 221547501SpendryThe following options may be specified: 221647501Spendry 221747501Spendry@table @code 221847501Spendry@cindex cache, mount option 221947501Spendry@cindex Mount option; cache 222047501Spendry@item cache 222147501Spendryspecifies whether the data in this mount-map should be 222247501Spendrycached. The default value is @samp{none}, in which case 222347501Spendryno caching is done in order to conserve memory. 222447501SpendryHowever, better performance and reliability can be obtained by caching 222547501Spendrysome or all of a mount-map. 222647501Spendry 222747501SpendryIf the cache option specifies @samp{all}, 222847501Spendrythe entire map is enumerated when the mount point is created. 222947501Spendry 223047501SpendryIf the cache option specifies @samp{inc}, caching is done incrementally 223147501Spendryas and when data is required. 223247501SpendrySome map types do not support cache mode @samp{all}, in which case @samp{inc} 223347501Spendryis used whenever @samp{all} is requested. 223447501Spendry 223547501SpendryCaching can be entirely disabled by using cache mode @samp{none}. 223647501Spendry 223747501SpendryIf the cache option specifies @samp{regexp} then the entire map will be 223847501Spendryenumerated and each key will be treated as an egrep-style regular 223947501Spendryexpression. The order in which a cached map is searched does not 224047501Spendrycorrespond to the ordering in the source map so the regular expressions 224147501Spendryshould be mutually exclusive to avoid confusion. 224247501Spendry 224347501SpendryEach mount map type has a default cache type, usually @samp{inc}, which 224447501Spendrycan be selected by specifying @samp{mapdefault}. 224547501Spendry 224647501SpendryThe cache mode for a mount map can only be selected on the command line. 224747501SpendryStarting @i{Amd} with the command: 224847501Spendry 224947501Spendry@example 225047501Spendryamd /homes hesiod.homes -cache:=inc 225147501Spendry@end example 225247501Spendry 225347501Spendrywill cause @samp{/homes} to be automounted using the @dfn{Hesiod} name 225447501Spendryserver with local incremental caching of all succesfully resolved names. 225547501Spendry 225647501SpendryAll cached data is forgotten whenever @i{Amd} receives a @samp{SIGHUP} 225747501Spendrysignal and, if cache @samp{all} mode was selected, the cache will be 225847501Spendryreloaded. This can be used to inform @i{Amd} that a map has been 225947501Spendryupdated. In addition, whenever a cache lookup fails and @i{Amd} needs 226047501Spendryto examine a map, the map's modify time is examined. If the cache is 226147501Spendryout of date with respect to the map then it is flushed as if a 226247501Spendry@samp{SIGHUP} had been received. 226347501Spendry 226447501SpendryAn additional option (@samp{sync}) may be specified to force @i{Amd} to 226547501Spendrycheck the map's modify time whenever a cached entry is being used. For 226647501Spendryexample, an incremental, synchronised cache would be created by the 226747501Spendryfollowing command: 226847501Spendry 226947501Spendry@example 227047501Spendryamd /homes hesiod.homes -cache:=inc,sync 227147501Spendry@end example 227247501Spendry 227347501Spendry@item fs 227447501Spendryspecifies the name of the mount map to use for the new mount point. 227547501Spendry 227647501SpendryArguably this should have been specified with the @code{$@{rfs@}} option but 227747501Spendrywe are now stuck with it due to historical accident. 227847501Spendry 227947501Spendry@c %If the string @samp{.} is used then the same map is used; 228047501Spendry@c %in addition the lookup prefix is set to the name of the mount point followed 228147501Spendry@c %by a slash @samp{/}. 228247501Spendry@c %This is the same as specifying @samp{fs:=\$\{map\};pref:=\$\{key\}/}. 228347501Spendry@c 228447501Spendry 228547501Spendry@item pref 228647501Spendryalters the name that is looked up in the mount map. If 228747501Spendry@code{$@{pref@}}, the @dfn{prefix}, is non-null then it is prepended to 228847501Spendrythe name requested by the kernel @dfn{before} the map is searched. 228947501Spendry@end table 229047501Spendry 229147501SpendryThe server @samp{dylan.doc.ic.ac.uk} has two user disks: 229247501Spendry@samp{/dev/dsk/2s0} and @samp{/dev/dsk/5s0}. These are accessed as 229347501Spendry@samp{/home/dylan/dk2} and @samp{/home/dylan/dk5} respectively. Since 229447501Spendry@samp{/home} is already an automount point, this naming is achieved with 229547501Spendrythe following map entries:@refill 229647501Spendry 229747501Spendry@example 229847501Spendrydylan type:=auto;fs:=$@{map@};pref:=$@{key@}/ 229947501Spendrydylan/dk2 type:=ufs;dev:=/dev/dsk/2s0 230047501Spendrydylan/dk5 type:=ufs;dev:=/dev/dsk/5s0 230147501Spendry@end example 230247501Spendry 230347501Spendry@node Direct Automount Filesystem, Union Filesystem, Automount Filesystem, Filesystem Types 230447501Spendry@comment node-name, next, previous, up 230547501Spendry@section Direct Automount Filesystem (@samp{type:=direct}) 230647501Spendry@cindex Direct automount filesystem 230747501Spendry@cindex How to start a direct automount point 230847501Spendry@cindex direct, filesystem type 230947501Spendry@cindex Filesystem type; direct 231047501Spendry 231147501SpendryThe @dfn{direct} filesystem is almost identical to the automount 231247501Spendryfilesystem. Instead of appearing to be a directory of mount points, it 231347501Spendryappears as a symbolic link to a mounted filesystem. The mount is done 231447501Spendryat the time the link is accessed. @xref{Automount Filesystem} for a 231547501Spendrylist of required options. 231647501Spendry 231747501SpendryDirect automount points are created by specifying the @samp{direct} 231847501Spendryfilesystem type on the command line: 231947501Spendry 232047501Spendry@example 232147501Spendryamd ... /usr/man auto.direct -type:=direct 232247501Spendry@end example 232347501Spendry 232447501Spendrywhere @samp{auto.direct} would contain an entry such as: 232547501Spendry 232647501Spendry@example 232747501Spendryusr/man -type:=nfs;rfs:=/usr/man \ 232847501Spendry rhost:=man-server1 rhost:=man-server2 232947501Spendry@end example 233047501Spendry 233147501SpendryIn this example, @samp{man-server1} and @samp{man-server2} are file 233247501Spendryservers which export copies of the manual pages. Note that the key 233347501Spendrywhich is looked up is the name of the automount point without the 233447501Spendryleading @samp{/}. 233547501Spendry 233647501Spendry@node Union Filesystem, Error Filesystem, Direct Automount Filesystem, Filesystem Types 233747501Spendry@comment node-name, next, previous, up 233847501Spendry@section Union Filesystem (@samp{type:=union}) 233947501Spendry@cindex Union filesystem 234047501Spendry@cindex union, filesystem type 234147501Spendry@cindex Filesystem type; union 234247501Spendry 234347501SpendryThe @dfn{union} filesystem type allows the contents of several 234447501Spendrydirectories to be merged and made visible in a single directory. This 234547501Spendrycan be used to overcome one of the major limitations of the Unix mount 234647501Spendrymechanism which only allows complete directories to be mounted. 234747501Spendry 234847501SpendryFor example, supposing @file{/tmp} and @file{/var/tmp} were to be merged 234947501Spendryinto a new directory called @file{/mtmp}, with files in @file{/var/tmp} 235047501Spendrytaking precedence. The following command could be used to achieve this 235147501Spendryeffect: 235247501Spendry 235347501Spendry@example 235447501Spendryamd ... /mtmp union:/tmp:/var/tmp -type:=union 235547501Spendry@end example 235647501Spendry 235747501SpendryCurrently, the unioned directories must @emph{not} be automounted. That 235847501Spendrywould cause a deadlock. This seriously limits the current usefulness of 235947501Spendrythis filesystem type and the problem will be addressed in a future 236047501Spendryrelease of @i{Amd}. 236147501Spendry 236247501SpendryFiles created in the union directory are actually created in the last 236347501Spendrynamed directory. This is done by creating a wildcard entry which points 236447501Spendryto the correct directory. The wildcard entry is visible if the union 236547501Spendrydirectory is listed, so allowing you to see which directory has 236647501Spendrypriority. 236747501Spendry 236847501SpendryThe files visible in the union directory are computed at the time 236947501Spendry@i{Amd} is started, and are not kept uptodate with respect to the 237047501Spendryunderlying directories. Similarly, if a link is removed, for example 237147501Spendrywith the @samp{rm} command, it will be lost forever. 237247501Spendry 237347501Spendry@node Error Filesystem, Top-level Filesystem, Direct Automount Filesystem, Filesystem Types 237447501Spendry@comment node-name, next, previous, up 237547501Spendry@section Error Filesystem (@samp{type:=error}) 237647501Spendry@cindex Error filesystem 237747501Spendry@cindex error, filesystem type 237847501Spendry@cindex Filesystem type; error 237947501Spendry 238047501SpendryThe @dfn{error} filesystem type is used internally as a catch-all in 238147501Spendrythe case where none of the other filesystems was selected, or some other 238247501Spendryerror occurred. 238347501SpendryLookups and mounts always fail with ``No such file or directory''. 238447501SpendryAll other operations trivially succeed. 238547501Spendry 238647501SpendryThe error filesystem is not directly accessible. 238747501Spendry 238847501Spendry@node Top-level Filesystem, Root Filesystem, Error Filesystem, Filesystem Types 238947501Spendry@comment node-name, next, previous, up 239047501Spendry@section Top-level Filesystem (@samp{type:=toplvl}) 239147501Spendry@cindex Top level filesystem 239247501Spendry@cindex toplvl, filesystem type 239347501Spendry@cindex Filesystem type; toplvl 239447501Spendry 239547501SpendryThe @dfn{toplvl} filesystems is derived from the @samp{auto} filesystem 239647501Spendryand is used to mount the top-level automount nodes. Requests of this 239747501Spendrytype are automatically generated from the command line arguments and 239847501Spendrycan also be passed in by using the ``-M'' option of the @dfn{Amq} command. 239947501Spendry 240047501Spendry@node Root Filesystem, Inheritance Filesystem, Top-level Filesystem, Filesystem Types 240147501Spendry@comment node-name, next, previous, up 240247501Spendry@section Root Filesystem 240347501Spendry@cindex Root filesystem 240447501Spendry@cindex root, filesystem type 240547501Spendry@cindex Filesystem type; root 240647501Spendry 240747501SpendryThe @dfn{root} (@samp{type:=root}) filesystem type acts as an internal 240847501Spendryplaceholder onto which @i{Amd} can pin @samp{toplvl} mounts. Only one 240947501Spendrynode of this type need ever exist and one is created automatically 241047501Spendryduring startup. The effect of creating a second root node is undefined. 241147501Spendry 241247501Spendry@node Inheritance Filesystem, , Root Filesystem, Filesystem Types 241347501Spendry@comment node-name, next, previous, up 241447501Spendry@section Inheritance Filesystem 241547501Spendry@cindex Inheritance filesystem 241647501Spendry@cindex Nodes generated on a restart 241747501Spendry@cindex inherit, filesystem type 241847501Spendry@cindex Filesystem type; inherit 241947501Spendry 242047501SpendryThe @dfn{inheritance} (@samp{type:=inherit}) filesystem is not directly 242147501Spendryaccessible. Instead, internal mount nodes of this type are 242247501Spendryautomatically generated when @i{Amd} is started with the ``-r'' option. 242347501SpendryAt this time the system mount table is scanned to locate any filesystems 242447501Spendrywhich are already mounted. If any reference to these filesystems is 242547501Spendrymade through @i{Amd} then instead of attempting to mount it, @i{Amd} 242647501Spendrysimulates the mount and @dfn{inherits} the filesystem. This allows a 242747501Spendrynew version of @i{Amd} to be installed on a live system simply by 242847501Spendrykilling the old daemon with @code{SIGTERM} and starting the new one.@refill 242947501Spendry 243047501SpendryThis filesystem type is not generally visible externally, but it is 243147501Spendrypossible that the output from @samp{amq -m} may list @samp{inherit} as 243247501Spendrythe filesystem type. This happens when an inherit operation cannot 243347501Spendrybe completed for some reason, usually because a fileserver is down. 243447501Spendry 243547501Spendry@node Run-time Administration, Examples, Filesystem Types, Top 243647501Spendry@comment node-name, next, previous, up 243747501Spendry@chapter Run-time Administration 243847501Spendry@cindex Run-time administration 243947501Spendry@cindex Amq command 244047501Spendry 244147501Spendry@menu 244247501Spendry* Starting Amd:: 244347501Spendry* Stopping Amd:: 244447501Spendry* Controlling Amd:: 244547501Spendry@end menu 244647501Spendry 244747501Spendry@node Starting Amd, Stopping Amd, Run-time Administration, Run-time Administration 244847501Spendry@comment node-name, next, previous, up 244947501Spendry@section Starting @i{Amd} 245047501Spendry@cindex Starting Amd 245147501Spendry@cindex Additions to /etc/rc.local 245247501Spendry@cindex /etc/rc.local additions 245347501Spendry@cindex /etc/amd.start 245447501Spendry 245547501Spendry@i{Amd} is best started from @samp{/etc/rc.local}: 245647501Spendry 245747501Spendry@example 245847501Spendryif [ -f /etc/amd.start ]; then 245947501Spendry sh /etc/amd.start; (echo -n ' amd') >/dev/console 246047501Spendryfi 246147501Spendry@end example 246247501Spendry 246347501Spendry@noindent 246447501SpendryThe shell script, @samp{amd.start}, contains: 246547501Spendry 246647501Spendry@example 246747501Spendry#!/bin/sh - 246847501SpendryPATH=/etc:/bin:/usr/bin:/usr/ucb:$PATH export PATH 246947501Spendry 247047501Spendry# 247147501Spendry# Either name of logfile or "syslog" 247247501Spendry# 247347501SpendryLOGFILE=syslog 247447501Spendry#LOGFILE=/var/log/amd 247547501Spendry 247647501Spendry# 247747501Spendry# Figure out whether domain name is in host name 247847501Spendry# If the hostname is just the machine name then 247947501Spendry# pass in the name of the local domain so that the 248047501Spendry# hostnames in the map are domain stripped correctly. 248147501Spendry# 248247501Spendrycase `hostname` in 248347501Spendry*.*) dmn= ;; 248447501Spendry*) dmn='-d doc.ic.ac.uk' 248547501Spendryesac 248647501Spendry 248747501Spendry# 248847501Spendry# Zap earlier log file 248947501Spendry# 249047501Spendrycase "$LOGFILE" in 249147501Spendry*/*) 249247501Spendry mv "$LOGFILE" "$LOGFILE"- 249347501Spendry > "$LOGFILE" 249447501Spendry ;; 249547501Spendrysyslog) 249647501Spendry : nothing 249747501Spendry ;; 249847501Spendryesac 249947501Spendry 250047501Spendrycd /usr/sbin 250147501Spendry# 250247501Spendry# -r restart 250347501Spendry# -d dmn local domain 250447501Spendry# -w wait wait between unmount attempts 250547501Spendry# -l log logfile or "syslog" 250647501Spendry# 250747501Spendryeval ./amd -r $dmn -w 240 -l "$LOGFILE" \ 250847501Spendry /homes amd.homes -cache:=inc \ 250947501Spendry /home amd.home -cache:=inc \ 251047501Spendry /vol amd.vol -cache:=inc \ 251147501Spendry /n amd.net -cache:=inc 251247501Spendry@end example 251347501Spendry 251447501SpendryIf the list of automount points and maps is contained in a file or NIS map 251547501Spendryit is easily incorporated onto the command line: 251647501Spendry 251747501Spendry@example 251847501Spendry... 251947501Spendryeval ./amd -r $dmn -w 240 -l "$LOGFILE" `ypcat -k auto.master` 252047501Spendry@end example 252147501Spendry 252247501Spendry@node Stopping Amd, Controlling Amd, Starting Amd, Run-time Administration 252347501Spendry@comment node-name, next, previous, up 252447501Spendry@section Stopping @i{Amd} 252547501Spendry@cindex Stopping Amd 252647501Spendry@cindex SIGTERM signal 252747501Spendry@cindex SIGINT signal 252847501Spendry 252947501Spendry@i{Amd} stops in response to two signals. 253047501Spendry 253147501Spendry@table @samp 253247501Spendry@item SIGTERM 253347501Spendrycauses the top-level automount points to be unmounted and then @i{Amd} 253447501Spendryto exit. Any automounted filesystems are left mounted. They can be 253547501Spendryrecovered by restarting @i{Amd} with the ``-r'' command line option.@refill 253647501Spendry 253747501Spendry@item SIGINT 253847501Spendrycauses @i{Amd} to attempt to unmount any filesystems which it has 253947501Spendryautomounted, in addition to the actions of @samp{SIGTERM}. This signal 254047501Spendryis primarly used for debugging.@refill 254147501Spendry@end table 254247501Spendry 254347501SpendryActions taken for other signals are undefined. 254447501Spendry 254547501Spendry@node Controlling Amd, Run-time Administration, Stopping Amd, Run-time Administration 254647501Spendry@comment node-name, next, previous, up 254747501Spendry@section Controlling @i{Amd} 254847501Spendry@cindex Controlling Amd 254947501Spendry@cindex Discovering what is going on at run-time 255047501Spendry@cindex Listing currently mounted filesystems 255147501Spendry 255247501SpendryIt is sometimes desirable or necessary to exercise external control 255347501Spendryover some of @i{Amd}'s internal state. To support this requirement, 255447501Spendry@i{Amd} implements an RPC interface which is used by the @dfn{Amq} program. 255547501SpendryA variety of information is available. 255647501Spendry 255747501Spendry@i{Amq} generally applies an operation, specified by a single letter option, 255847501Spendryto a list of mount points. The default operation is to obtain statistics 255947501Spendryabout each mount point. This is similar to the output shown above 256047501Spendrybut includes information about the number and type of accesses to each 256147501Spendrymount point. 256247501Spendry 256347501Spendry@menu 256447501Spendry* Amq default:: Default command behaviour. 256547501Spendry* Amq -f option:: Flusing the map cache. 256647501Spendry* Amq -h option:: Controlling a non-local host. 256747501Spendry* Amq -m option:: Obtaining mount statistics. 256847501Spendry* Amq -M-option:: Mounting a volume. 256947501Spendry* Amq -s option:: Obtaining global statistics. 257047501Spendry* Amq -u option:: Forcing volumes to time out. 257147501Spendry* Amq -v option:: Version information. 257247501Spendry@end menu 257347501Spendry 257447501Spendry@node Amq default, Amq -f option, Controlling Amd, Controlling Amd 257547501Spendry@comment node-name, next, previous, up 257647501Spendry@subsection @i{Amq} default information 257747501Spendry 257847501SpendryWith no arguments, @dfn{Amq} obtains a brief list of all existing 257947501Spendrymounts created by @i{Amd}. This is different from the list displayed by 258047501Spendry@b{df}(1) since the latter only includes system mount points. 258147501Spendry 258247501Spendry@noindent 258347501SpendryThe output from this option includes the following information: 258447501Spendry 258547501Spendry@itemize @bullet 258647501Spendry@item 258747501Spendrythe automount point, 258847501Spendry@item 258947501Spendrythe filesystem type, 259047501Spendry@item 259147501Spendrythe mount map or mount information, 259247501Spendry@item 259347501Spendrythe internal, or system mount point. 259447501Spendry@end itemize 259547501Spendry 259647501Spendry@noindent 259747501SpendryFor example: 259847501Spendry 259947501Spendry@example 260047501Spendry/ root "root" sky:(pid75) 260147501Spendry/homes toplvl /usr/local/etc/amd.homes /homes 260247501Spendry/home toplvl /usr/local/etc/amd.home /home 260347501Spendry/homes/jsp nfs charm:/home/charm /a/charm/home/charm/jsp 260447501Spendry/homes/phjk nfs toytown:/home/toytown /a/toytown/home/toytown/ai/phjk 260547501Spendry@end example 260647501Spendry 260747501Spendry@noindent 260847501SpendryIf an argument is given then statistics for that volume name will 260947501Spendrybe output. For example: 261047501Spendry 261147501Spendry@example 261247501SpendryWhat Uid Getattr Lookup RdDir RdLnk Statfs Mounted@@ 261347501Spendry/homes 0 1196 512 22 0 30 90/09/14 12:32:55 261447501Spendry/homes/jsp 0 0 0 0 1180 0 90/10/13 12:56:58 261547501Spendry@end example 261647501Spendry 261747501Spendry@table @code 261847501Spendry@item What 261947501Spendrythe volume name. 262047501Spendry 262147501Spendry@item Uid 262247501Spendryignored. 262347501Spendry 262447501Spendry@item Getattr 262547501Spendrythe count of NFS @dfn{getattr} requests on this node. This should only be 262647501Spendrynon-zero for directory nodes. 262747501Spendry 262847501Spendry@item Lookup 262947501Spendrythe count of NFS @dfn{lookup} requests on this node. This should only be 263047501Spendrynon-zero for directory nodes. 263147501Spendry 263247501Spendry@item RdDir 263347501Spendrythe count of NFS @dfn{readdir} requests on this node. This should only 263447501Spendrybe non-zero for directory nodes. 263547501Spendry 263647501Spendry@item RdLnk 263747501Spendrythe count of NFS @dfn{readlink} requests on this node. This should be 263847501Spendryzero for directory nodes. 263947501Spendry 264047501Spendry@item Statfs 264147501Spendrythe could of NFS @dfn{statfs} requests on this node. This should only 264247501Spendrybe non-zero for top-level automount points. 264347501Spendry 264447501Spendry@item Mounted@@ 264547501Spendrythe date and time the volume name was first referenced. 264647501Spendry@end table 264747501Spendry 264847501Spendry@node Amq -f option, Amq -h option, Amq default, Controlling Amd 264947501Spendry@comment node-name, next, previous, up 265047501Spendry@subsection @i{Amq} -f option 265147501Spendry@cindex Flushing the map cache 265247501Spendry@cindex Map cache, flushing 265347501Spendry 265447501SpendryThe ``-f'' option causes @i{Amd} to flush the internal mount map cache. 265547501SpendryThis is useful for Hesiod maps since @i{Amd} will not automatically 265647501Spendrynotice when they have been updated. The map cache can also be 265747501Spendrysynchronised with the map source by using the @samp{sync} option 265847501Spendry(@pxref{Automount Filesystem}).@refill 265947501Spendry 266047501Spendry@node Amq -h option, Amq -m option, Amq -f option, Controlling Amd 266147501Spendry@comment node-name, next, previous, up 266247501Spendry@subsection @i{Amq} -h option 266347501Spendry@cindex Querying an alternate host 266447501Spendry 266547501SpendryBy default the local host is used. In an HP-UX cluster the root server 266647501Spendryis used since that is the only place in the cluster where @i{Amd} will 266747501Spendrybe running. To query @i{Amd} on another host the ``-h'' option should 266847501Spendrybe used. 266947501Spendry 267047501Spendry@node Amq -m option, Amq -M-option, Amq -h option, Controlling Amd 267147501Spendry@comment node-name, next, previous, up 267247501Spendry@subsection @i{Amq} -m option 267347501Spendry 267447501SpendryThe ``-m'' option displays similar information about mounted 267547501Spendryfilesystems, rather than automount points. The output includes the 267647501Spendryfollowing information: 267747501Spendry 267847501Spendry@itemize @bullet 267947501Spendry@item 268047501Spendrythe mount information, 268147501Spendry@item 268247501Spendrythe mount point, 268347501Spendry@item 268447501Spendrythe filesystem type, 268547501Spendry@item 268647501Spendrythe number of references to this filesystem, 268747501Spendry@item 268847501Spendrythe server hostname, 268947501Spendry@item 269047501Spendrythe state of the file server, 269147501Spendry@item 269247501Spendryany error which has occured. 269347501Spendry@end itemize 269447501Spendry 269547501SpendryFor example: 269647501Spendry 269747501Spendry@example 269847501Spendry"root" truth:(pid602) root 1 localhost is up 269947501Spendryhesiod.home /home toplvl 1 localhost is up 270047501Spendryhesiod.vol /vol toplvl 1 localhost is up 270147501Spendryhesiod.homes /homes toplvl 1 localhost is up 270247501Spendryamy:/home/amy /a/amy/home/amy nfs 5 amy is up 270347501Spendryswan:/home/swan /a/swan/home/swan nfs 0 swan is up (Permission denied) 270447501Spendryex:/home/ex /a/ex/home/ex nfs 0 ex is down 270547501Spendry@end example 270647501Spendry 270747501SpendryWhen the reference count is zero the filesystem is not mounted but 270847501Spendrythe mount point and server information is still being maintained 270947501Spendryby @i{Amd}. 271047501Spendry 271147501Spendry@node Amq -M-option, Amq -s option, Amq -m option, Controlling Amd 271247501Spendry@comment node-name, next, previous, up 271347501Spendry@subsection @i{Amq} -M option 271447501Spendry 271547501SpendryThe ``-M'' option passes a new map entry to @i{Amd} and waits for it to 271647501Spendrybe evaluated, possibly causing a mount. For example, the following 271747501Spendrycommand would cause @samp{/home/toytown} on host @samp{toytown} to be 271847501Spendrymounted locally on @samp{/mnt/toytown}. 271947501Spendry 272047501Spendry@example 272147501Spendryamq -M '/mnt/toytown type:=nfs;rfs:=/home/toytown;rhost:=toytown;fs:=$@{key@}' 272247501Spendry@end example 272347501Spendry 272447501Spendry@i{Amd} applies some simple security checks before allowing this 272547501Spendryoperation. The check tests whether the incoming request is from a 272647501Spendryprivileged UDP port on the local machine. ``Permission denied'' is 272747501Spendryreturned if the check fails. 272847501Spendry 272947501SpendryA future release of @i{Amd} will include code to allow the @b{mount}(8) 273047501Spendrycommand to mount automount points: 273147501Spendry 273247501Spendry@example 273347501Spendrymount -t amd /vol hesiod.vol 273447501Spendry@end example 273547501Spendry 273647501SpendryThis will then allow @i{Amd} to be controlled from the standard system 273747501Spendryfilesystem mount list. 273847501Spendry 273947501Spendry@node Amq -s option, Amq -u option, Amq -M-option, Controlling Amd 274047501Spendry@comment node-name, next, previous, up 274147501Spendry@subsection @i{Amq} -s option 274247501Spendry@cindex Global statistics 274347501Spendry@cindex Statistics 274447501Spendry 274547501SpendryThe ``-s'' option displays global statistics. If any other options are specified 274647501Spendryor any filesystems named then this option is ignored. For example: 274747501Spendry 274847501Spendry@example 274947501Spendryrequests stale mount mount unmount 275047501Spendrydeferred fhandles ok failed failed 275147501Spendry1054 1 487 290 7017 275247501Spendry@end example 275347501Spendry 275447501Spendry@table @samp 275547501Spendry@item Deferred requests 275647501Spendryare those for which an immediate reply could not be constructed. For 275747501Spendryexample, this would happen if a background mount was required. 275847501Spendry 275947501Spendry@item Stale filehandles 276047501Spendrycounts the number of times the kernel passes a stale filehandle to @i{Amd}. 276147501SpendryLarge numbers indicate problems. 276247501Spendry 276347501Spendry@item Mount ok 276447501Spendrycounts the number of automounts which were successful. 276547501Spendry 276647501Spendry@item Mount failed 276747501Spendrycounts the number of automounts which failed. 276847501Spendry 276947501Spendry@item Unmount failed 277047501Spendrycounts the number of times a filesystem could not be unmounted. Very 277147501Spendrylarge numbers here indicate that the time between unmount attempts 277247501Spendryshould be increased. 277347501Spendry@end table 277447501Spendry 277547501Spendry@node Amq -u option, Amq -v option, Amq -s option, Controlling Amd 277647501Spendry@comment node-name, next, previous, up 277747501Spendry@subsection @i{Amq} -u option 277847501Spendry@cindex Forcing filesystem to time out 277947501Spendry@cindex Unmounting a filesystem 278047501Spendry 278147501SpendryThe ``-u'' option causes the time-to-live interval of the named mount 278247501Spendrypoints to be expired, thus causing an unmount attempt. This is the only 278347501Spendrysafe way to unmount an automounted filesystem. It is not possible to 278447501Spendryunmount a filesystem which has been mounted with the @samp{nounmount} 278547501Spendryflag. 278647501Spendry 278747501Spendry@c The ``-H'' option informs @i{Amd} that the specified mount point has hung - 278847501Spendry@c as if its keepalive timer had expired. 278947501Spendry 279047501Spendry@node Amq -v option, Other Amq options, Amq -u option, Controlling Amd 279147501Spendry@comment node-name, next, previous, up 279247501Spendry@subsection @i{Amq} -v option 279347501Spendry@cindex Version information at run-time 279447501Spendry 279547501SpendryThe ``-v'' option displays the version of @i{Amd} in a similar way to 279647501Spendry@i{Amd}'s ``-v'' option. 279747501Spendry 279847501Spendry@node Other Amq options, Controlling Amd, Amq -v option, Controlling Amd 279947501Spendry@comment node-name, next, previous, up 280047501Spendry@subsection Other @i{Amq} options 280147501Spendry 280247501SpendryThree other operations are implemented. These modify the state of 280347501Spendry@i{Amd} as a whole, rather than any particular filesystem. The ``-l'', 280447501Spendry``-x'' and ``-D'' options have exactly the same effect as @i{Amd}'s 280547501Spendrycorresponding command line options. The ``-l'' option is rejected by 280647501Spendry@i{Amd} in the current version for obvious security reasons. When 280747501Spendry@i{Amd} receives a ``-x''flag it limits the log options being modified 280847501Spendryto those which were not enabled at startup. This prevents a user 280947501Spendryturning @emph{off} any logging option which was specified at startup, 281047501Spendrythough any which have been turned off since then can still be turned 281147501Spendryoff. The ``-D'' option has a similar behaviour. 281247501Spendry 281347501Spendry@node FSinfo, Examples, Run-time Administration, Top 281447501Spendry@comment node-name, next, previous, up 281547501Spendry@chapter FSinfo 281647501Spendry@cindex FSinfo 281747501Spendry@cindex Filesystem info package 281847501Spendry 281947501Spendry@menu 282047501Spendry* FSinfo Overview:: Introduction to FSinfo. 282147501Spendry* Using FSinfo:: Basic concepts. 282247501Spendry* FSinfo Grammar:: Language syntax, semantics and examples. 282347501Spendry* FSinfo host definitions:: Defining a new host. 282447501Spendry* FSinfo host attributes:: Definable host attributes. 282547501Spendry* FSinfo filesystems:: Defining locally attached filesystems. 282647501Spendry* FSinfo static mounts:: Defining additional static mounts. 282747501Spendry* FSinfo automount definitions:: 282847501Spendry* FSinfo command line options:: 282947501Spendry* FSinfo errors:: 283047501Spendry@end menu 283147501Spendry 283247501Spendry@node FSinfo Overview, Using FSinfo, FSinfo, FSinfo 283347501Spendry@comment node-name, next, previous, up 283447501Spendry@section @i{FSinfo} overview 283547501Spendry@cindex FSinfo overview 283647501Spendry 283747501Spendry@i{FSinfo} is a filesystem management tool. It has been designed to 283847501Spendrywork with @i{Amd} to help system administrators keep track of the ever 283947501Spendryincreasing filesystem namespace under their control. 284047501Spendry 284147501SpendryThe purpose of @i{FSinfo} is to generate all the important standard 284247501Spendryfilesystem data files from a single set of input data. Starting with a 284347501Spendrysingle data source guarantees that all the generated files are 284447501Spendryself-consistent. One of the possible output data formats is a set of 284547501Spendry@i{Amd} maps which can be used amongst the set of hosts described in the 284647501Spendryinput data. 284747501Spendry 284847501Spendry@i{FSinfo} implements a declarative language. This language is 284947501Spendryspecifically designed for describing filesystem namespace and physical 285047501Spendrylayouts. The basic declaration defines a mounted filesystem including 285147501Spendryits device name, mount point, and all the volumes and access 285247501Spendrypermissions. @i{FSinfo} reads this information and builds an internal 285347501Spendrymap of the entire network of hosts. Using this map, many different data 285447501Spendryformats can be produced including @file{/etc/fstab}, 285547501Spendry@file{/etc/exports}, @i{Amd} mount maps and 285647501Spendry@file{/etc/bootparams}.@refill 285747501Spendry 285847501Spendry@node Using FSinfo, FSinfo Grammar, FSinfo Overview, FSinfo 285947501Spendry@comment node-name, next, previous, up 286047501Spendry@section Using @i{FSinfo} 286147501Spendry@cindex Using FSinfo 286247501Spendry 286347501SpendryThe basic strategy when using @i{FSinfo} is to gather all the 286447501Spendryinformation about all disks on all machines into one set of 286547501Spendrydeclarations. For each machine being managed, the following data is 286647501Spendryrequired: 286747501Spendry 286847501Spendry@itemize @bullet 286947501Spendry@item 287047501SpendryHostname 287147501Spendry@item 287247501SpendryList of all filesystems and, optionally, their mount points. 287347501Spendry@item 287447501SpendryNames of volumes stored on each filesystem. 287547501Spendry@item 287647501SpendryNFS export information for each volume. 287747501Spendry@item 287847501SpendryThe list of static filesystem mounts. 287947501Spendry@end itemize 288047501Spendry 288147501SpendryThe following information can also be entered into the same 288247501Spendryconfiguration files so that all data can be kept in one place. 288347501Spendry 288447501Spendry@itemize @bullet 288547501Spendry@item 288647501SpendryList of network interfaces 288747501Spendry@item 288847501SpendryIP address of each interface 288947501Spendry@item 289047501SpendryHardware address of each interface 289147501Spendry@item 289247501SpendryDumpset to which each filesystem belongs 289347501Spendry@item 289447501Spendryand more @dots{} 289547501Spendry@end itemize 289647501Spendry 289747501SpendryTo generate @i{Amd} mount maps, the automount tree must also be defined 289847501Spendry(@pxref{FSinfo automount definitions}). This will have been designed at 289947501Spendrythe time the volume names were allocated. Some volume names will not be 290047501Spendryautomounted, so @i{FSinfo} needs an explicit list of which volumes 290147501Spendryshould be automounted.@refill 290247501Spendry 290347501SpendryHostnames are required at several places in the @i{FSinfo} language. It 290447501Spendryis important to stick to either fully qualified names or unqualified 290547501Spendrynames. Using a mixture of the two will inevitably result in confusion. 290647501Spendry 290747501SpendrySometimes volumes need to be referenced which are not defined in the set 290847501Spendryof hosts being managed with @i{FSinfo}. The required action is to add a 290947501Spendrydummy set of definitions for the host and volume names required. Since 291047501Spendrythe files generated for those particular hosts will not be used on them, 291147501Spendrythe exact values used is not critical. 291247501Spendry 291347501Spendry@node FSinfo Grammar, FSinfo, Using FSinfo, FSinfo 291447501Spendry@comment node-name, next, previous, up 291547501Spendry@section @i{FSinfo} grammar 291647501Spendry@cindex FSinfo grammar 291747501Spendry@cindex Grammar, FSinfo 291847501Spendry 291947501Spendry@i{FSinfo} has a relatively simple grammar. Distinct syntactic 292047501Spendryconstructs exist for each of the different types of data, though they 292147501Spendryshare a common flavour. Several conventions are used in the grammar 292247501Spendryfragments below. 292347501Spendry 292447501SpendryThe notation, @i{list(}@t{xxx}@i{)}, indicates a list of zero or more 292547501Spendry@t{xxx}'s. The notation, @i{opt(}@t{xxx}@i{)}, indicates zero or one 292647501Spendry@t{xxx}. Items in double quotes, @i{eg} @t{"host"}, represent input 292747501Spendrytokens. Items in angle brackets, @i{eg} @var{<hostname>}, represent 292847501Spendrystrings in the input. Strings need not be in double quotes, except to 292947501Spendrydifferentiate them from reserved words. Quoted strings may include the 293047501Spendryusual set of C ``@t{\}'' escape sequences with one exception: a 293147501Spendrybackslash-newline-whitespace sequence is squashed into a single space 293247501Spendrycharacter. To defeat this feature, put a further backslash at the start 293347501Spendryof the second line. 293447501Spendry 293547501SpendryAt the outermost level of the grammar, the input consists of a 293647501Spendrysequence of host and automount declarations. These declarations are 293747501Spendryall parsed before they are analyzed. This means they can appear in 293847501Spendryany order and cyclic host references are possible. 293947501Spendry 294047501Spendry@example 294147501Spendryfsinfo : @i{list(}fsinfo_attr@i{)} ; 294247501Spendry 294347501Spendryfsinfo_attr : host | automount ; 294447501Spendry@end example 294547501Spendry 294647501Spendry@menu 294747501Spendry* FSinfo host definitions:: 294847501Spendry* FSinfo automount definitions:: 294947501Spendry@end menu 295047501Spendry 295147501Spendry@node FSinfo host definitions, FSinfo host attributes, FSinfo grammar, FSinfo 295247501Spendry@comment node-name, next, previous, up 295347501Spendry@section @i{FSinfo} host definitions 295447501Spendry@cindex FSinfo host definitions 295547501Spendry@cindex Defining a host, FSinfo 295647501Spendry 295747501SpendryA host declaration consists of three parts: a set of machine attribute 295847501Spendrydata, a list of filesystems physically attached to the machine, and a 295947501Spendrylist of additional statically mounted filesystems. 296047501Spendry 296147501Spendry@example 296247501Spendryhost : "host" host_data @i{list(}filesystem@i{@i{)}} @i{list(}mount@i{@i{)}} ; 296347501Spendry@end example 296447501Spendry 296547501SpendryEach host must be declared in this way exactly once. Such things as the 296647501Spendryhardware address, the architecture and operating system types and the 296747501Spendrycluster name are all specified within the @dfn{host data}. 296847501Spendry 296947501SpendryAll the disks the machine has should then be described in the @dfn{list 297047501Spendryof filesystems}. When describing disks, you can specify what 297147501Spendry@dfn{volname} the disk/partition should have and all such entries are 297247501Spendrybuilt up into a dictionary which can then be used for building the 297347501Spendryautomounter maps. 297447501Spendry 297547501SpendryThe @dfn{list of mounts} specifies all the filesystems that should be 297647501Spendrystatically mounted on the machine. 297747501Spendry 297847501Spendry@menu 297947501Spendry* FSinfo host attributes:: 298047501Spendry* FSinfo filesystems:: 298147501Spendry* FSinfo static mounts:: 298247501Spendry@end menu 298347501Spendry 298447501Spendry@node FSinfo host attributes, FSinfo filesystems, FSinfo host definitions , FSinfo host definitions 298547501Spendry@comment node-name, next, previous, up 298647501Spendry@section @i{FSinfo} host attributes 298747501Spendry@cindex FSinfo host attributes 298847501Spendry@cindex Defining host attributes, FSinfo 298947501Spendry 299047501SpendryThe host data, @dfn{host_data}, always includes the @dfn{hostname}. In 299147501Spendryaddition, several other host attributes can be given. 299247501Spendry 299347501Spendry@example 299447501Spendryhost_data : @var{<hostname>} 299547501Spendry | "@{" @i{list(}host_attrs@i{)} "@}" @var{<hostname>} 299647501Spendry ; 299747501Spendry 299847501Spendryhost_attrs : host_attr "=" @var{<string>} 299947501Spendry | netif 300047501Spendry ; 300147501Spendry 300247501Spendryhost_attr : "config" 300347501Spendry | "arch" 300447501Spendry | "os" 300547501Spendry | "cluster" 300647501Spendry ; 300747501Spendry@end example 300847501Spendry 300947501SpendryThe @dfn{hostname} is, typically, the fully qualified hostname of the 301047501Spendrymachine. 301147501Spendry 301247501SpendryExamples: 301347501Spendry 301447501Spendry@example 301547501Spendryhost dylan.doc.ic.ac.uk 301647501Spendry 301747501Spendryhost @{ 301847501Spendry os = hpux 301947501Spendry arch = hp300 302047501Spendry@} dougal.doc.ic.ac.uk 302147501Spendry@end example 302247501Spendry 302347501SpendryThe options that can be given as host attributes are shown below. 302447501Spendry 302547501Spendry@menu 302647501Spendry* netif Option: FSinfo host netif: 302747501Spendry* arch Option: FSinfo host arch: 302847501Spendry* os Option: FSinfo host os: 302947501Spendry* cluster Option: FSinfo host cluster: 303047501Spendry@end menu 303147501Spendry 303247501Spendry@node FSinfo host netif, FSinfo host arch, , FSinfo host attributes 303347501Spendry@comment node-name, next, previous, up 303447501Spendry@subsection netif Option 303547501Spendry 303647501SpendryThis defines the set of network interfaces configured on the machine. 303747501SpendryThe interface attributes collected by @i{FSinfo} are the IP address, 303847501Spendrysubnet mask and hardware address. Multiple interfaces may be defined 303947501Spendryfor hosts with several interfaces by an entry for each interface. The 304047501Spendryvalues given are sanity checked, but are currently unused for anything 304147501Spendryelse. 304247501Spendry 304347501Spendry@example 304447501Spendrynetif : "netif" @var{<string>} "@{" @i{list(}netif_attrs@i{)} "@}" ; 304547501Spendry 304647501Spendrynetif_attrs : netif_attr "=" @var{<string>} ; 304747501Spendry 304847501Spendrynetif_attr : "inaddr" | "netmask" | "hwaddr" ; 304947501Spendry@end example 305047501Spendry 305147501SpendryExamples: 305247501Spendry 305347501Spendry@example 305447501Spendrynetif ie0 @{ 305547501Spendry inaddr = 129.31.81.37 305647501Spendry netmask = 0xfffffe00 305747501Spendry hwaddr = "08:00:20:01:a6:a5" 305847501Spendry@} 305947501Spendry 306047501Spendrynetif ec0 @{ @} 306147501Spendry@end example 306247501Spendry 306347501Spendry@node FSinfo host config, FSinfo host arch, FSinfo host netif, FSinfo host attributes 306447501Spendry@comment node-name, next, previous, up 306547501Spendry@subsection config Option 306647501Spendry@cindex FSinfo config host attribute 306747501Spendry@cindex config, FSinfo host attribute 306847501Spendry 306947501SpendryThis option allows you to specify configuration variables for the 307047501Spendrystartup scripts (@file{rc} scripts). A simple string should immediately 307147501Spendryfollow the keyword. 307247501Spendry 307347501SpendryExample: 307447501Spendry 307547501Spendry@example 307647501Spendryconfig "NFS_SERVER=true" 307747501Spendryconfig "ZEPHYR=true" 307847501Spendry@end example 307947501Spendry 308047501SpendryThis option is currently unsupported. 308147501Spendry 308247501Spendry@node FSinfo host arch, FSinfo host os, FSinfo host config, FSinfo host attributes 308347501Spendry@comment node-name, next, previous, up 308447501Spendry@subsection arch Option 308547501Spendry@cindex FSinfo arch host attribute 308647501Spendry@cindex arch, FSinfo host attribute 308747501Spendry 308847501SpendryThis defines the architecture of the machine. For example: 308947501Spendry 309047501Spendry@example 309147501Spendryarch = hp300 309247501Spendry@end example 309347501Spendry 309447501SpendryThis is intended to be of use when building architecture specific 309547501Spendrymountmaps, however, the option is currently unsupported. 309647501Spendry 309747501Spendry@node FSinfo host os, FSinfo host cluster, FSinfo host arch, FSinfo host attributes 309847501Spendry@comment node-name, next, previous, up 309947501Spendry@subsection os Option 310047501Spendry@cindex FSinfo os host attribute 310147501Spendry@cindex os, FSinfo host attribute 310247501Spendry 310347501SpendryThis defines the operating system type of the host. For example: 310447501Spendry 310547501Spendry@example 310647501Spendryos = hpux 310747501Spendry@end example 310847501Spendry 310947501SpendryThis information is used when creating the @file{fstab} files, for 311047501Spendryexample in choosing which format to use for the @file{fstab} entries 311147501Spendrywithin the file. 311247501Spendry 311347501Spendry@node FSinfo host cluster, , FSinfo host os, FSinfo host attributes 311447501Spendry@comment node-name, next, previous, up 311547501Spendry@subsection cluster Option 311647501Spendry@cindex FSinfo cluster host attribute 311747501Spendry@cindex cluster, FSinfo host attribute 311847501Spendry 311947501SpendryThis is used for specifying in which cluster the machine belongs. For 312047501Spendryexample: 312147501Spendry 312247501Spendry@example 312347501Spendrycluster = "theory" 312447501Spendry@end example 312547501Spendry 312647501SpendryThe cluster is intended to be used when generating the automount maps, 312747501Spendryalthough it is currently unsupported. 312847501Spendry 312947501Spendry@node FSinfo filesystems, FSinfo static mounts, FSinfo host attributes, FSinfo host definitions 313047501Spendry@comment node-name, next, previous, up 313147501Spendry@section @i{FSinfo} filesystems 313247501Spendry@cindex FSinfo filesystems 313347501Spendry 313447501SpendryThe list of physically attached filesystems follows the machine 313547501Spendryattributes. These should define all the filesystems available from this 313647501Spendrymachine, whether exported or not. In addition to the device name, 313747501Spendryfilesystems have several attributes, such as filesystem type, mount 313847501Spendryoptions, and @samp{fsck} pass number which are needed to generate 313947501Spendry@file{fstab} entries. 314047501Spendry 314147501Spendry@example 314247501Spendryfilesystem : "fs" @var{<device>} "@{" @i{list(}fs_data@i{)} "@}" ; 314347501Spendry 314447501Spendryfs_data : fs_data_attr "=" @var{<string>} 314547501Spendry | mount 314647501Spendry ; 314747501Spendry 314847501Spendryfs_data_attr 314947501Spendry : "fstype" | "opts" | "passno" 315047501Spendry | "freq" | "dumpset" | "log" 315147501Spendry ; 315247501Spendry@end example 315347501Spendry 315447501SpendryHere, @var{<device>} is the device name of the disk (for example, 315547501Spendry@file{/dev/dsk/2s0}). The device name is used for building the mount 315647501Spendrymaps and for the @file{fstab} file. The attributes that can be 315747501Spendryspecified are shown in the following section. 315847501Spendry 315947501SpendryThe @i{FSinfo} configuration file for @code{dylan.doc.ic.ac.uk} is listed below. 316047501Spendry 316147501Spendry@example 316247501Spendryhost dylan.doc.ic.ac.uk 316347501Spendry 316447501Spendryfs /dev/dsk/0s0 { 316547501Spendry fstype = swap 316647501Spendry} 316747501Spendry 316847501Spendryfs /dev/dsk/0s0 { 316947501Spendry fstype = hfs 317047501Spendry opts = rw,noquota,grpid 317147501Spendry passno = 0; 317247501Spendry freq = 1; 317347501Spendry mount / { } 317447501Spendry} 317547501Spendry 317647501Spendryfs /dev/dsk/1s0 { 317747501Spendry fstype = hfs 317847501Spendry opts = defaults 317947501Spendry passno = 1; 318047501Spendry freq = 1; 318147501Spendry mount /usr { 318247501Spendry local { 318347501Spendry exportfs "dougal eden dylan zebedee brian" 318447501Spendry volname /nfs/hp300/local 318547501Spendry } 318647501Spendry } 318747501Spendry} 318847501Spendry 318947501Spendryfs /dev/dsk/2s0 { 319047501Spendry fstype = hfs 319147501Spendry opts = defaults 319247501Spendry passno = 1; 319347501Spendry freq = 1; 319447501Spendry mount default { 319547501Spendry exportfs "toytown_clients hangers_on" 319647501Spendry volname /home/dylan/dk2 319747501Spendry } 319847501Spendry} 319947501Spendry 320047501Spendryfs /dev/dsk/3s0 { 320147501Spendry fstype = hfs 320247501Spendry opts = defaults 320347501Spendry passno = 1; 320447501Spendry freq = 1; 320547501Spendry mount default { 320647501Spendry exportfs "toytown_clients hangers_on" 320747501Spendry volname /home/dylan/dk3 320847501Spendry } 320947501Spendry} 321047501Spendry 321147501Spendryfs /dev/dsk/5s0 { 321247501Spendry fstype = hfs 321347501Spendry opts = defaults 321447501Spendry passno = 1; 321547501Spendry freq = 1; 321647501Spendry mount default { 321747501Spendry exportfs "toytown_clients hangers_on" 321847501Spendry volname /home/dylan/dk5 321947501Spendry } 322047501Spendry} 322147501Spendry@end example 322247501Spendry 322347501Spendry@menu 322447501Spendry* fstype Option: FSinfo filesystems fstype: 322547501Spendry* opts Option: FSinfo filesystems opts: 322647501Spendry* passno Option: FSinfo filesystems passno: 322747501Spendry* freq Option: FSinfo filesystems freq: 322847501Spendry* mount Option: FSinfo filesystems mount: 322947501Spendry* dumpset Option: FSinfo filesystems dumpset: 323047501Spendry* log Option: FSinfo filesystems log: 323147501Spendry@end menu 323247501Spendry 323347501Spendry@node FSinfo filesystems fstype, FSinfo filesystems opts, , FSinfo filesystems 323447501Spendry@comment node-name, next, previous, up 323547501Spendry@subsection fstype Option 323647501Spendry@cindex FSinfo fstype filesystems option 323747501Spendry@cindex fstype, FSinfo filesystems option 323847501Spendry@cindex export, FSinfo special fstype 323947501Spendry 324047501SpendryThis specifies the type of filesystem being declared and will be placed 324147501Spendryinto the @file{fstab} file as is. The value of this option will be 324247501Spendryhanded to @code{mount} as the filesystem type---it should have such 324347501Spendryvalues as @code{4.2}, @code{nfs} or @code{swap}. The value is not 324447501Spendryexamined for correctness. 324547501Spendry 324647501SpendryThere is one special case. If the filesystem type is specified as 324747501Spendry@samp{export} then the filesystem information will not be added to the 324847501Spendryhost's @file{fstab} information, but it will still be visible on the 324947501Spendrynetwork. This is useful for defining hosts which contain referenced 325047501Spendryvolumes but which are not under full control of @i{FSinfo}. 325147501Spendry 325247501SpendryExample: 325347501Spendry 325447501Spendry@example 325547501Spendryfstype = swap 325647501Spendry@end example 325747501Spendry 325847501Spendry@node FSinfo filesystems opts, FSinfo filesystems passno,FSinfo filesystems fstype, FSinfo filesystems 325947501Spendry@comment node-name, next, previous, up 326047501Spendry@subsection opts Option 326147501Spendry@cindex FSinfo opts filesystems option 326247501Spendry@cindex opts, FSinfo filesystems option 326347501Spendry 326447501SpendryThis defines any options that should be given to @b{mount}(8) in the 326547501Spendry@file{fstab} file. For example: 326647501Spendry 326747501Spendry@example 326847501Spendryopts = rw,nosuid,grpid 326947501Spendry@end example 327047501Spendry 327147501Spendry@node FSinfo filesystems passno, FSinfo filesystems freq, FSinfo filesystems opts, FSinfo filesystems 327247501Spendry@comment node-name, next, previous, up 327347501Spendry@subsection passno Option 327447501Spendry@cindex FSinfo passno filesystems option 327547501Spendry@cindex passno, FSinfo filesystems option 327647501Spendry 327747501SpendryThis defines the @b{fsck}(8) pass number in which to check the 327847501Spendryfilesystem. This value will be placed into the @file{fstab} file. 327947501Spendry 328047501SpendryExample: 328147501Spendry 328247501Spendry@example 328347501Spendrypassno = 1 328447501Spendry@end example 328547501Spendry 328647501Spendry@node FSinfo filesystems freq, FSinfo filesystems mount, FSinfo filesystems passno, FSinfo filesystems 328747501Spendry@comment node-name, next, previous, up 328847501Spendry@subsection freq Option 328947501Spendry@cindex FSinfo freq filesystems option 329047501Spendry@cindex freq, FSinfo filesystems option 329147501Spendry 329247501SpendryThis defines the interval (in days) between dumps. The value is placed 329347501Spendryas is into the @file{fstab} file. 329447501Spendry 329547501SpendryExample: 329647501Spendry 329747501Spendry@example 329847501Spendryfreq = 3 329947501Spendry@end example 330047501Spendry 330147501Spendry@node FSinfo filesystems mount, FSinfo filesystems dumpset, FSinfo filesystems freq, FSinfo filesystems 330247501Spendry@comment node-name, next, previous, up 330347501Spendry@subsection mount Option 330447501Spendry@cindex FSinfo mount filesystems option 330547501Spendry@cindex mount, FSinfo filesystems option 330647501Spendry@cindex exportfs, FSinfo mount option 330747501Spendry@cindex volname, FSinfo mount option 330847501Spendry@cindex sel, FSinfo mount option 330947501Spendry 331047501SpendryThis defines the mountpoint at which to place the filesystem. If the 331147501Spendrymountpoint of the filesystem is specified as @code{default}, then the 331247501Spendryfilesystem will be mounted in the automounter's tree under its volume 331347501Spendryname and the mount will automatically be inherited by the automounter. 331447501Spendry 331547501SpendryFollowing the mountpoint, namespace information for the filesystem may 331647501Spendrybe described. The options that can be given here are @code{exportfs}, 331747501Spendry@code{volname} and @code{sel}. 331847501Spendry 331947501SpendryThe format is: 332047501Spendry 332147501Spendry@example 332247501Spendrymount : "mount" vol_tree ; 332347501Spendry 332447501Spendryvol_tree : @i{list(}vol_tree_attr@i{)} ; 332547501Spendry 332647501Spendryvol_tree_attr 332747501Spendry : @var{<string>} "@{" @i{list(}vol_tree_info@i{)} vol_tree "@}" ; 332847501Spendry 332947501Spendryvol_tree_info 333047501Spendry : "exportfs" @var{<export-data>} 333147501Spendry | "volname" @var{<volname>} 333247501Spendry | "sel" @var{<selector-list>} 333347501Spendry ; 333447501Spendry@end example 333547501Spendry 333647501SpendryExample: 333747501Spendry 333847501Spendry@example 333947501Spendrymount default @{ 334047501Spendry exportfs "dylan dougal florence zebedee" 334147501Spendry volname /vol/andrew 334247501Spendry@} 334347501Spendry@end example 334447501Spendry 334547501SpendryIn the above example, the filesystem currently being declared will have 334647501Spendryan entry placed into the @file{exports} file allowing the filesystem to 334747501Spendrybe exported to the machines @code{dylan}, @code{dougal}, @code{florence} 334847501Spendryand @code{zebedee}. The volume name by which the filesystem will be 334947501Spendryreferred to remotely, is @file{/vol/andrew}. By declaring the 335047501Spendrymountpoint to be @code{default}, the filesystem will be mounted on the 335147501Spendrylocal machine in the automounter tree, where @i{Amd} will automatically 335247501Spendryinherit the mount as @file{/vol/andrew}.@refill 335347501Spendry 335447501Spendry@table @samp 335547501Spendry@item exportfs 335647501Spendrya string defining which machines the filesystem may be exported to. 335747501SpendryThis is copied, as is, into the @file{exports} file---no sanity checking 335847501Spendryis performed on this string.@refill 335947501Spendry 336047501Spendry@item volname 336147501Spendrya string which declares the remote name by which to reference the 336247501Spendryfilesystem. The string is entered into a dictionary and allows you to 336347501Spendryrefer to this filesystem in other places by this volume name.@refill 336447501Spendry 336547501Spendry@item sel 336647501Spendrya string which is placed into the automounter maps as a selector for the 336747501Spendryfilesystem.@refill 336847501Spendry 336947501Spendry@end table 337047501Spendry 337147501Spendry@node FSinfo filesystems dumpset, FSinfo filesystems log, FSinfo filesystems mount, FSinfo filesystems 337247501Spendry@comment node-name, next, previous, up 337347501Spendry@subsection dumpset Option 337447501Spendry@cindex FSinfo dumpset filesystems option 337547501Spendry@cindex dumpset, FSinfo filesystems option 337647501Spendry 337747501SpendryThis provides support for Imperial College's local file backup tools and 337847501Spendryis not documented further here. 337947501Spendry 338047501Spendry@node FSinfo filesystems log, , FSinfo filesystems dumpset, FSinfo filesystems 338147501Spendry@comment node-name, next, previous, up 338247501Spendry@subsection log Option 338347501Spendry@cindex FSinfo log filesystems option 338447501Spendry@cindex log, FSinfo filesystems option 338547501Spendry 338647501SpendrySpecifies the log device for the current filesystem. This is ignored if 338747501Spendrynot required by the particular filesystem type. 338847501Spendry 338947501Spendry@node FSinfo static mounts, FSinfo automount definitions , FSinfo filesystems, FSinfo host definitions 339047501Spendry@comment node-name, next, previous, up 339147501Spendry@section @i{FSinfo} static mounts 339247501Spendry@cindex FSinfo static mounts 339347501Spendry@cindex Statically mounts filesystems, FSinfo 339447501Spendry 339547501SpendryEach host may also have a number of statically mounted filesystems. For 339647501Spendryexample, the host may be a diskless workstation in which case it will 339747501Spendryhave no @code{fs} declarations. In this case the @code{mount} 339847501Spendrydeclaration is used to determine from where its filesystems will be 339947501Spendrymounted. In addition to being added to the @file{fstab} file, this 340047501Spendryinformation can also be used to generate a suitable @file{bootparams} 340147501Spendryfile.@refill 340247501Spendry 340347501Spendry@example 340447501Spendrymount : "mount" @var{<volname>} @i{list(}localinfo@i{)} ; 340547501Spendry 340647501Spendrylocalinfo : localinfo_attr @var{<string>} ; 340747501Spendry 340847501Spendrylocalinfo_attr 340947501Spendry : "as" 341047501Spendry | "from" 341147501Spendry | "fstype" 341247501Spendry | "opts" 341347501Spendry ; 341447501Spendry@end example 341547501Spendry 341647501SpendryThe filesystem specified to be mounted will be searched for in the 341747501Spendrydictionary of volume names built when scanning the list of hosts' 341847501Spendrydefinitions. 341947501Spendry 342047501SpendryThe attributes have the following semantics: 342147501Spendry@table @samp 342247501Spendry@item from @var{machine} 342347501Spendrymount the filesystem from the machine with the hostname of 342447501Spendry@dfn{machine}.@refill 342547501Spendry 342647501Spendry@item as @var{mountpoint} 342747501Spendrymount the filesystem locally as the name given, in case this is 342847501Spendrydifferent from the advertised volume name of the filesystem. 342947501Spendry 343047501Spendry@item opts @var{options} 343147501Spendrynative @b{mount}(8) options. 343247501Spendry 343347501Spendry@item fstype @var{type} 343447501Spendrytype of filesystem to be mounted. 343547501Spendry@end table 343647501Spendry 343747501SpendryAn example: 343847501Spendry 343947501Spendry@example 344047501Spendrymount /export/exec/hp300/local as /usr/local 344147501Spendry@end example 344247501Spendry 344347501SpendryIf the mountpoint specified is either @file{/} or @file{swap}, the 344447501Spendrymachine will be considered to be booting off the net and this will be 344547501Spendrynoted for use in generating a @file{bootparams} file for the host which 344647501Spendryowns the filesystems. 344747501Spendry 344847501Spendry@node FSinfo automount definitions, FSinfo Command Line Options, FSinfo static mounts, FSinfo 344947501Spendry@comment node-name, next, previous, up 345047501Spendry@section Defining an @i{Amd} Mount Map in @i{FSinfo} 345147501Spendry@cindex FSinfo automount definitions 345247501Spendry@cindex Defining an Amd mount map, FSinfo 345347501Spendry 345447501SpendryThe maps used by @i{Amd} can be constructed from @i{FSinfo} by defining 345547501Spendryall the automount trees. @i{FSinfo} takes all the definitions found and 345647501Spendrybuilds one map for each top level tree. 345747501Spendry 345847501SpendryThe automount tree is usually defined last. A single automount 345947501Spendryconfiguration will usually apply to an entire management domain. One 346047501Spendry@code{automount} declaration is needed for each @i{Amd} automount point. 346147501Spendry@i{FSinfo} determines whether the automount point is @dfn{direct} 346247501Spendry(@pxref{Direct Automount Filesystem}) or @dfn{indirect} 346347501Spendry(@pxref{Top-level Filesystem}). Direct automount points are 346447501Spendrydistinguished by the fact that there is no underlying 346547501Spendry@dfn{automount_tree}.@refill 346647501Spendry 346747501Spendry@example 346847501Spendryautomount : "automount" opt(auto_opts@i{)} automount_tree ; 346947501Spendry 347047501Spendryauto_opts : "opts" @var{<mount-options>} ; 347147501Spendry 347247501Spendryautomount_tree 347347501Spendry : @i{list(}automount_attr@i{)} 347447501Spendry ; 347547501Spendry 347647501Spendryautomount_attr 347747501Spendry : @var{<string>} "=" @var{<volname>} 347847501Spendry | @var{<string>} "->" @var{<symlink>} 347947501Spendry | @var{<string>} "@{" automount_tree "@}" 348047501Spendry ; 348147501Spendry@end example 348247501Spendry 348347501SpendryIf @var{<mount-options>} is given, then it is the string to be placed in 348447501Spendrythe maps for @i{Amd} for the @code{opts} option. 348547501Spendry 348647501SpendryA @dfn{map} is typically a tree of filesystems, for example @file{home} 348747501Spendrynormally contains a tree of filesystems representing other machines in 348847501Spendrythe network. 348947501Spendry 349047501SpendryA map can either be given as a name representing an already defined 349147501Spendryvolume name, or it can be a tree. A tree is represented by placing 349247501Spendrybraces after the name. For example, to define a tree @file{/vol}, the 349347501Spendryfollowing map would be defined: 349447501Spendry 349547501Spendry@example 349647501Spendryautomount /vol @{ @} 349747501Spendry@end example 349847501Spendry 349947501SpendryWithin a tree, the only items that can appear are more maps. 350047501SpendryFor example: 350147501Spendry 350247501Spendry@example 350347501Spendryautomount /vol @{ 350447501Spendry andrew @{ @} 350547501Spendry X11 @{ @} 350647501Spendry@} 350747501Spendry@end example 350847501Spendry 350947501SpendryIn this case, @i{FSinfo} will look for volumes named @file{/vol/andrew} 351047501Spendryand @file{/vol/X11} and a map entry will be generated for each. If the 351147501Spendryvolumes are defined more than once, then @i{FSinfo} will generate 351247501Spendrya series of alternate entries for them in the maps.@refill 351347501Spendry 351447501SpendryInstead of a tree, either a link (@var{name} @code{->} 351547501Spendry@var{destination}) or a reference can be specified (@var{name} @code{=} 351647501Spendry@var{destination}). A link creates a symbolic link to the string 351747501Spendryspecified, without further processing the entry. A reference will 351847501Spendryexamine the destination filesystem and optimise the reference. For 351947501Spendryexample, to create an entry for @code{njw} in the @file{/homes} map, 352047501Spendryeither of the two forms can be used:@refill 352147501Spendry 352247501Spendry@example 352347501Spendryautomount /homes @{ 352447501Spendry njw -> /home/dylan/njw 352547501Spendry@} 352647501Spendry@end example 352747501Spendry 352847501Spendryor 352947501Spendry 353047501Spendry@example 353147501Spendryautomount /homes @{ 353247501Spendry njw = /home/dylan/njw 353347501Spendry@} 353447501Spendry@end example 353547501Spendry 353647501SpendryIn the first example, when @file{/homes/njw} is referenced from @i{Amd}, 353747501Spendrya link will be created leading to @file{/home/dylan/njw} and the 353847501Spendryautomounter will be referenced a second time to resolve this filename. 353947501SpendryThe map entry would be: 354047501Spendry 354147501Spendry@example 354247501Spendrynjw type:=link;fs:=/home/dylan/njw 354347501Spendry@end example 354447501Spendry 354547501SpendryIn the second example, the destination directory is analysed and found 354647501Spendryto be in the filesystem @file{/home/dylan} which has previously been 354747501Spendrydefined in the maps. Hence the map entry will look like: 354847501Spendry 354947501Spendry@example 355047501Spendrynjw rhost:=dylan;rfs:=/home/dylan;sublink:=njw 355147501Spendry@end example 355247501Spendry 355347501SpendryCreating only one symbolic link, and one access to @i{Amd}. 355447501Spendry 355547501Spendry@c --------------------------------------------- 355647501Spendry@node FSinfo Command Line Options, FSinfo errors, FSinfo automount definitions, FSinfo 355747501Spendry@comment node-name, next, previous, up 355847501Spendry@section @i{FSinfo} Command Line Options 355947501Spendry@cindex FSinfo command line options 356047501Spendry@cindex Command line options, FSinfo 356147501Spendry 356247501Spendry@i{FSinfo} is started from the command line by using the command: 356347501Spendry 356447501Spendry@example 356547501Spendryfsinfo [@i{options}] files ... 356647501Spendry@end example 356747501Spendry 356847501SpendryThe input to @i{FSinfo} is a single set of definitions of machines and 356947501Spendryautomount maps. If multiple files are given on the command-line, then 357047501Spendrythe files are concatenated together to form the input source. The files 357147501Spendryare passed individually through the C pre-processor before being parsed. 357247501Spendry 357347501SpendrySeveral options define a prefix for the name of an output file. If the 357447501Spendryprefix is not specified no output of that type is produced. The suffix 357547501Spendryused will correspond either to the hostname to which a file belongs, or 357647501Spendryto the type of output if only one file is produced. Dumpsets and the 357747501Spendry@file{bootparams} file are in the latter class. To put the output into 357847501Spendrya subdirectory simply put a @file{/} at the end of the prefix, making 357947501Spendrysure that the directory has already been made before running 358047501Spendry@samp{fsinfo}. 358147501Spendry 358247501Spendry@menu 358347501Spendry* -a FSinfo Option:: Amd automount directory: 358447501Spendry* -b FSinfo Option:: Prefix for bootparams files. 358547501Spendry* -d FSinfo Option:: Prefix for dumpset data files. 358647501Spendry* -e FSinfo Option:: Prefix for exports files. 358747501Spendry* -f FSinfo Option:: Prefix for fstab files. 358847501Spendry* -h FSinfo Option:: Local hostname. 358947501Spendry* -m FSinfo Option:: Prefix for automount maps. 359047501Spendry* -q FSinfo Option:: Ultra quiet mode. 359147501Spendry* -v FSinfo Option:: Verbose mode. 359247501Spendry* -I FSinfo Option:: Define new #include directory. 359347501Spendry* -D FSinfo Option:: Define macro. 359447501Spendry* -U FSinfo Option:: Undefine macro. 359547501Spendry@end menu 359647501Spendry 359747501Spendry@node -a FSinfo Option, -b FSinfo Option, FSinfo Command Line Options, FSinfo Command Line Options 359847501Spendry@comment node-name, next, previous, up 359947501Spendry@subsection @code{-a} @var{autodir} 360047501Spendry 360147501SpendrySpecifies the directory name in which to place the automounter's 360247501Spendrymountpoints. This defaults to @file{/a}. Some sites have the autodir set 360347501Spendryto be @file{/amd}, and this would be achieved by: 360447501Spendry 360547501Spendry@example 360647501Spendryfsinfo -a /amd ... 360747501Spendry@end example 360847501Spendry 360947501Spendry@node -b FSinfo Option, -d FSinfo Option, -a FSinfo Option, FSinfo Command Line Options 361047501Spendry@comment node-name, next, previous, up 361147501Spendry@subsection @code{-b} @var{bootparams} 361247501Spendry@cindex bootparams, FSinfo prefix 361347501Spendry 361447501SpendryThis specifies the prefix for the @file{bootparams} filename. If it is 361547501Spendrynot given, then the file will not be generated. The @file{bootparams} 361647501Spendryfile will be constructed for the destination machine and will be placed 361747501Spendryinto a file named @file{bootparams} and prefixed by this string. The 361847501Spendryfile generated contains a list of entries describing each diskless 361947501Spendryclient that can boot from the destination machine. 362047501Spendry 362147501SpendryAs an example, to create a @file{bootparams} file in the directory 362247501Spendry@file{generic}, the following would be used: 362347501Spendry 362447501Spendry@example 362547501Spendryfsinfo -b generic/ ... 362647501Spendry@end example 362747501Spendry 362847501Spendry@node -d FSinfo Option, -e FSinfo Option, -b FSinfo Option, FSinfo Command Line Options 362947501Spendry@comment node-name, next, previous, up 363047501Spendry@subsection @code{-d} @var{dumpsets} 363147501Spendry@cindex dumpset, FSinfo prefix 363247501Spendry 363347501SpendryThis specifies the prefix for the @file{dumpsets} file. If it is not 363447501Spendryspecified, then the file will not be generated. The file will be for 363547501Spendrythe destination machine and will be placed into a filename 363647501Spendry@file{dumpsets}, prefixed by this string. The @file{dumpsets} file is 363747501Spendryfor use by Imperial College's local backup system. 363847501Spendry 363947501SpendryFor example, to create a dumpsets file in the directory @file{generic}, 364047501Spendrythen you would use the following: 364147501Spendry 364247501Spendry@example 364347501Spendryfsinfo -d generic/ ... 364447501Spendry@end example 364547501Spendry 364647501Spendry@node -e FSinfo Option, -f FSinfo Option, -d FSinfo Option, FSinfo Command Line Options 364747501Spendry@comment node-name, next, previous, up 364847501Spendry@subsection @code{-e} @var{exportfs} 364947501Spendry@cindex exports, FSinfo prefix 365047501Spendry 365147501SpendryDefines the prefix for the @file{exports} files. If it is not given, 365247501Spendrythen the file will not be generated. For each machine defined in the 365347501Spendryconfiguration files as having disks, an @file{exports} file is 365447501Spendryconstructed and given a filename determined by the name of the machine, 365547501Spendryprefixed with this string. If a machine is defined as diskless, then no 365647501Spendry@file{exports} file will be created for it. The files contain entries 365747501Spendryfor directories on the machine that may be exported to clients. 365847501Spendry 365947501SpendryExample: To create the @file{exports} files for each diskful machine 366047501Spendryand place them into the directory @file{exports}: 366147501Spendry 366247501Spendry@example 366347501Spendryfsinfo -e exports/ ... 366447501Spendry@end example 366547501Spendry 366647501Spendry@node -f FSinfo Option, -h FSinfo Option, -e FSinfo Option, FSinfo Command Line Options 366747501Spendry@comment node-name, next, previous, up 366847501Spendry@subsection @code{-f} @var{fstab} 366947501Spendry@cindex fstab, FSinfo prefix 367047501Spendry 367147501SpendryThis defines the prefix for the @file{fstab} files. The files will only 367247501Spendrybe created if this prefix is defined. For each machine defined in the 367347501Spendryconfiguration files, a @file{fstab} file is created with the filename 367447501Spendrydetermined by prefixing this string with the name of the machine. These 367547501Spendryfiles contain entries for filesystems and partitions to mount at boot 367647501Spendrytime. 367747501Spendry 367847501SpendryExample, to create the files in the directory @file{fstabs}: 367947501Spendry 368047501Spendry@example 368147501Spendryfsinfo -f fstabs/ ... 368247501Spendry@end example 368347501Spendry 368447501Spendry@node -h FSinfo Option, -m FSinfo Option, -f FSinfo Option, FSinfo Command Line Options 368547501Spendry@comment node-name, next, previous, up 368647501Spendry@subsection @code{-h} @var{hostname} 368747501Spendry@cindex hostname, FSinfo command line option 368847501Spendry 368947501SpendryDefines the hostname of the destination machine to process for. If this 369047501Spendryis not specified, it defaults to the local machine name, as returned by 369147501Spendry@b{gethostname}(2). 369247501Spendry 369347501SpendryExample: 369447501Spendry 369547501Spendry@example 369647501Spendryfsinfo -h dylan.doc.ic.ac.uk ... 369747501Spendry@end example 369847501Spendry 369947501Spendry@node -m FSinfo Option, -q FSinfo Option, -h FSinfo Option, FSinfo Command Line Options 370047501Spendry@comment node-name, next, previous, up 370147501Spendry@subsection @code{-m} @var{mount-maps} 370247501Spendry@cindex maps, FSinfo command line option 370347501Spendry 370447501SpendryDefines the prefix for the automounter files. The maps will only be 370547501Spendryproduced if this prefix is defined. The mount maps suitable for the 370647501Spendrynetwork defined by the configuration files will be placed into files 370747501Spendrywith names calculated by prefixing this string to the name of each map. 370847501Spendry 370947501SpendryFor example, to create the automounter maps and place them in the 371047501Spendrydirectory @file{automaps}: 371147501Spendry 371247501Spendry@example 371347501Spendryfsinfo -m automaps/ ... 371447501Spendry@end example 371547501Spendry 371647501Spendry@node -q FSinfo Option, -v FSinfo Option, -m FSinfo Option, FSinfo Command Line Options 371747501Spendry@comment node-name, next, previous, up 371847501Spendry@subsection @code{-q} 371947501Spendry@cindex quiet, FSinfo command line option 372047501Spendry 372147501SpendrySelects quiet mode. @i{FSinfo} suppress the ``running commentary'' and 372247501Spendryonly outputs any error messages which are generated. 372347501Spendry 372447501Spendry@node -v FSinfo Option, -D-FSinfo Option, -q FSinfo Option, FSinfo Command Line Options 372547501Spendry@comment node-name, next, previous, up 372647501Spendry@subsection @code{-v} 372747501Spendry@cindex verbose, FSinfo command line option 372847501Spendry 372947501SpendrySelects verbose mode. When this is activated, the program will display 373047501Spendrymore messages, and display all the information discovered when 373147501Spendryperforming the semantic analysis phase. Each verbose message is output 373247501Spendryto @file{stdout} on a line starting with a @samp{#} character. 373347501Spendry 373447501Spendry@node -D-FSinfo Option, -I FSinfo Option, -v FSinfo Option, FSinfo Command Line Options 373547501Spendry@comment node-name, next, previous, up 373647501Spendry@subsection @code{-D} @var{name[=defn]} 373747501Spendry 373847501SpendryDefines a symbol @dfn{name} for the preprocessor when reading the 373947501Spendryconfiguration files. Equivalent to @code{#define} directive. 374047501Spendry 374147501Spendry@node -I FSinfo Option, -U FSinfo Option, -D-FSinfo Option, FSinfo Command Line Options 374247501Spendry@comment node-name, next, previous, up 374347501Spendry@subsection @code{-I} @var{directory} 374447501Spendry 374547501SpendryThis option is passed into the preprocessor for the configuration files. 374647501SpendryIt specifies directories in which to find include files 374747501Spendry 374847501Spendry@node -U FSinfo Option, , -I FSinfo Option, FSinfo Command Line Options 374947501Spendry@comment node-name, next, previous, up 375047501Spendry@subsection @code{-U} @var{name} 375147501Spendry 375247501SpendryRemoves any initial definition of the symbol @dfn{name}. Inverse of the 375347501Spendry@code{-D} option. 375447501Spendry 375547501Spendry@node FSinfo errors, , FSinfo command line options, FSinfo 375647501Spendry@comment node-name, next, previous, up 375747501Spendry@section Errors produced by @i{FSinfo} 375847501Spendry@cindex FSinfo error messages 375947501Spendry 376047501SpendryThe following table documents the errors and warnings which @i{FSinfo} may produce. 376147501Spendry 376247501Spendry@table @t 376347501Spendry 376447501Spendry@item can't open @var{filename} for writing 376547501SpendryOccurs if any errors are encountered when opening an output file.@refill 376647501Spendry 376747501Spendry@item unknown host attribute 376847501SpendryOccurs if an unrecognised keyword is used when defining a host.@refill 376947501Spendry 377047501Spendry@item unknown filesystem attribute 377147501SpendryOccurs if an unrecognised keyword is used when defining a host's 377247501Spendryfilesystems.@refill 377347501Spendry 377447501Spendry@item not allowed '/' in a directory name 377547501SpendryWhen reading the configuration input, if there is a filesystem 377647501Spendrydefinition which contains a pathname with multiple directories for any 377747501Spendrypart of the mountpoint element, and it is not a single absolute path, 377847501Spendrythen this message will be produced by the parser.@refill 377947501Spendry 378047501Spendry@item unknown directory attribute 378147501SpendryIf an unknown keyword is found while reading the definition of a hosts's 378247501Spendryfilesystem mount option. 378347501Spendry 378447501Spendry@item unknown mount attribute 378547501SpendryOccurs if an unrecognised keyword is found while parsing the list of 378647501Spendrystatic mounts.@refill 378747501Spendry 378847501Spendry@item " expected 378947501SpendryOccurs if an unescaped newline is found in a quoted string. 379047501Spendry 379147501Spendry@item unknown \ sequence 379247501SpendryOccurs if an unknown escape sequence is found inside a string. Within a 379347501Spendrystring, you can give the standard C escape sequences for strings, such 379447501Spendryas newlines and tab characters.@refill 379547501Spendry 379647501Spendry@item @var{filename}: cannot open for reading 379747501SpendryIf a file specified on the command line as containing configuration data 379847501Spendrycould not be opened.@refill 379947501Spendry 380047501Spendry@item end of file within comment 380147501SpendryA comment was unterminated before the end of one of the configuration 380247501Spendryfiles. 380347501Spendry 380447501Spendry@item host field "@var{field-name}" already set 380547501SpendryIf duplicate definitions are given for any of the fields with a host 380647501Spendrydefinition. 380747501Spendry 380847501Spendry@item duplicate host @var{hostname}! 380947501SpendryIf a host has more than one definition. 381047501Spendry 381147501Spendry@item netif field @var{field-name} already set 381247501SpendryOccurs if you attempt to define an attribute of an interface more than 381347501Spendryonce. 381447501Spendry 381547501Spendry@item malformed IP dotted quad: @var{address} 381647501SpendryIf the Internet address of an interface is incorrectly specified. An 381747501SpendryInternet address definition is handled to @b{inet_addr}(3N) to see if it 381847501Spendrycan cope. If not, then this message will be displayed. 381947501Spendry 382047501Spendry@item malformed netmask: @var{netmask} 382147501SpendryIf the netmask cannot be decoded as though it were a hexadecimal number, 382247501Spendrythen this message will be displayed. It will typically be caused by 382347501Spendryincorrect characters in the @var{netmask} value.@refill 382447501Spendry 382547501Spendry@item fs field "@var{field-name}" already set 382647501SpendryOccurs when multiple definitions are given for one of the attributes of a 382747501Spendryhost's filesystem. 382847501Spendry 382947501Spendry@item mount tree field "@var{field-name}" already set 383047501SpendryOccurs when the @var{field-name} is defined more than once during the 383147501Spendrydefinition of a filesystems mountpoint. 383247501Spendry 383347501Spendry@item mount field "@var{field-name}" already set 383447501SpendryOccurs when a static mount has multiple definitions of the same field. 383547501Spendry 383647501Spendry@item no disk mounts on @var{hostname} 383747501SpendryIf there are no static mounts, nor local disk mounts specified for a 383847501Spendrymachine, this message will be displayed. 383947501Spendry 384047501Spendry@item @var{host}:@var{device} needs field "@var{field-name}" 384147501SpendryOccurs when a filesystem is missing a required field. @var{field-name} could 384247501Spendrybe one of @code{fstype}, @code{opts}, @code{passno} or 384347501Spendry@code{mount}.@refill 384447501Spendry 384547501Spendry@item @var{filesystem} has a volname but no exportfs data 384647501SpendryOccurs when a volume name is declared for a file system, but the string 384747501Spendryspecifying what machines the filesystem can be exported to is 384847501Spendrymissing. 384947501Spendry 385047501Spendry@item sub-directory @var{directory} of @var{directory-tree} starts with '/' 385147501SpendryWithin the filesystem specification for a host, if an element 385247501Spendry@var{directory} of the mountpoint begins with a @samp{/} and it is not 385347501Spendrythe start of the tree.@refill 385447501Spendry 385547501Spendry@item @var{host}:@var{device} has no mount point 385647501SpendryOccurs if the @samp{mount} option is not specified for a host's 385747501Spendryfilesystem.@refill 385847501Spendry 385947501Spendry@item @var{host}:@var{device} has more than one mount point 386047501SpendryOccurs if the mount option for a host's filesystem specifies multiple 386147501Spendrytrees at which to place the mountpoint.@refill 386247501Spendry 386347501Spendry@item no volname given for @var{host}:@var{device} 386447501SpendryOccurs when a filesystem is defined to be mounted on @file{default}, but 386547501Spendryno volume name is given for the file system, then the mountpoint cannot 386647501Spendrybe determined.@refill 386747501Spendry 386847501Spendry@item @var{host}:mount field specified for swap partition 386947501SpendryOccurs if a mountpoint is given for a filesystem whose type is declared 387047501Spendryto be @code{swap}.@refill 387147501Spendry 387247501Spendry@item ambiguous mount: @var{volume} is a replicated filesystem 387347501SpendryIf several filesystems are declared as having the same volume name, they 387447501Spendrywill be considered replicated filesystems. To mount a replicated 387547501Spendryfilesystem statically, a specific host will need to be named, to say 387647501Spendrywhich particular copy to try and mount, else this error will 387747501Spendryresult.@refill 387847501Spendry 387947501Spendry@item cannot determine localname since volname @var{volume} is not uniquely defined 388047501SpendryIf a volume is replicated and an attempt is made to mount the filesystem 388147501Spendrystatically without specifying a local mountpoint, @i{FSinfo} cannot 388247501Spendrycalculate a mountpoint, as the desired pathname would be 388347501Spendryambiguous.@refill 388447501Spendry 388547501Spendry@item volname @var{volume} is unknown 388647501SpendryOccurs if an attempt is made to mount or reference a volume name which 388747501Spendryhas not been declared during the host filesystem definitions.@refill 388847501Spendry 388947501Spendry@item volname @var{volume} not exported from @var{machine} 389047501SpendryOccurs if you attempt to mount the volume @var{volume} from a machine 389147501Spendrywhich has not declared itself to have such a filesystem 389247501Spendryavailable.@refill 389347501Spendry 389447501Spendry@item network booting requires both root and swap areas 389547501SpendryOccurs if a machine has mount declarations for either the root partition 389647501Spendryor the swap area, but not both. You cannot define a machine to only 389747501Spendrypartially boot via the network.@refill 389847501Spendry 389947501Spendry@item unknown volname @var{volume} automounted @i{[} on <name> @i{]} 390047501SpendryOccurs if @var{volume} is used in a definition of an automount map but the volume 390147501Spendryname has not been declared during the host filesystem definitions.@refill 390247501Spendry 390347501Spendry@item not allowed '/' in a directory name 390447501SpendryOccurs when a pathname with multiple directory elements is specified as 390547501Spendrythe name for an automounter tree. A tree should only have one name at 390647501Spendryeach level. 390747501Spendry 390847501Spendry@item @var{device} has duplicate exportfs data 390947501SpendryProduced if the @samp{exportfs} option is used multiple times within the 391047501Spendrysame branch of a filesytem definition. For example, if you attempt to 391147501Spendryset the @samp{exportfs} data at different levels of the mountpoint 391247501Spendrydirectory tree.@refill 391347501Spendry 391447501Spendry@item sub-directory of @var{directory-tree} is named "default" 391547501Spendry@samp{default} is a keyword used to specify if a mountpoint should be 391647501Spendryautomatically calculated by @i{FSinfo}. If you attempt to specify a 391747501Spendrydirectory name as this, it will use the filename of @file{default} but 391847501Spendrywill produce this warning.@refill 391947501Spendry 392047501Spendry@item pass number for @var{host}:@var{device} is non-zero 392147501SpendryOccurs if @var{device} has its @samp{fstype} declared to be @samp{swap} 392247501Spendryor @samp{export} and the @b{fsck}(8) pass number is set. Swap devices should not be 392347501Spendryfsck'd. @xref{FSinfo filesystems fstype}@refill 392447501Spendry 392547501Spendry@item dump frequency for @var{host}:@var{device} is non-zero 392647501SpendryOccurs if @var{device} has its @samp{fstype} declared to be @samp{swap} 392747501Spendryor @samp{export} and the @samp{dump} option is set to a value greater 392847501Spendrythan zero. Swap devices should not be dumped.@refill 392947501Spendry 393047501Spendry@end table 393147501Spendry 393247501Spendry@node Examples, Internals, FSinfo, Top 393347501Spendry@comment node-name, next, previous, up 393447501Spendry@chapter Examples 393547501Spendry 393647501Spendry@menu 393747501Spendry* User Filesystems:: 393847501Spendry* Home Directories:: 393947501Spendry* Architecture Sharing:: 394047501Spendry* Wildcard names:: 394147501Spendry* rwho servers:: 394247501Spendry* /vol:: 394347501Spendry@end menu 394447501Spendry 394547501Spendry@node User Filesystems, Home Directories, Starting Amd, Examples 394647501Spendry@comment node-name, next, previous, up 394747501Spendry@section User Filesystems 394847501Spendry@cindex User filesystems 394947501Spendry@cindex Mounting user filesystems 395047501Spendry 395147501SpendryWith more than one fileserver, the directories most frequently 395247501Spendrycross-mounted are those containing user home directories. A common 395347501Spendryconvention used at Imperial College is to mount the user disks under 395447501Spendry@t{/home/}@i{machine}. 395547501Spendry 395647501SpendryTypically, the @samp{/etc/fstab} file contained a long list of entries 395747501Spendrysuch as: 395847501Spendry 395947501Spendry@example 396047501Spendry@i{machine}:/home/@i{machine} /home/@i{machine} nfs ... 396147501Spendry@end example 396247501Spendry 396347501Spendryfor each fileserver on the network. 396447501Spendry 396547501SpendryThere are numerous problems with this system. The mount list can become 396647501Spendryquite large and some of the machines may be down when a system is 396747501Spendrybooted. When a new fileserver is installed, @samp{/etc/fstab} must be 396847501Spendryupdated on every machine, the mount directory created and the filesystem 396947501Spendrymounted. 397047501Spendry 397147501SpendryIn many environments most people use the same few workstations, but 397247501Spendryit is convenient to go to a colleague's machine and access your own 397347501Spendryfiles. When a server goes down, it can cause a process on a client 397447501Spendrymachine to hang. By minimising the mounted filesystems to only include 397547501Spendrythose actively being used, there is less chance that a filesystem will 397647501Spendrybe mounted when a server goes down. 397747501Spendry 397847501SpendryThe following is a short extract from a map taken from a research fileserver 397947501Spendryat Imperial College. 398047501Spendry 398147501SpendryNote the entry for @samp{localhost} which is used for users such as 398247501Spendrythe operator (@samp{opr}) who have a home directory on most machine as 398347501Spendry@samp{/home/localhost/opr}. 398447501Spendry 398547501Spendry@example 398647501Spendry/defaults opts:=rw,intr,grpid,nosuid 398747501Spendrycharm host!=$@{key@};type:=nfs;rhost:=$@{key@};rfs:=/home/$@{key@} \ 398847501Spendry host==$@{key@};type:=ufs;dev:=/dev/xd0g 398947501Spendry# 399047501Spendry... 399147501Spendry 399247501Spendry# 399347501Spendrylocalhost type:=link;fs:=$@{host@} 399447501Spendry... 399547501Spendry# 399647501Spendry# dylan has two user disks so have a 399747501Spendry# top directory in which to mount them. 399847501Spendry# 399947501Spendrydylan type:=auto;fs:=$@{map@};pref:=$@{key@}/ 400047501Spendry# 400147501Spendrydylan/dk2 host!=dylan;type:=nfs;rhost:=dylan;rfs:=/home/$@{key@} \ 400247501Spendry host==dylan;type:=ufs;dev:=/dev/dsk/2s0 400347501Spendry# 400447501Spendrydylan/dk5 host!=dylan;type:=nfs;rhost:=dylan;rfs:=/home/$@{key@} \ 400547501Spendry host==dylan;type:=ufs;dev:=/dev/dsk/5s0 400647501Spendry... 400747501Spendry# 400847501Spendrytoytown host!=$@{key@};type:=nfs;rhost:=$@{key@};rfs:=/home/$@{key@} \ 400947501Spendry host==$@{key@};type:=ufs;dev:=/dev/xy1g 401047501Spendry... 401147501Spendry# 401247501Spendryzebedee host!=$@{key@};type:=nfs;rhost:=$@{key@};rfs:=/home/$@{key@} \ 401347501Spendry host==$@{key@};type:=ufs;dev:=/dev/dsk/1s0 401447501Spendry# 401547501Spendry# Just for access... 401647501Spendry# 401747501Spendrygould type:=auto;fs:=$@{map@};pref:=$@{key@}/ 401847501Spendrygould/staff host!=gould;type:=nfs;rhost:=gould;rfs:=/home/$@{key@} 401947501Spendry# 402047501Spendrygummo host!=$@{key@};type:=nfs;rhost:=$@{key@};rfs:=/home/$@{key@} 402147501Spendry... 402247501Spendry@end example 402347501Spendry 402447501SpendryThis map is shared by most of the machines listed so on those 402547501Spendrysystems any of the user disks is accessible via a consistent name. 402647501Spendry@i{Amd} is started with the following command 402747501Spendry 402847501Spendry@example 402947501Spendryamd /home amd.home 403047501Spendry@end example 403147501Spendry 403247501SpendryNote that when mounting a remote filesystem, the @dfn{automounted} 403347501Spendrymount point is referenced, so that the filesystem will be mounted if 403447501Spendryit is not yet (at the time the remote @samp{mountd} obtains the file handle). 403547501Spendry 403647501Spendry@node Home Directories, Architecture Sharing, User Filesystems, Examples 403747501Spendry@comment node-name, next, previous, up 403847501Spendry@section Home Directories 403947501Spendry@cindex Home directories 404047501Spendry@cindex Example of mounting home directories 404147501Spendry@cindex Mount home directories 404247501Spendry 404347501SpendryOne convention for home directories is to locate them in @samp{/homes} 404447501Spendryso user @samp{jsp}'s home directory is @samp{/homes/jsp}. With more 404547501Spendrythan a single fileserver it is convenient to spread user files across 404647501Spendryseveral machines. All that is required is a mount-map which converts 404747501Spendrylogin names to an automounted directory. 404847501Spendry 404947501SpendrySuch a map might be started by the command: 405047501Spendry 405147501Spendry@example 405247501Spendryamd /homes amd.homes 405347501Spendry@end example 405447501Spendry 405547501Spendrywhere the map @samp{amd.homes} contained the entries: 405647501Spendry 405747501Spendry@example 405847501Spendry/defaults type:=link # All the entries are of type:=link 405947501Spendryjsp fs:=/home/charm/jsp 406047501Spendrynjw fs:=/home/dylan/dk5/njw 406147501Spendry... 406247501Spendryphjk fs:=/home/toytown/ai/phjk 406347501Spendrysjv fs:=/home/ganymede/sjv 406447501Spendry@end example 406547501Spendry 406647501SpendryWhenever a login name is accessed in @samp{/homes} a symbolic link 406747501Spendryappears pointing to the real location of that user's home directory. In 406847501Spendrythis example, @samp{/homes/jsp} would appear to be a symbolic link 406947501Spendrypointing to @samp{/home/charm/jsp}. Of course, @samp{/home} would also 407047501Spendrybe an automount point. 407147501Spendry 407247501SpendryThis system causes an extra level of symbolic links to be used. 407347501SpendryAlthough that turns out to be relatively inexpensive, an alternative is 407447501Spendryto directly mount the required filesystems in the @samp{/homes} 407547501Spendrymap. The required map is simple, but long, and its creation is best automated. 407647501SpendryThe entry for @samp{jsp} could be: 407747501Spendry 407847501Spendry@example 407947501Spendryjsp -sublink:=$@{key@};rfs:=/home/charm \ 408047501Spendry host==charm;type:=ufs;dev:=/dev/xd0g \ 408147501Spendry host!=charm;type:=nfs;rhost:=charm 408247501Spendry@end example 408347501Spendry 408447501SpendryThis map can become quite big if it contains a large number of entries. 408547501SpendryBy combining two other features of @i{Amd} it can be greatly simplified. 408647501Spendry 408747501SpendryFirst the UFS partitions should be mounted under the control of 408847501Spendry@samp{/etc/fstab}, taking care that they are mounted in the same place 408947501Spendrythat @i{Amd} would have automounted them. In most cases this would be 409047501Spendrysomething like @samp{/a/@dfn{host}/home/@dfn{host}} and 409147501Spendry@samp{/etc/fstab} on host @samp{charm} would have a line:@refill 409247501Spendry 409347501Spendry@example 409447501Spendry/dev/xy0g /a/charm/home/charm 4.2 rw,nosuid,grpid 1 5 409547501Spendry@end example 409647501Spendry 409747501SpendryThe map can then be changed to: 409847501Spendry 409947501Spendry@example 410047501Spendry/defaults type:=nfs;sublink:=$@{key@};opts:=rw,intr,nosuid,grpid 410147501Spendryjsp rhost:=charm;rfs:=/home/charm 410247501Spendrynjw rhost:=dylan;rfs:=/home/dylan/dk5 410347501Spendry... 410447501Spendryphjk rhost:=toytown;rfs:=/home/toytown;sublink:=ai/$@{key@} 410547501Spendrysjv rhost:=ganymede;rfs:=/home/ganymede 410647501Spendry@end example 410747501Spendry 410847501SpendryThis map operates as usual on a remote machine (@i{ie} @code{$@{host@}} 410947501Spendrynot equal to @code{$@{rhost@}}). On the machine where the filesystem is 411047501Spendrystored (@i{ie} @code{$@{host@}} equal to @code{$@{rhost@}}), @i{Amd} 411147501Spendrywill construct a local filesystem mount point which corresponds to the 411247501Spendryname of the locally mounted UFS partition. If @i{Amd} is started with 411347501Spendrythe ``-r'' option then instead of attempting an NFS mount, @i{Amd} will 411447501Spendrysimply inherit the UFS mount (@pxref{Inheritance Filesystem}). If 411547501Spendry``-r'' is not used then a loopback NFS mount will be made. This type of 411647501Spendrymount is known to cause a deadlock on many systems. 411747501Spendry 411847501Spendry@node Architecture Sharing, Wildcard Names, Home Directories, Examples 411947501Spendry@comment node-name, next, previous, up 412047501Spendry@section Architecture Sharing 412147501Spendry@cindex Architecture sharing 412247501Spendry@cindex Sharing a fileserver between architectures 412347501Spendry@cindex Architecture dependent volumes 412447501Spendry 412547501Spendry@c %At the moment some of the research machines have sets of software 412647501Spendry@c %mounted in @samp{/vol}. This contains subdirectories for \TeX, 412747501Spendry@c %system sources, local sources, prolog libraries and so on. 412847501SpendryOften a filesystem will be shared by machines of different architectures. 412947501SpendrySeparate trees can be maintained for the executable images for each 413047501Spendryarchitecture, but it may be more convenient to have a shared tree, 413147501Spendrywith distinct subdirectories. 413247501Spendry 413347501SpendryA shared tree might have the following structure on the fileserver (called 413447501Spendry@samp{fserver} in the example): 413547501Spendry 413647501Spendry@example 413747501Spendrylocal/tex 413847501Spendrylocal/tex/fonts 413947501Spendrylocal/tex/lib 414047501Spendrylocal/tex/bin 414147501Spendrylocal/tex/bin/sun3 414247501Spendrylocal/tex/bin/sun4 414347501Spendrylocal/tex/bin/hp9000 414447501Spendry... 414547501Spendry@end example 414647501Spendry 414747501SpendryIn this example, the subdirectories of @samp{local/tex/bin} should be 414847501Spendryhidden when accessed via the automount point (conventionally @samp{/vol}). 414947501SpendryA mount-map for @samp{/vol} to achieve this would look like: 415047501Spendry 415147501Spendry@example 4152*49684Spendry/defaults sublink:=$@{/key@};rhost:=fserver;type:=link 415347501Spendrytex type:=auto;fs:=$@{map@};pref:=$@{key@}/ 4154*49684Spendrytex/fonts host!=fserver;type:=nfs;rfs:=/vol/tex \ 4155*49684Spendry host==fserver;fs:=/usr/local/tex 4156*49684Spendrytex/lib host!=fserver;type:=nfs;rfs:=/vol/tex \ 4157*49684Spendry host==fserver;fs:=/usr/local/tex 4158*49684Spendrytex/bin -sublink:=$@{/key@}/$@{arch@} host!=fserver;type:=nfs;rfs:=/vol/tex \ 4159*49684Spendry host:=fserver;fs:=/usr/local/tex 416047501Spendry@end example 416147501Spendry 416247501SpendryWhen @samp{/vol/tex/bin} is referenced, the current machine architecture 416347501Spendryis automatically appended to the path by the @code{$@{sublink@}} 416447501Spendryvariable. This means that users can have @samp{/vol/tex/bin} in their 416547501Spendry@samp{PATH} without concern for architecture dependencies. 416647501Spendry 416747501Spendry@node Wildcard Names, rwho servers, Architecture Sharing, Examples 416847501Spendry@comment node-name, next, previous, up 416947501Spendry@section Wildcard names & Replicated Servers 417047501Spendry 417147501SpendryBy using the wildcard facility, @i{Amd} can @dfn{overlay} an existing 417247501Spendrydirectory with additional entries. 417347501SpendryThe system files are usually mounted under @samp{/usr}. If instead 417447501Spendry@i{Amd} is mounted on @samp{/usr}, additional 417547501Spendrynames can be overlayed to augment or replace names in the ``master'' @samp{/usr}. 417647501SpendryA map to do this would have the form: 417747501Spendry 417847501Spendry@example 417947501Spendrylocal type:=auto;fs:=local-map 418047501Spendryshare type:=auto;fs:=share-map 418147501Spendry* -type:=nfs;rfs:=/export/exec/$@{arch@};sublink:="$@{key@}" \ 418247501Spendry rhost:=fserv1 rhost:=fserv2 rhost:=fserv3 418347501Spendry@end example 418447501Spendry 418547501SpendryNote that the assignment to @code{$@{sublink@}} is surrounded by double 418647501Spendryquotes to prevent the incoming key from causing the map to be 418747501Spendrymisinterpreted. This map has the effect of directing any access to 418847501Spendry@samp{/usr/local} or @samp{/usr/share} to another automount point. 418947501Spendry 419047501SpendryIn this example, it is assumed that the @samp{/usr} files are replicated 419147501Spendryon three fileservers: @samp{fserv1}, @samp{fserv2} and @samp{fserv3}. 419247501SpendryFor any references other than to @samp{local} and @samp{share} one of 419347501Spendrythe servers is used and a symbolic link to 419447501Spendry@t{$@{autodir@}/$@{rhost@}/export/exec/$@{arch@}/@i{whatever}} is 419547501Spendryreturned once an appropriate filesystem has been mounted.@refill 419647501Spendry 419747501Spendry@node rwho servers, /vol, Wildcard Names, Examples 419847501Spendry@comment node-name, next, previous, up 419947501Spendry@section @samp{rwho} servers 420047501Spendry@cindex rwho servers 420147501Spendry@cindex Architecture specific mounts 420247501Spendry@cindex Example of architecture specific mounts 420347501Spendry 420447501SpendryThe @samp{/usr/spool/rwho} directory is a good candidate for automounting. 420547501SpendryFor efficiency reasons it is best to capture the rwho data on a small 420647501Spendrynumber of machines and then mount that information onto a large number 420747501Spendryof clients. The data written into the rwho files is byte order dependent 420847501Spendryso only servers with the correct byte ordering can be used by a client: 420947501Spendry 421047501Spendry@example 421147501Spendry/defaults type:=nfs 421247501Spendryusr/spool/rwho -byte==little;rfs:=/usr/spool/rwho \ 421347501Spendry rhost:=vaxA rhost:=vaxB \ 421447501Spendry || -rfs:=/usr/spool/rwho \ 421547501Spendry rhost:=sun4 rhost:=hp300 421647501Spendry@end example 421747501Spendry 421847501Spendry@node /vol, , rwho servers, Examples 421947501Spendry@comment node-name, next, previous, up 422047501Spendry@section @samp{/vol} 422147501Spendry@cindex /vol 422247501Spendry@cindex Catch-all mount point 422347501Spendry@cindex Generic volume name 422447501Spendry 422547501Spendry@samp{/vol} is used as a catch-all for volumes which do not have other 422647501Spendryconventional names. 422747501Spendry 422847501SpendryBelow is part of the @samp{/vol} map for the domain @samp{doc.ic.ac.uk}. 422947501SpendryThe @samp{r+d} tree is used for new or experimental software that needs 423047501Spendryto be available everywhere without installing it on all the fileservers. 423147501SpendryUsers wishing to try out the new software then simply include 423247501Spendry@samp{/vol/r+d/{bin,ucb}} in their path.@refill 423347501Spendry 423447501SpendryThe main tree resides on one host @samp{gould.doc.ic.ac.uk}, which has 423547501Spendrydifferent @samp{bin}, @samp{etc}, @samp{lib} and @samp{ucb} 423647501Spendrysub-directories for each machine architecture. For example, 423747501Spendry@samp{/vol/r+d/bin} for a Sun-4 would be stored in the sub-directory 423847501Spendry@samp{bin/sun4} of the filesystem @samp{/usr/r+d}. When it was accessed 423947501Spendrya symbolic link pointing to @samp{/a/gould/usr/r+d/bin/sun4} would be 424047501Spendryreturned.@refill 424147501Spendry 424247501Spendry@example 424347501Spendry/defaults type:=nfs;opts:=rw,grpid,nosuid,intr,soft 424447501Spendrywp -opts:=rw,grpid,nosuid;rhost:=charm \ 424547501Spendry host==charm;type:=link;fs:=/usr/local/wp \ 424647501Spendry host!=charm;type:=nfs;rfs:=/vol/wp 424747501Spendry... 424847501Spendry# 424947501Spendrysrc -opts:=rw,grpid,nosuid;rhost:=charm \ 425047501Spendry host==charm;type:=link;fs:=/usr/src \ 425147501Spendry host!=charm;type:=nfs;rfs:=/vol/src 425247501Spendry# 425347501Spendryr+d type:=auto;fs:=$@{map@};pref:=r+d/ 425447501Spendry# per architecture bin,etc,lib&ucb... 425547501Spendryr+d/bin rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}/$@{arch@} 425647501Spendryr+d/etc rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}/$@{arch@} 425747501Spendryr+d/include rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@} 425847501Spendryr+d/lib rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}/$@{arch@} 425947501Spendryr+d/man rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@} 426047501Spendryr+d/src rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@} 426147501Spendryr+d/ucb rhost:=gould.doc.ic.ac.uk;rfs:=/usr/r+d;sublink:=$@{/key@}/$@{arch@} 426247501Spendry# hades pictures 426347501Spendrypictures -opts:=rw,grpid,nosuid;rhost:=thpfs \ 426447501Spendry host==thpfs;type:=link;fs:=/nbsd/pictures \ 426547501Spendry host!=thpfs;type:=nfs;rfs:=/nbsd;sublink:=pictures 426647501Spendry# hades tools 426747501Spendryhades -opts:=rw,grpid,nosuid;rhost:=thpfs \ 426847501Spendry host==thpfs;type:=link;fs:=/nbsd/hades \ 426947501Spendry host!=thpfs;type:=nfs;rfs:=/nbsd;sublink:=hades 427047501Spendry# bsd tools for hp. 427147501Spendrybsd -opts:=rw,grpid,nosuid;arch==hp9000;rhost:=thpfs \ 427247501Spendry host==thpfs;type:=link;fs:=/nbsd/bsd \ 427347501Spendry host!=thpfs;type:=nfs;rfs:=/nbsd;sublink:=bsd 427447501Spendry@end example 427547501Spendry 427647501Spendry@node Internals, Acknowledgements & Trademarks, Examples, Top 427747501Spendry@comment node-name, next, previous, up 427847501Spendry@chapter Internals 427947501Spendry 428047501Spendry@menu 428147501Spendry* Log Messages:: 428247501Spendry@end menu 428347501Spendry 428447501Spendry@node Log Messages, , Internals, Internals 428547501Spendry@comment node-name, next, previous, up 428647501Spendry@section Log Messages 428747501Spendry 428847501SpendryIn the following sections a brief explanation is given of some of the 428947501Spendrylog messages made by @i{Amd}. Where the message is in @samp{typewriter} 429047501Spendryfont, it corresponds exactly to the message produced by @i{Amd}. Words 429147501Spendryin @dfn{italic} are replaced by an appropriate string. Variables, 429247501Spendry@code{$@{var@}}, indicate that the value of the appropriate variable is 429347501Spendryoutput. 429447501Spendry 429547501SpendryLog messages are either sent direct to a file, 429647501Spendryor logged via the @b{syslog}(3) mechanism. 429747501SpendryMessages are logged with facility @samp{LOG_DAEMON} when using @b{syslog}(3). 429847501SpendryIn either case, entries in the file are of the form: 429947501Spendry@example 430047501Spendry@i{date-string} @i{hostname} @t{amd[}@i{pid}@t{]} @i{message} 430147501Spendry@end example 430247501Spendry 430347501Spendry@menu 430447501Spendry* Fatal errors:: 430547501Spendry* Info messages:: 430647501Spendry@end menu 430747501Spendry 430847501Spendry@node Fatal errors, Info messages, Log Messages, Log Messages 430947501Spendry@comment node-name, next, previous, up 431047501Spendry@subsection Fatal errors 431147501Spendry 431247501Spendry@i{Amd} attempts to deal with unusual events. Whenever it is not 431347501Spendrypossible to deal with such an error, @i{Amd} will log an appropriate 431447501Spendrymessage and, if it cannot possibly continue, will either exit or abort. 431547501SpendryThese messages are selected by @samp{-x fatal} on the command line. 431647501SpendryWhen @b{syslog}(3) is being used, they are logged with level 431747501Spendry@samp{LOG_FATAL}. Even if @i{Amd} continues to operate it is likely to 431847501Spendryremain in a precarious state and should be restarted at the earliest 431947501Spendryopportunity. 432047501Spendry 432147501Spendry@table @asis 432247501Spendry@item @t{Attempting to inherit not-a-filesystem} 432347501SpendryThe prototype mount point created during a filesystem restart did not 432447501Spendrycontain a reference to the restarted filesystem. This erorr ``should 432547501Spendrynever happen''. 432647501Spendry 432747501Spendry@item @t{Can't bind to domain "@i{NIS-domain}"} 432847501SpendryA specific NIS domain was requested on the command line, but no server 432947501Spendryfor that domain is available on the local net. 433047501Spendry 433147501Spendry@item @t{Can't determine IP address of this host (@i{hostname})} 433247501SpendryWhen @i{Amd} starts it determines its own IP address. If this lookup 433347501Spendryfails then @i{Amd} cannot continue. The hostname it looks up is that 433447501Spendryobtained returned by @b{gethostname}(2) system call. 433547501Spendry 433647501Spendry@item @t{Can't find root file handle for @i{automount point}} 433747501Spendry@i{Amd} creates its own file handles for the automount points. When it 433847501Spendrymounts itself as a server, it must pass these file handles to the local 433947501Spendrykernel. If the filehandle is not obtainable the mount point is ignored. 434047501SpendryThis error ``should never happen''. 434147501Spendry 434247501Spendry@item @t{Must be root to mount filesystems (euid = @i{euid})} 434347501SpendryTo prevent embarrassment, @i{Amd} makes sure it has appropriate system 434447501Spendryprivileges. This amounts to having an euid of 0. The check is made 434547501Spendryafter argument processing complete to give non-root users a chance to 434647501Spendryaccess the ``-v'' option. 434747501Spendry 434847501Spendry@item @t{No work to do - quitting} 434947501SpendryNo automount points were given on the command line and so there is no 435047501Spendrywork to do. 435147501Spendry 435247501Spendry@item @t{Out of memory in realloc} 435347501SpendryWhile attempting to realloc some memory, the memory space available to 435447501Spendry@i{Amd} was exhausted. This is an unrecoverable error. 435547501Spendry 435647501Spendry@item @t{Out of memory} 435747501SpendryWhile attempting to malloc some memory, the memory space available to 435847501Spendry@i{Amd} was exhausted. This is an unrecoverable error. 435947501Spendry 436047501Spendry@item @t{cannot create rpc/udp service} 436147501SpendryEither the NFS or AMQ endpoint could not be created. 436247501Spendry 436347501Spendry@item @t{gethostname:} @i{description} 436447501SpendryThe @b{gethostname}(2) system call failed during startup. 436547501Spendry 436647501Spendry@item @t{host name is not set} 436747501SpendryThe @b{gethostname}(2) system call returned a zero length host name. 436847501SpendryThis can happen if @i{Amd} is started in single user mode just after 436947501Spendrybooting the system. 437047501Spendry 437147501Spendry@item @t{ifs_match called!} 437247501SpendryAn internal error occurred while restarting a pre-mounted filesystem. 437347501SpendryThis error ``should never happen''. 437447501Spendry 437547501Spendry@item @t{mount_afs:} @i{description} 437647501SpendryAn error occured while @i{Amd} was mounting itself. 437747501Spendry 437847501Spendry@item @t{run_rpc failed} 437947501SpendrySomehow the main NFS server loop failed. This error ``should never 438047501Spendryhappen''. 438147501Spendry 438247501Spendry@item @t{unable to free rpc arguments in amqprog_1} 438347501SpendryThe incoming arguments to the AMQ server could not be free'ed. 438447501Spendry 438547501Spendry@item @t{unable to free rpc arguments in nfs_program_1} 438647501SpendryThe incoming arguments to the NFS server could not be free'ed. 438747501Spendry 438847501Spendry@item @t{unable to register (AMQ_PROGRAM, AMQ_VERSION, udp)} 438947501SpendryThe AMQ server could not be registered with the local portmapper or the 439047501Spendryinternal RPC dispatcher. 439147501Spendry 439247501Spendry@item @t{unable to register (NFS_PROGRAM, NFS_VERSION, 0)} 439347501SpendryThe NFS server could not be registered with the internal RPC dispatcher. 439447501Spendry 439547501Spendry@end table 439647501Spendry 439747501Spendry@node Info messages, , Fatal errors, Log Messages 439847501Spendry@comment node-name, next, previous, up 439947501Spendry@subsection Info messages 440047501Spendry 440147501Spendry@i{Amd} generates information messages to record state changes. These 440247501Spendrymessages are selected by @samp{-x info} on the command line. When 440347501Spendry@b{syslog}(3) is being used, they are logged with level @samp{LOG_INFO}. 440447501Spendry 440547501SpendryThe messages listed below can be generated and are in a format suitable 440647501Spendryfor simple statistical analysis. @dfn{mount-info} is the string 440747501Spendrythat is displayed by @dfn{Amq} in its mount information column and 440847501Spendryplaced in the system mount table. 440947501Spendry 441047501Spendry@table @asis 441147501Spendry@item @t{mount of "@t{$@{@i{path}@}}" on @t{$@{@i{fs}@}} timed out} 441247501SpendryAttempts to mount a filesystem for the given automount point have failed 441347501Spendryto complete within 30 seconds. 441447501Spendry 441547501Spendry@item @t{"@t{$@{@i{path}@}}" forcibly timed out} 441647501SpendryAn automount point has been timed out by the @i{Amq} command. 441747501Spendry 441847501Spendry@item @t{restarting @i{mount-info} on @t{$@{@i{fs}@}}} 441947501SpendryA pre-mounted file system has been noted. 442047501Spendry 442147501Spendry@item @t{"@t{$@{@i{path}@}}" has timed out} 442247501SpendryNo access to the automount point has been made within the timeout 442347501Spendryperiod. 442447501Spendry 442547501Spendry@item @t{file server @t{$@{@i{rhost}@}} is down - timeout of "@t{$@{@i{path}@}}" ignored} 442647501SpendryAn automount point has timed out, but the corresponding file server is 442747501Spendryknown to be down. This message is only produced once for each mount 442847501Spendrypoint for which the server is down. 442947501Spendry 443047501Spendry@item @t{Re-synchronizing cache for map @t{$@{@i{map}@}}} 443147501SpendryThe named map has been modified and the internal cache is being re-synchronized. 443247501Spendry 443347501Spendry@item @t{Filehandle denied for "@t{$@{@i{rhost}@}}:@t{$@{@i{rfs}@}}"} 443447501SpendryThe mount daemon refused to return a file handle for the requested filesystem. 443547501Spendry 443647501Spendry@item @t{Filehandle error for "$@{@i{rhost}@}:$@{@i{rfs}@}":} @i{description} 443747501SpendryThe mount daemon gave some other error for the requested filesystem. 443847501Spendry 443947501Spendry@item @t{file server @t{$@{@i{rhost}@}} type nfs starts up} 444047501SpendryA new NFS file server has been referenced and is known to be up. 444147501Spendry 444247501Spendry@item @t{file server @t{$@{@i{rhost}@}} type nfs starts down} 444347501SpendryA new NFS file server has been referenced and is known to be down. 444447501Spendry 444547501Spendry@item @t{file server @t{$@{@i{rhost}@}} type nfs is up} 444647501SpendryAn NFS file server that was previously down is now up. 444747501Spendry 444847501Spendry@item @t{file server @t{$@{@i{rhost}@}} type nfs is down} 444947501SpendryAn NFS file server that was previously up is now down. 445047501Spendry 445147501Spendry@item @t{Finishing with status @i{exit-status}} 445247501Spendry@i{Amd} is about to exit with the given exit status. 445347501Spendry 445447501Spendry@item @t{@i{mount-info} mounted fstype @t{$@{@i{type}@}} on @t{$@{@i{fs}@}}} 445547501SpendryA new file system has been mounted. 445647501Spendry 445747501Spendry@item @t{@i{mount-info} restarted fstype @t{$@{@i{type}@}} on @t{$@{@i{fs}@}}} 445847501Spendry@i{Amd} is using a pre-mounted filesystem to satisfy a mount request. 445947501Spendry 446047501Spendry@item @t{@i{mount-info} unmounted fstype @t{$@{@i{type}@}} from @t{$@{@i{fs}@}}} 446147501SpendryA file system has been unmounted. 446247501Spendry 446347501Spendry@item @t{@i{mount-info} unmounted fstype @t{$@{@i{type}@}} from @t{$@{@i{fs}@}} link @t{$@{@i{fs}@}}/@t{$@{@i{sublink}@}}} 446447501SpendryA file system of which only a sub-directory was in use has been unmounted. 446547501Spendry 446647501Spendry@end table 446747501Spendry 446847501Spendry@node Acknowledgements & Trademarks, Index, Internals, Top 446947501Spendry@comment node-name, next, previous, up 447047501Spendry@unnumbered Acknowledgements & Trademarks 447147501Spendry 447247501SpendryThanks to the Formal Methods Group at Imperial College for 447347501Spendrysuffering patiently while @i{Amd} was being developed on their machines. 447447501Spendry 447547501SpendryThanks to the many people who have helped with the development of 447647501Spendry@i{Amd}, especially Piete Brooks at the Cambridge University Computing 447747501SpendryLab for many hours of testing, experimentation and discussion. 447847501Spendry 447947501Spendry@itemize @bullet 448047501Spendry@item 448147501Spendry@b{DEC}, @b{VAX} and @b{Ultrix} are registered trademarks of Digital 448247501SpendryEquipment Corporation. 448347501Spendry@item 448447501Spendry@b{AIX} and @b{IBM} are registered trademarks of International Business 448547501SpendryMachines Corporation. 448647501Spendry@item 448747501Spendry@b{Sun}, @b{NFS} and @b{SunOS} are registered trademarks of Sun 448847501SpendryMicrosystems, Inc. 448947501Spendry@item 449047501Spendry@b{Unix} is a registered trademark of AT&T Bell Laboratories in the USA 449147501Spendryand other countries. 449247501Spendry@end itemize 449347501Spendry 449447501Spendry@node Index, , Acknowledgements & Trademarks, Top 449547501Spendry@unnumbered Index 449647501Spendry 449747501Spendry@printindex cp 449847501Spendry 449947501Spendry@contents 450047501Spendry@bye 4501