From owner-freebsd-questions@FreeBSD.ORG Thu May 7 03:55:27 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17C2B106566B for ; Thu, 7 May 2009 03:55:27 +0000 (UTC) (envelope-from talon@lpthe.jussieu.fr) Received: from shiva.jussieu.fr (shiva.jussieu.fr [134.157.0.129]) by mx1.freebsd.org (Postfix) with ESMTP id A04CD8FC21 for ; Thu, 7 May 2009 03:55:26 +0000 (UTC) (envelope-from talon@lpthe.jussieu.fr) Received: from parthe.lpthe.jussieu.fr (parthe.lpthe.jussieu.fr [134.157.10.1]) by shiva.jussieu.fr (8.14.3/jtpda-5.4) with ESMTP id n473tOZD009840 for ; Thu, 7 May 2009 05:55:25 +0200 (CEST) X-Ids: 164 Received: from niobe.lpthe.jussieu.fr (niobe.lpthe.jussieu.fr [134.157.10.41]) by parthe.lpthe.jussieu.fr (Postfix) with ESMTP id D387689E3C for ; Thu, 7 May 2009 05:55:23 +0200 (CEST) Received: by niobe.lpthe.jussieu.fr (Postfix, from userid 2005) id 91A4B15; Thu, 7 May 2009 05:55:23 +0200 (CEST) Date: Thu, 7 May 2009 05:55:23 +0200 From: Michel Talon To: freebsd-questions@freebsd.org Message-ID: <20090507035523.GA6073@lpthe.jussieu.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0.1 (shiva.jussieu.fr [134.157.0.164]); Thu, 07 May 2009 05:55:25 +0200 (CEST) X-Virus-Scanned: ClamAV 0.94.2/9334/Thu May 7 01:58:23 2009 on shiva.jussieu.fr X-Virus-Status: Clean X-Miltered: at jchkmail2.jussieu.fr with ID 4A025BAD.000 by Joe's j-chkmail (http : // j-chkmail dot ensmp dot fr)! X-j-chkmail-Enveloppe: 4A025BAD.000/134.157.10.1/parthe.lpthe.jussieu.fr/parthe.lpthe.jussieu.fr/ X-j-chkmail-Score: MSGID : 4A025BAD.000 on jchkmail2.jussieu.fr : j-chkmail score : . : R=. U=. O=. B=0.011 -> S=0.011 X-j-chkmail-Status: Ham Subject: Re: Autofs howto X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 May 2009 03:55:27 -0000 Paul Schmehl wrote: > I'm wondering if I can use autofs on FreeBSD. Last time I asked the > question someone said I need amd, which I found rather cryptic. Indeed it is cryptic, let me gave an example which works: niobe% cat /etc/amd.conf [global] auto_dir = /.amd log_file = /var/log/amd.log log_options = error,fatal,user map_type = file search_path = /etc [/Cd] map_name = amd.cdrom # For nfs mounts [/Net] map_name = amd.net niobe% cat /etc/amd.cdrom cdrom type:=cdfs;opts:=ro,nosuid;dev:=/dev/acd0;fs:=${autodir}/cdrom niobe% cat /etc/amd.net /defaults type:=host;fs:=${autodir}/${rhost};rhost:=${key} * opts:=rw,grpid,resvport,nosuid,nodev,soft Now some comments. I use amd without options so it just uses /etc/amd.conf to configure itself. When you try to access /Cd it uses the configuration in /etc/amd.cdrom, and if you try to access /Net it uses the configuration in /etc/amd.net. Finally if you try to access /Net/ada for example, the key is ada, and so is the remote host. It is queried for NFS mounts and everything is mounted. After niobe% cd /Net/ada i have: niobe% df ... ada:/ada 36196652 26972064 7356232 79% /.amd/ada/ada ada:/ada1 287391356 246682696 26109996 90% /.amd/ada/ada1 ada:/ada2 288362876 180649856 93064956 66% /.amd/ada/ada2 ada:/ada3 99188500 80794628 13273960 86% /.amd/ada/ada3 ada:/adm 36204684 1682772 32653156 5% /.amd/ada/adm Note that autodir is /.amd and fs is ${autodir}/${rhost} as you can see. Getting out of /Net/ada those mounts are unmounted. I hope this helps explaining some of the mysteries of amd. -- Michel TALON