From owner-freebsd-questions Tue Nov 12 14:40:16 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id OAA01730 for questions-outgoing; Tue, 12 Nov 1996 14:40:16 -0800 (PST) Received: from shiva.jussieu.fr (shiva.jussieu.fr [134.157.0.129]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id OAA01682 for ; Tue, 12 Nov 1996 14:40:00 -0800 (PST) From: af@biomath.jussieu.fr Received: from mekong.biomath.jussieu.fr (mekong.biomath.jussieu.fr [134.157.72.87]) by shiva.jussieu.fr (8.7.6/jtpda-5.2) with SMTP id XAA29737 ; Tue, 12 Nov 1996 23:39:52 +0100 (MET) Received: from tom.biomath.jussieu.fr (tom) by mekong.biomath.jussieu.fr (5.67b/jn930126+af960928(mailhost)) at Tue, 12 Nov 1996 23:39:33 +0100 Received: from (af@localhost) by tom.biomath.jussieu.fr (8.7.5/jtpda-5.2) id XAA07116 ; Tue, 12 Nov 1996 23:39:32 +0100 (WET) Message-Id: <199611122239.XAA07116@tom.biomath.jussieu.fr> Subject: Re: amd and CDROM To: jxh@cs.wustl.edu (James Hu) Date: Tue, 12 Nov 1996 23:39:32 +0100 (WET) Cc: freebsd-questions@freebsd.org In-Reply-To: <199611121935.NAA00534@plethora.cs.wustl.edu> from James Hu at "Nov 12, 96 01:35:46 pm" X-Mailer: ELM [version 2.4ME+ PL19 (25)] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk James Hu wrote / a ecrit: > Hello! > > I am trying to get my CDROM drive to auto-mount and auto-unmount via > amd. What I would like is to be able to ``cd /cdrom'', and have it > automatically mounted for me. Then when I cd out of it via ``cd /'' > the CDROM automatically unmounts, so that I can press eject. > > However, my attempts have produced utter failures. Clearly, I do not > understand the format of the amd map file and the amd command line > options, or how they interact. > > What I have tried is to create an entry in fstab for the CDROM: > /dev/cd0a /cdrom cd9660 noauto,ro 0 0 > > Then, I wanted to create an entry an amd.map entry which corresponds to > /cdrom. I tried something like: > cdrom type:=program;mount:="/sbin/mount mount /cdrom";unmount:="/sbin/umount umount /cdrom" > > and attempted with calls to amd which looked like: > amd / amd.cdrom.map > > but this seems to lock up the machine. Has anyone tried something > similar and with better results than what I have been able to produce? > I would never claim to have a good understanding of how amd works (sometimes I wonder if anyone but its author has) but I'm pretty sure that starting amd with / as a map mount point is a bad idea. Amd takes control over any directory specified as parameter and wants to resolve any access below that point through the associated map. In your case, you're telling amd how to "resolve" the cdrom dir under /, but you're not giving it any rule for the other dirs. They become inaccessible. I'm afraid starting at / would never succeed whatever your efforts to specify a correct map would be, since amd itself needs to access files, and those file are somewhere below / of course. As a starter, I'd make /cdrom a soft link to something like /amd/cdrom, and start amd with "/amd" instead of "/" as first parameter. You also need to add a rule for everything but cdrom under /amd that just makes it a link to the local filesystem. That goes with a "*" as key, but unfortunately the machine I have amd maps on is currently down, so I can't be more specific. Check the example for the "hosts" map in amd's documentation, that will give you an idea. Good luck with amd -- you need it... and if you get replies from a true amd guru take his word over mine (and give me his e-mail address ;-) _Alain_ -- Alain FAUCONNET Ingenieur systeme - System Manager AP-HP/SIM Public Health 91 bld de l'Hopital 75013 PARIS FRANCE Medical Computing Research Labs Mail: af@biomath.jussieu.fr Tel: (+33) 1-40-77-96-19 Fax: (+33) 1-45-86-80-68 I've RTFMed. It says: "Refer to your system administrator" But... I *am* the system administrator :-]