Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Jan 2000 19:12:53 -0800 (PST)
From:      Doug Barton <Doug@gorean.org>
To:        Peter Schwenk <schwenk@math.udel.edu>
Cc:        Paul Orr <Paul.Orr@jetsam.com>, freebsd-questions@freebsd.org
Subject:   Re: amd....kill me please
Message-ID:  <Pine.BSF.4.21.0001311849000.1009-100000@dt051n0b.san.rr.com>
In-Reply-To: <3895F3A7.397A4510@math.udel.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 31 Jan 2000, Peter Schwenk wrote:

> Where do you go to even get enough information to start?  The man page
> sux^H^H^H is horrible.  I want to use amd to automatically mount CDROMs and
> floppies.

	Well, the mail archives have some very interesting tidbits, as do
various other sites. One extremely helpful reference is the documentation
available through gnu info ('info amd') and/or the URL
http://www.netbsd.org/Documentation/bsd/amdref.html. 

	The thing about amd is that everyone has their own way of doing
things. Personally I prefer the approach of putting all the details in
amd.conf rather than on the command line. I have cobbled together the
following to do what you mention here, YMMV. 

rc.conf.local:
amd_enable="YES"                # Run amd service with $amd_flags (or NO).
amd_flags="-F /etc/amd.conf"

/etc/amd.conf:
[ global ]
# Only search for maps of this type
map_type =               file

# Search this path for maps
search_path =            /etc

# Use this directory for amd's private mount points
auto_dir =               /usr/amd/realmounts

# Check /etc/hosts for hostnames
normalize_hostnames =   yes

# Lock the amd process into memory, improves perf.
plock =                 no

# Use the special /default entry in maps
selectors_on_default =   yes

log_file =              /var/log/amd.log
log_options =            all

# DEFINE AN AMD MOUNT POINT
[ /mnt/auto ]
map_name =              amd.mnta

/etc/amd.mnta:
/defaults       type:=program;fs:=${autodir}/auto/${key};\
                unmount:="/sbin/umount umount ${fs}"

cdrom           mount:="/sbin/mount mount -t cd9660 /dev/acd0c ${fs}";\
                opts:=ro

floppyd         mount:="/sbin/mount mount -t msdos /dev/fd0c ${fs}"


	You can obviously change the amd mount point (/mnt/auto) and the
physical mount point (/usr/amd/realmounts/auto) if you want to. Whatever
directories you choose, make sure that you create them before you try to
use amd. It is probably not necessary to bury the real mount points so far
in the filesystem anymore, my configuration is a leftover from the "bad
old days" when a stuck mount would prevent you from doing anything on the
system because the getcwd() function would hang on the mount if it was in
a top level directory. On the other hand, since you only have to deal with
this directory once in a blue moon, I haven't bothered to change it. 

	I hope that this helps you get started, and provides some examples
as to how amd works. It should go without saying that to automount (and
read) a regular cdrom you would do 'ls /mnt/auto/cdrom' for example. Same
goes for a DOS floppy, via 'ls /mnt/auto/floppyd'. 


Good luck,

Doug
-- 
"Welcome to the desert of the real." 

    - Laurence Fishburne as Morpheus, "The Matrix"



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0001311849000.1009-100000>