Subject: Re: automounter
To: None <>
From: Richard M Kreuter <>
List: netbsd-users
Date: 11/17/2004 11:25:39
Emmanuel Dreyfus <> writes:

> Anyone has a working setup for floppy, cdrom and USB key
> automounter? The amd man page is quite easy to understand when you
> deal with NFS, but for local mount, it's a bit moe mysterious.

For statically-known device names and file system types, an amd map
like this should work (modulo your preferred mount options):

cd0a	type:=cdfs;opts:=ro,nosuid,nodev;dev:=/dev/cd0a
fd0a  	type:=pcfs;opts:=rw,noatime,sync;dev:=/dev/fd0a

For the more general case, where the device names and file system
types aren't known in advance, amd has a "program" mount type, which
calls an external program for the mounting and unmounting. I use a map
that looks like this with some scripts that figure out the
partitioning, file systems, and file system cleanliness on a device,
and mounts all known-safe mountable volumes as a group:

/defaults	opts:="rw,nosuid,nodev,sync"
*	type:=program;\
	mount:="/usr/local/sbin/pmount pmount ${key} ${fs} ${opts}";\
	unmount:="/usr/local/sbin/pumount pumount ${key} ${fs} ${opts}";