Autofs

From ArchWiki
Revision as of 17:09, 23 July 2005 by Cactus (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


AutoFS HOWTO

Based on information found in this topic: http://bbs.archlinux.org/viewtopic.php?t=7630 %%% and information found in this page: http://libranet.com/support/2.8/0381

This document outlines the procedure needed to set up AutoFS, a package that provides support for automount. It provides the ability to have CDs, floppies, and other removeable media automatically mounted when they are inserted.

  1. Install the autofs package:
 <verbatim>
 pacman -Sy autofs
 </verbatim>
  1. Edit the file /etc/autofs/auto.master. Delete the existing contents and add the following line:
 <verbatim>
 /media /etc/autofs/auto.media
 </verbatim>
 If Autofs doesn't automatically unmount your devices (after you finish this wiki), replace last line by :
 <verbatim>
 /media /etc/autofs/auto.media --timeout 3
 </verbatim>
  1. Create the /etc/autofs/auto.media file with the following contents:
 <verbatim>
 cdrom -fstype=iso9660,ro,nodev,nosuid :/dev/cdroms/cdrom0
 floppy -fstypeauto,sync,nodev,nosuid,umask000 :/dev/floppy/0
 usbstick -fstypeauto,sync,nodev,nosuid,umask000  :/dev/sda1
 </verbatim>
 You may need to change the devices. You can also add additional similar devices.
  1. Create the /etc/default/autofs file and add the following line to it:
 <verbatim>
 TIMEOUT=1
 </verbatim>
  1. Create the /media directory:
 <verbatim>
 mkdir /media
 </verbatim>
  1. Start the autofs daemon using:
 <verbatim>
 /etc/rc.d/autofs start
 </verbatim>
  1. Start this daemon on every bootup by adding autofs to the DAEMONS array in /etc/rc.conf

Devices are now automatically mounted when they are accessed. Visit the /media/cdrom and /media/floppy directories to access them. They will remain mounted as long as you access them.

If you browse to the /media directory in a file manager, you will not see directory entries for the cdrom and floppy. These entries will only be created when you access them. This means that in the file browser you will need to type in, or create a link to, the access point to access the CD-ROM or floppy using the automounter.