Seth Woolley's Man Viewer

autofs(5) - autofs - Format of the automounter maps - man 5 autofs

([section] manual, -k keyword, -K [section] search, -f whatis)
man plain no title

AUTOFS(5)                                                            AUTOFS(5)

AUTOFS(5)                                                            AUTOFS(5)

       autofs - Format of the automounter maps

       The  automounter  maps  are files or NIS maps referred to by the master(5,8)
       map of the automounter  (see  auto.master(5)).   The  automounter  maps
       describe how file(1,n) systems below the mountpoint of the map (given in(1,8) the
       auto.master file(1,n)) are to be mounted.  This describes the sun  map  for-
       mat;  if(3,n) another map format is specified (e.g. hesiod), this documenta-
       tion does not apply.

       Maps can be changed on the fly and the automouter will recognize  those
       changes  on  the  next  operation it performs on that map.  This is not
       true for the auto.master map!

       This is a description of the text file(1,n) format.  Other methods of speci-
       fying these files may exist.  All empty lines or lines beginning with #
       are ignored. The basic format of one line in(1,8) such maps is:

       key [-options] location

       For indirect mounts this is the part of the pathname between the mount-
       pointi  and the path into the filesystem mounted. Usually you can think
       about the key as a subdirectory name below the mountpoint.

       For direct mounts this is the full path of the mountpoint. This map  is
       always associated with the /- mountpoint in(1,8) the master(5,8) map.

       Options  are  optional.   Options  can also be given in(1,8) the auto.master
       file(1,n) in(1,8) which case both values are cumulative  (this  is  a  difference
       from SunOS).  The options are a list of comma separated options as cus-
       tomary for the mount(2,8)(8) command. There are two special options -fstype=
       used  to  specify  a  filesystem  type  if(3,n) the filesystem is not of the
       default NFS type.  This option is processed by the automounter and  not
       by  the  mount(2,8)  command.  -strict is used to treat errors when mounting
       file(1,n) systems as fatal. This is important  when  multiple  file(1,n)  systems
       should  be  mounted  (`multimounts').  If this option is given, no file(1,n)
       system is mounted at all if(3,n) at least one file(1,n) system can't be  mounted.

       The location specifies from where the file(1,n) system is to be mounted.  In
       the most cases this will be  an  NFS  volume  and  the  usual  notation
       host:pathname  is used to indicate the remote filesystem and path to be
       mounted.  If the filesystem to be mounted begins  with  a  /  (such  as
       local  /dev  entries  or  smbfs  shares) a : needs to be prefixed (e.g.

         kernel    -ro,soft,intr
         boot      -fstype=ext2        :/dev/hda1
         windoze   -fstype=smbfs       ://windoze/c
         removable -fstype=ext2        :/dev/hdd
         cd        -fstype=iso9660,ro  :/dev/hdc
         floppy    -fstype=auto(5,8)        :/dev/fd0
         server    -rw,hard,intr       / -ro \
                                       /usr \

       In the first line we have a NFS remote mount(2,8) of the kernel directory on   This is mounted read-only.  The second line mounts an
       ext2 volume on a local ide drive.  The third  makes  a  share  exported
       from  a Windows machine available for automounting.  The rest should be
       fairly self-explanatory. The last entry (the last three  lines)  is  an
       example of a multi-map (see below).

       If  you use the automounter for a filesystem without access(2,5) permissions
       (like vfat), users(1,5) usually can't write(1,2) on such a filesystem because  it
       is  mounted  as  user  root.  You can solve this problem by passing the
       option gid=<gid>, e. g. gid=floppy. The filesystem is then  mounted  as
       group floppy instead of root. Then you can add the users(1,5) to this group,
       and they can write(1,2) to the filesystem. Here's an example  entry  for  an
       autofs map:

         floppy-vfat  -fstype=vfat,sync(1,2,8),gid=floppy,umask=002  :/dev/fd0

   Map Key Substitution
       An  &  character  in(1,8)  the  location is expanded to the value of the key
       field that matched the line (which probably only makes  sense  together
       with a wildcard key).

   Wildcard Key
       A * in(1,8) the key field of indirect maps matches all keys.  An example for
       the usefulness is the following entry:

         *         &:/home/&

       This will enable you to access(2,5) all the home directory  of  local  hosts
       using the path /mountpoint/hostname/local-path.

   Variable Substitution
       The  following  special  variables  will  be substituted in(1,8) the key and
       location fields of an automounter map if(3,n) prefixed with $  as  customary
       from  shell  scripts  (Curly  braces can be used to separate the field-

         ARCH           Architecture (uname(1,2) -m)
         CPU            Processor Type
         HOST           Hostname (uname(1,2) -n)
         OSNAME         Operating System (uname(1,2) -s)
         OSREL          Release of OS (uname(1,2) -r)
         OSVERS         Version of OS (uname(1,2) -v)

       Additional entries can be defined with the -Dvariable=Value  map-option
       to automount(8).

   Executable Maps
       A  map  can  be  marked as executable.  The init script that parses the
       auto.master map will pass this as a program map to the automounter.   A
       program map will be called as a script with the key as an argument.  It
       may return no lines of output if(3,n) there's an error(8,n), or one or more lines
       containing a map (with \ quoting line breaks).

       To  use  a  program map, the automount(8) daemon has to be started with
       the program type instead of the file(1,n) type.  This is implemented in(1,8)  the
       initialization script.

       A  executable  map  can  return an errorcode to indicate the failure in(1,8)
       addition to no output at all.  All output sent to stderr is logged into
       the system logs.

   Multiple Mounts
       A  multi-mount  map  can be used to name multiple filesystems to mount.
       It takes the form:

         key [-options] [mountpoint [-options] location...]...

       This may extend over multiple lines, quoting the line-breaks with  `\.
       If  present,  the  per-mountpoint  mount-options  are  appended  to the
       default mount-options.

   Replicated Server
         Multiple replicated hosts, same path:
         <path> host1,host2,hostn:/path/path

         Multiple hosts, some with same path, some with another
         <path> host1,host2:/blah host3:/some/other/path

         Multiple replicated hosts, different (potentially) paths:
         <path> host1:/path/pathA host2:/path/pathB

         Mutliple weighted, replicated hosts same path:
         <path> host1(5),host2(6),host3(1):/path/path

         Multiple weighted, replicated hosts different (potentially) paths:
         <path> host1(3):/path/pathA host2(5):/path/pathB

         Anything else is questionable and unsupported, but these variations will also work:
         <path> host1(3),host:/blah

       This version(1,3,5) of the automounter supports direct maps for FILE, NIS  and
       LDAP  maps  only and handles SunOS-style replicated filesystems only to
       the extent that mount(2,8)(8) does.

       Unlike Sun's multi-mount syntax, the mountpoint is  mandatory  for  all

       automount(8), auto.master(5), autofs(8), mount(2,8)(8).

       This  manual  page was written by Christoph Lameter <>,
       for the Debian GNU/Linux system.  Edited by H. Peter Anvin  <hpa@trans->,   Jeremy   Fitzhardinge   <>   and  Ian  Kent

                                  14 Jan 2000                        AUTOFS(5)

References for this manual (incoming links)