[ Prev ] [ Index ] [ Next ]

autofs

image Note: This is not really a HOW-TO, it's simply an example autofs with a few notes. Refactor or remove

See Also

The automounter is tightly coupled with:

Example /etc/autofs

# # $Id: auto.misc,v 1.2 2003/09/29 08:22:35 raven Exp $ # # This is an automounter map and it has the following format # key [ -mount-options-separated-by-comma ] location # Details may be found in the autofs(5) manpage

# fixed media c-drive -fstype=ntfs,ro,pamconsole,uid=1006,gid=1006,umask=0222 :/dev/hda1 d-drive -fstype=ntfs,ro,pamconsole,uid=1006,gid=1006,umask=0222 :/dev/hda5

# removable media cd1 -fstype=iso9660,ro,pamconsole,nosuid,nodev :/dev/hdc cd2 -fstype=iso9660,ro,pamconsole,nosuid,nodev :/dev/hdd memstick -fstype=vfat,rw,noauto,uid=nobody,gid=usb,umask=0022 :/dev/sdd1 flashcard -fstype=vfat,rw,noauto,uid=nobody,gid=usb,umask=0022 :/dev/sda1

## # Network drives nfs/smbfs/ntfs # # The the smb version of joslyn public is commented out because we're using nfs for the moment. # Note, both smbfs and nfs cause problems with the automounter when the automount share # is accessed but the server providing the shares is not available. The "soft" and "intr" # options can be specified so that the mount request will timeout and abort after a # set period. Further, the "bg" option can be specified which tells the automounter # to background retry request for the failed share (and all subsequent shares from # that server). # # Important: Note, specifying an option of "hard" will cause the machine attempting # to access the server to hang (continously retry the mount request) until the server # providing the share comes back onto the network. This can be a really bad idea if the # server providing the share is a workstation/laptop that may be shutdown, removed or # generally not available. In general, specify "soft" with "intr" over "hard" for shares # to non-robust servers. # # The nfs/smbfs mount(8) doco says that it's possible to sepecify a timeout option # "timeo=i" with values to the 10th of a second and in addition it's possible to specify # the number of retries to perform "retries=j". However, in practice, it appears the # defaults are fine and setting "timeo" and "retries" to their lowest values doesn't # really help with if the providing server is absent. It appears that the best option # is to actually comment out the smbfs/nfs automount entries for machines that are known # to be absent from the network. After editing the /etc/auto.misc (or whatever automounter # component), stop and restart the automounter with autofs(1) as root: # # root # /etc/init.d/autofs stop; /etc/init.d/autofs start # # For smbfs shares, the options are similar to nfs, except that it's pssible to specify # the file creation mask with "fmask=". In addition, the "uid=", "gid=" and "workgroup=" # options can all be specified to control how the share is mounted. # # Note, it's probably best to specify "pamconsole" with smbfs/nfs shares via the # automounter as this allows any authenticated user logged into the console to execute # the mount. Note, this doesn't allow them to unmount unless an entry with "pamconsole" # for the mount point is specified in /etc/fstab. However, this is not a major issue # as the shares will unmount after a period of inactivity anyway. # # joslyn -fstype=smbfs,uid=1006,gid=1006,exec,rw,intr,soft,pamconsole,_netdev ://joslyn/public joslyn -fstype=nfs,bg,retries=1,timeo=1,exec,rw,intr,soft,pamconsole,_netdev joslyn:/home/public joslyn-mp3 -fstype=smbfs,bg,retries=1,timeo=1,ro,intr,soft,pamconsole,_netdev,uid=1006,gid=1006 ://joslyn/ntfs-mp3 #crogwin-mp3 -fstype=smbfs,ro,intr,soft,pamconsole,_netdev,uid=1006,gid=1006 ://crogwin/ntfs-mp3

# the following entries are samples to pique your imagination #linux -ro,soft,intr ftp.example.org:/pub/linux #boot -fstype=ext2 :/dev/hda1 #floppy -fstype=auto :/dev/fd0 #floppy -fstype=ext2 :/dev/fd0 #e2floppy -fstype=ext2 :/dev/fd0 #jaz -fstype=ext2 :/dev/sdc1 #removable -fstype=ext2 :/dev/hdd


Backlinks: :hdd