UNIX and Linux

Autofs Quick Start


elflord@panix.com

Tutorials

Useful information mostly written by me, the conspicuous exception being the bash manpage ...

Intro to Unix
UNIX command summary
grep tutorial powerful search tool
sed tutorial scripts to edit text files
Autofs in Linux automatically mounting removable media
procmail tutorial well known email filter
bash manpage the man page for the bash shell. Warning: this is long (~210k)

Why Autofs ?

Autofs automatically mounts file systems for you when they are requested. This has a very handy features: It's great for handling removable media. Just CD to the right directory, or execute ls or do anything that sends a request to the mount point: and the daemon mounts it. After all, it's the kind of job that's beneath the dignity of a human being First, you need to install the "autofs" package. It should include some appropriate config files. The files you need are /etc/auto.master and /etc/auto.mnt Examples shown below:

/etc/auto.master

# Format of this file:
# mountpoint map options
# For details of the format look at autofs(8).

#/misc       /etc/auto.misc     --timeout 60
/mnt   /etc/auto.mnt --timeout 5
# 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

/etc/auto.mnt


# nosuid means suid bits on mounted media will not be set. 

cdrom      -fstype=iso9660,user,nosuid        :/dev/cdrom
floppy     -fstype=ext2,defaults,user,nosuid,sync  :/dev/fd0
zip        -fstype=ext2,defaults,user,nosuid  :/dev/sda4