From owner-freebsd-questions@FreeBSD.ORG Wed Dec 7 16:22:00 2011 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 6E2C9106564A for ; Wed, 7 Dec 2011 16:22:00 +0000 (UTC) (envelope-from rodperson@rodperson.com) Received: from www6.pairlite.com (www6.pairlite.com [64.130.10.16]) by mx1.freebsd.org (Postfix) with ESMTP id 4B1C98FC14 for ; Wed, 7 Dec 2011 16:22:00 +0000 (UTC) Received: from unknown (110-ccbh-135.ccbh.upmc.edu [128.147.110.135]) by www6.pairlite.com (Postfix) with ESMTPA id 30A2BB803; Wed, 7 Dec 2011 11:21:59 -0500 (EST) Date: Wed, 7 Dec 2011 11:21:58 -0500 From: Rod Person To: Mike Clarke Message-ID: <20111207112158.00000c99@unknown> In-Reply-To: <201112071607.09728.jmc-freebsd2@milibyte.co.uk> References: <201112051708.16072.jmc-freebsd2@milibyte.co.uk> <20111207095651.3688de01@vixen42.vulpes.vvelox.net> <201112071607.09728.jmc-freebsd2@milibyte.co.uk> X-Mailer: Claws Mail 3.7.10cvs7 (GTK+ 2.16.6; i586-pc-mingw32msvc) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org, "Zane C. B-H." Subject: Re: umass to /dev/da* mapping 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: Wed, 07 Dec 2011 16:22:00 -0000 On Wed, 7 Dec 2011 16:07:09 +0000 Mike Clarke wrote: > On Wednesday 07 December 2011, Zane C. B-H. wrote: > > > On Wed, 7 Dec 2011 08:39:30 -0700 (MST) > > > > Warren Block wrote: > > > On Wed, 7 Dec 2011, Zane C. B-H. wrote: > > > > Still you will want to investigate what I've mentioned. It will > > > > drastically simplify permission stuff as well as make automatic. > > > > The devfs stuff is just not boottime only, but will be applied > > > > to any new device added etc post boot. > > > > > > Are you sure of that? Seems like devfs permissions are only > > > applied when devfs(8) apply/applyset commands are run, directly or > > > through /etc/rc.d/devfs. > > > > Yeah, I am sure of that. It is what I have setup here. > > > > /etc/devfs.conf - This one only affects boot time stuff. > > > > /dec/devfs.rules - This one contains the rules will be applied > > during and post boot. It will also require you to specify which to > > use in "/etc/rc.conf" as this file can contain multiple rule sets. > > But can I use that to dynamically set up my link to the new device > when the memory stick is inserted? > Use devd.conf to do that. This is what I do. #Mount and usb device that is plugged in and creates a da device notify 20{ match "system" "DEVFS"; match "type" "CREATE"; match "cdev" "da[0-9]*"; action "/usr/local/etc/rc.d/usb_device_action mount '/dev/$cdev'"; }; notify 20{ match "system" "DEVFS"; match "type" "DESTROY"; match "cdev" "da[0-9]*"; action "/usr/local/etc/rc.d/usb_device_action umount '/dev/$cdev'"; }; The action line is what you want it to do, in my case I have this script I wrote that reads the device label, if it finds the label the it will create a mount point with that label name, If it can't find a label it creates a mount point using the device name. -- Rod Person http://www.rodperson.com rodperson@rodperson.com "Silence is a fence around wisdom"