How to set up AutoFS on Linux
From ArticleWorld
AutoFS is a wrapper to automount, allowing CDs, floppies, USB drives and other similar devices to be automatically mounted at insertion.
AutoFS is a very convenient package to use in desktop Linux installations. Here is how to install and configure it:
[edit]
Procedure
- Install the AutoFS package from your distribution's package repository (or manually from sources if no package is available).
- As root, open the /etc/autofs/auto.master . Delete everything in there and add:
/media /etc/autofs/auto.media --timeout 3
(Make sure there is a newline after that line).
- Now, also as root, open (or create) the file /etc/autofs/auto.media. Add the contents relevant to your computer, using the following as a model:
cdrom -fstype=iso9660,ro,nodev,nosuid :/dev/cdrom dvdrom -fstype=is09660,ro,nodev,nosuid :/dev/dvd floppy -fstype=auto,async,nodev,nosuid,umask=000 :/dev/fd0 usbstick -fstype=auto,async,nodev,nosuid,umask=000 :/dev/sda1
- Create a media directory in the / folder:
mkdir /media
- Start the autofs daemon. Everything should be quite fine now. You may want to have the AutoFS daemon starting up at boot time. This depends on the distribution you are using.
[edit]
Notes
AutoFS can use an arbitrary number of devices. For example, you can use more USB sticks with AutoFS.