名称(NAME)
automount - 配置autofs的挂载点
命令概要(SYNOPSIS)
automount [options] mount-point map-type[,format] map [map-options]
描述(DESCRIPTION)
automount 程序能用于配置autofs(Linux内嵌的自动装填机)的挂载点。 automount 保存一个基本的 mount-point 文件以及对应的一系列 map 文件,通过这些文件(要与其它options合用),无论何时以何种方式访问 mount-point 下的文件系统,automounter都能自动挂载它们。文件系统在被挂载前是不可用的。(注:例如我把windows下的C盘用自动挂载器挂装在/misc/C下面,系统启动完毕后直接用ls /misc是看不见“C”这个目录的。这跟mount的结果不一样。但如果用cd /misc/C却可以进入。而且不用预先建立/misc/C这个目录,但/misc必须已经存在。这就是上面***一句话的真正意思。原文如下:The filesystems are then automounted after a period of inactivity)
选项(OPTIONS)
- -p, --pid-file
- 把进程号保存到一个指定的文件
- -t, --timeout
- 以多少秒来设定一个最短卸载时间。默认值是5分钟。把timeout设为0可以避免被自动卸载。
- -v, --version
- 显示程序版本信息并退出
参数(ARGUMENTS)
automount 命令至少需要三个参数。它们是 mount-point, map-type 和 map。下面详细说明了必要的参数以及其它一些可选参数。
- mount-point
- 为autofs准备的基本安装点。这必须是一个系统中已经预先建立好的目录名。
- map-type
- 为automount 准备的映射类型。以下这些都是有效的类型名字:
- file
- 映射是一个常规文本文件
- program
- 映射是一个可执行程序文件,被key以命令行方式传送给程序。如果成功的话会在标准输出设备上返回一个信息。
- yp
- 映射是一个NIS(YP)数据库(注:NIS为网络信息服务,YP是yellow page的意思,这里还是不译为好)
- nisplus
- 映射是一个NIS+ 数据库
- hesiod
- 映射是一个包含 filsys (被映射使用)记录的hesiod数据库
- ldap
- 映射名以 [servername:]basedn 的形式组合而成,可选项 servername 表示要查寻的LDAP服务器的名字,而 basedn 则是用于下层子树查找的DN。那些在指定子树下的automount对象就是我们要的记录。记录中的cn 就是key(通配符是“/”),而automounterInformation 含有能被automounter使用的信息。有关这一问题的文档能从以下网址获得 http://docs.iplanet.com/docs/manuals/directory/411ext/nis/mapping.htm.
- format
- 映射文件的数据格式;目前只支持sun系统下的格式,它是Sun automounter map和 hesiod下的hesiod文件系统记录的一个子集。如果未指明文件格式的话,系统默认这些映射文件全是sun系统下的格式,而不是hesiod。
- map
- 映射文件的位置。若映射类型是file 或者 program的话这将是一个UNIX 下的绝对路径。若映射类型是yp、nisplus或者是hesiod的话,这就是一个数据库名。
- options
- 其它没有用连字号(-) 开始的命令行中的参数都被认为是mount的选项(-o)。以连字号开始的参数被视为送给上面map参数的选项。
注意(NOTES)
如果automount 进程捕获信号 USR1,它会卸载当前所有未使用的与autofs有关的文件系统并继续运行automount(即强制卸载)。如果捕获信号 USR2,那会卸载当前所有未使用的与autofs 有关的文件系统,如果所有系统都卸载完毕,automount就退出。正在使用的文件系统不能被卸载。
参看(SEE ALSO)
autofs(5), mount(8).
#p#
NAME
automount - configure mount points for autofs
SYNOPSIS
automount [options] mount-point map-type[,format] map [map-options]
DESCRIPTION
The automount program is used to configure a mount point for autofs, the inlined Linux automounter. automount works by taking a base mount-point and map file, and using these (combined with other options) to automatically mount filesystems within the base mount-point when they are accessed in any way. The filesystems are then autounmounted after a period of inactivity.
OPTIONS
- -p, --pid-file
- Write the pid of the daemon to the specified file.
- -t, --timeout
- Set the minimum timeout, in seconds, until directories are unmounted. The default is 5 minutes. Setting the timeout to zero disables unmounts completely.
- -v, --verbose
- Enables printing of general status and progress messages.
- -d, --debug
- Enables printing of general status and progress messages as well as debuging messages.
- -g, --ghost
- Request that directories in the automount be shown but not mounted until accesssed. The wildcard map is not ghosted.
- -V, --version
- Display the version number, then exit.
ARGUMENTS
automount takes at least three arguments. Mandatory arguments include mount-point, map-type and map. Both mandatory and optional arguments are described below.
- mount-point
- Base location for autofs-mounted filesystems to be attached. This is a directory name which must already exist.
- map-type
- Type of map used for this invocation of automount. The following are valid map types:
- file
- The map is a regular text file.
- program
- The map is an executable program, which is passed a key on the command line and returns an entry on stdout if successful.
- yp
- The map is a NIS (YP) database.
- nisplus
- The map is a NIS+ database.
- hesiod
- The map is a hesiod database whose filsys entries are used for maps.
- ldap
- map names are of the form [//servername/]basedn, where the optional servername is the name of the LDAP server to query, and basedn is the DN to do a subtree search under. Two LDAP schema are supported. The i automountMap and the nisMap (RFC 2307) object classes. Entries in the automountMap schema are automount objects in the specified subtree, where the cn attribute is the key (the wildcard key is "/"), and the automountInformation attribute contains the information used by the automounter. Documentation on the schema used by this module is available online at http://docs.sun.com/source/806-4251-10/mapping.htm. RFC 2307 schema entries are nisObject objects and use the cn attribute as the key and the nisMapEntry contains information used by the automounter. Format of the map data; currently the only formats
- format
- recognized are sun, which is a subset of the Sun automounter map format, and hesiod, for hesiod filesys entries. If the format is left unspecified, it defaults to sun for all map types except hesiod.
- map
- Location of mapfile to use. This is an absolute UNIX pathname in the case for maps of types file or program, and the name of a database in the case for maps of type yp, nisplus, or hesiod.
- options
- Any remaining command line arguments without leading dashes (-) are taken as options (-o) to mount. Arguments with leading dashes are considered options for the maps.
The sun format supports the following options:
- -Dvariable=value
- Replace variable with value in map substitutions.
- -strict
- Treat errors when mounting file systems as fatal. This is important when multiple file systems should be mounted (`multimounts'). If this option is given, no file system is mounted at all if at least one file system can't be mounted.
NOTES
If the automount daemon catches signal USR1, it will unmount all currently unused autofs-mounted filesystems and continue running (forced expire). If it catches signals TERM or USR2 it will unmount all unused autofs-mounted filesystems and exit if all filesystems were unmounted. Busy filesystems will not be unmounted. The daemon also responds to a HUP signal which triggers an update of maps for which ghosting is implemented (currently FILE and NIS maps). If the autofs directory itself is busy when the daemon is signalled with an exit signal then the daemon will exit without unmounting the autofs filesystem. The filesystem is left in a catatonic (non-functional) state, and can be unmounted when it becomes unused.
SEE ALSO
autofs(5), mount(8).