📄 amdref.texinfo
字号:
A @dfn{location-selection} is a list of possible volumes with which tosatisfy the request. @dfn{location-selection}s are separated by the@samp{||} operator. The effect of this operator is to prevent use oflocation-selections to its right if any of the location-selections onits left were selected whether or not any of them were successfullymounted (@pxref{Selectors}).@refillThe location-selection, and singleton @dfn{location-list},@samp{type:=ufs;dev:=/dev/xd1g} would inform @i{Amd} to mount a UFSfilesystem from the block special device @file{/dev/xd1g}.The @dfn{sel-or-opt} component is either the name of an option requiredby a specific filesystem, or it is the name of a built-in, predefinedselector such as the architecture type. The value may be quoted withdouble quotes @samp{"}, for example@samp{type:="ufs";dev:="/dev/xd1g"}. These quotes are stripped when thevalue is parsed and there is no way to get a double quote into a valuefield. Double quotes are used to get white space into a value field,which is needed for the program filesystem (@pxref{Program Filesystem}).@refill@menu* Map Defaults::* Variable Expansion::* Selectors::* Map Options::@end menu@node Map Defaults, Variable Expansion, Location Format, Location Format@comment node-name, next, previous, up@subsection Map Defaults@cindex Map defaults@cindex How to set default map parameters@cindex Setting default map parametersA location beginning with a dash @samp{-} is used to specify defaultvalues for subsequent locations. Any previously specified defaults inthe location-list are discarded. The default string can be empty inwhich case no defaults apply.The location @samp{-fs:=/mnt;opts:=ro} would set the local mount pointto @file{/mnt} and cause mounts to be read-only by default. Defaultsspecified this way are appended to, and so override, any global mapdefaults given with @samp{/defaults}).@c@c A @samp{/defaults} value @dfn{gdef} and a location list@c \begin{quote}@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$@c \end{quote}@c is equivalent to@c \begin{quote}@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$@c \end{quote}@c which is equivalent to@c \begin{quote}@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$@c \end{quote}@node Variable Expansion, Selectors, Map Defaults, Location Format@comment node-name, next, previous, up@subsection Variable Expansion@cindex Variable expansion@cindex How variables are expanded@cindex Pathname operators@cindex Domain stripping@cindex Domainname operators@cindex Stripping the local domain name@cindex Environment variables@cindex How to access environment variables in mapsTo allow generic location specifications @i{Amd} does variable expansionon each location and also on some of the option strings. Any option orselector appearing in the form @code{$@dfn{var}} is replaced by thecurrent value of that option or selector. For example, if the value of@code{$@{key@}} was @samp{bin}, @code{$@{autodir@}} was @samp{/a} and@code{$@{fs@}} was `@t{$@{autodir@}}@t{/local/}@t{$@{key@}}' thenafter expansion @code{$@{fs@}} would have the value @samp{/a/local/bin}.Any environment variable can be accessed in a similar way.@refillTwo pathname operators are available when expanding a variable. If thevariable name begins with @samp{/} then only the last component ofthen pathname is substituted. For example, if @code{$@{path@}} was@samp{/foo/bar} then @code{$@{/path@}} would be expanded to @samp{bar}.Similarly, if the variable name ends with @samp{/} then all but thelast component of the pathname is substituted. In the previous example,@code{$@{path/@}} would be expanded to @samp{/foo}.@refillTwo domain name operators are also provided. If the variable namebegins with @samp{.} then only the domain part of the name issubstituted. For example, if @code{$@{rhost@}} was@samp{swan.doc.ic.ac.uk} then @code{$@{.rhost@}} would be expanded to@samp{doc.ic.ac.uk}. Similarly, if the variable name ends with @samp{.}then only the host component is substituted. In the previous example,@code{$@{rhost.@}} would be expanded to @samp{swan}.@refillVariable expansion is a two phase process. Before a location is parsed,all references to selectors, @i{eg} @code{$@{path@}}, are expanded. Thelocation is then parsed, selections are evaluated and option assignmentsrecorded. If there were no selections or they all succeeded thelocation is used and the values of the following options are expanded inthe order given: @var{sublink}, @var{rfs}, @var{fs}, @var{opts},@var{remopts}, @var{mount} and @var{unmount}.Note that expansion of option values is done after @dfn{all} assignmentshave been completed and not in a purely left to right order as is doneby the shell. This generally has the desired effect but care must betaken if one of the options references another, in which case theordering can become significant.There are two special cases concerning variable expansion:@enumerate@itembefore a map is consulted, any selectors in the name receivedfrom the kernel are expanded. For example, if the request from thekernel was for `@t{$@{arch@}}@t{.bin}' and the machine architecturewas @samp{vax}, the value given to @code{$@{key@}} would be@samp{vax.bin}.@refill@itemthe value of @code{$@{rhost@}} is expanded and normalized before theother options are expanded. The normalization process strips any localsub-domain components. For example, if @code{$@{domain@}} was@samp{Berkeley.EDU} and @code{$@{rhost@}} was initially@samp{snow.Berkeley.EDU}, after the normalization it would simply be@samp{snow}. Hostname normalization is currently done in a@emph{case-dependent} manner.@refill@end enumerate@node Selectors, Map Options, Variable Expansion, Location Format@comment node-name, next, previous, up@subsection Selectors@cindex SelectorsSelectors are used to control the use of a location. It is possible toshare a mount map between many machines in such a way that filesystemlocation, architecture and operating system differences are hidden fromthe users. A selector of the form @samp{arch==sun3;os==sos4} would onlyapply on Sun-3s running SunOS 4.x.Selectors are evaluated left to right. If a selector fails then thatlocation is ignored. Thus the selectors form a conjunction and thelocations form a disjunction. If all the locations are ignored orotherwise fail then @i{Amd} uses the @dfn{error} filesystem(@pxref{Error Filesystem}). This is equivalent to having a location@samp{type:=error} at the end of each mount-map entry.@refillThe selectors currently implemented are:@table @samp@cindex arch, mount selector@cindex Mount selector; arch@cindex Selector; arch@item archthe machine architecture which was automatically determined at compiletime. The architecture type can be displayed by running the command@samp{amd -v}. @xref{Supported Machine Architectures}.@refill@item autodir@cindex autodir, mount selector@cindex Mount selector; autodir@cindex Selector; autodirthe default directory under which to mount filesystems. This may bechanged by the ``-a'' command line option. See the @var{fs} option.@item byte@cindex byte, mount selector@cindex Mount selector; byte@cindex Selector; bytethe machine's byte ordering. This is either @samp{little}, indicatinglittle-endian, or @samp{big}, indicating big-endian. One possible useis to share @samp{rwho} databases (@pxref{rwho servers}). Another is toshare ndbm databases, however this use can be considered a courageousjuggling act.@item cluster@cindex cluster, mount selector@cindex Mount selector; cluster@cindex Selector; clusteris provided as a hook for the name of the local cluster. This can beused to decide which servers to use for copies of replicatedfilesystems. @code{$@{cluster@}} defaults to the value of@code{$@{domain@}} unless a different value is set with the ``-C''command line option.@item domain@cindex domain, mount selector@cindex Mount selector; domain@cindex Selector; domainthe local domain name as specified by the ``-d'' command line option.See @samp{host}.@item host@cindex host, mount selector@cindex Mount selector; host@cindex Selector; hostthe local hostname as determined by @b{gethostname}(2). If no domainname was specified on the command line and the hostname contains aperiod @samp{.} then the string before the period is used as thehost name, and the string after the period is assigned to@code{$@{domain@}}. For example, if the hostname is@samp{styx.doc.ic.ac.uk} then @code{host} would be @samp{styx} and@code{domain} would be @samp{doc.ic.ac.uk}. @code{hostd} would be@samp{styx.doc.ic.ac.uk}.@refill@item hostd@cindex hostd, mount selector@cindex Mount selector; hostd@cindex Selector; hostdis @code{$@{host@}} and @code{$@{domain@}} concatenated with a@samp{.} inserted between them if required. If @code{$@{domain@}}is an empty string then @code{$@{host@}} and @code{$@{hostd@}} will beidentical.@item karch@cindex karch, mount selector@cindex Mount selector; karch@cindex Selector; karchis provided as a hook for the kernel architecture. This is used onSunOS 4, for example, to distinguish between different @samp{/usr/kvm}volumes. @code{$@{karch@}} defaults to the value of @code{$@{arch@}}unless a different value is set with the ``-k'' command line option.@item os@cindex os, mount selector@cindex Mount selector; os@cindex Selector; osthe operating system. Like the machine architecture, this isautomatically determined at compile time. The operating system name canbe displayed by running the command @samp{amd -v}. @xref{SupportedOperating Systems}.@refill@end tableThe following selectors are also provided. Unlike the other selectors,they vary for each lookup. Note that when the name from the kernel isexpanded prior to a map lookup, these selectors are all defined as emptystrings.@table @samp@item key@cindex key, mount selector@cindex Mount selector; key@cindex Selector; keythe name being resolved. For example, if @file{/home} is an automountpoint, then accessing @file{/home/foo} would set @code{$@{key@}} to thestring @samp{foo}. The key is prefixed by the @var{pref} option set inthe parent mount point. The default prefix is an empty string. If theprefix was @file{blah/} then @code{$@{key@}} would be set to@file{blah/foo}.@refill@item map@cindex map, mount selector@cindex Mount selector; map@cindex Selector; mapthe name of the mount map being used.@item path@cindex path, mount selector@cindex Mount selector; path@cindex Selector; paththe full pathname of the name being resolved. For example@file{/home/foo} in the example above.@item wire@cindex wire, mount selector@cindex Mount selector; wire@cindex Selector; wirethe name of the network to which the primary network interface isattached. If a symbolic name cannot be found in the networks or hostsdatabase then dotted IP address format is used. This value is alsooutput by the ``-v'' option.@end tableSelectors can be negated by using @samp{!=} instead of @samp{==}. Forexample to select a location on all non-Vax machines the selector@samp{arch!=vax} would be used.@node Map Options, , Selectors, Location Format@comment node-name, next, previous, up@subsection Map Options@cindex Map options@cindex Setting map optionsOptions are parsed concurrently with selectors. The difference is thatwhen an option is seen the string following the @samp{:=} isrecorded for later use. As a minimum the @var{type} option must bespecified. Each filesystem type has other options which must also bespecified. @xref{Filesystem Types}, for details on the filesystemspecific options.@refillSuperfluous option specifications are ignored and are not reportedas errors.The following options apply to more than one filesystem type.@menu* delay Option::* fs Option::* opts Option::* remopts Option::* sublink Option::* type Option::@end menu@node delay Option, fs Option, Map Options, Map Options@comment node-name, next, previous, up@subsubsection delay Option@cindex Setting a delay on a mount location@cindex Delaying mounts from specific locations@cindex Primary server@cindex Secondary server@cindex delay, mount option@cindex Mount option; delayThe delay, in seconds, before an attempt will be made to mount from the current location.Auxilliary data, such as network address, file handles and so on are computedregardless of this value.A delay can be used to implement the notion of primary and secondary file servers.The secondary servers would have a delay of a few seconds,thus giving the primary servers a chance to respond first.@node fs Option, opts Option, delay Option, Map Options@comment node-name, next, previous, up@subsubsection fs Option@cindex Setting the local mount point@cindex Overriding the default mount point@cindex fs, mount option@cindex Mount option; fs
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -