AutoMount for USB

Kurt Wall kwall
Mon Feb 28 19:29:32 PST 2005


On Monday 28 February 2005 11:09, Ben Duncan enlightened us thusly:
> Ok, where is a good starting place to learn how and what I need
> to do automounts for Slackware 10. I have a ext3 EXTERNAL USB disk
> I move from machine to machine and WOULD love for it to automount.

Automounting is pretty easy. Here's an example:

1. Create/edit /etc/auto.master:

/misc /etc/auto.misc

This tells the automounter to use the map file /etc/auto.misc 
for any mounts on the /misc filesystem.

2. Create the /misc mount point:

# mkdir /etc/misc

3. Create/edit the map file, in this case, /etc/auto.misc:

external-usb -fstype=ext3 :/dev/sda1

This says the the directory *under /misc* named external-usb (that
is, /misc/external-usb) is an ext3 file system using the device node
/dev/sda1. It is not necessary to create /misc/external-usb because 
the automounter will create it when the filesystem is first accessed.

4. Start the automount daemon.

5. Use the directory.

With this information, you should be able to create automounter map
files for yourself. Use the autofs man page (man 5 autofs) to find 
additional options that suit your needs.


More information about the Linux-users mailing list