From owner-freebsd-questions@FreeBSD.ORG Sat Mar 22 00:28:09 2008 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 1FE4E1065670 for ; Sat, 22 Mar 2008 00:28:09 +0000 (UTC) (envelope-from rock_on_the_web@comcen.com.au) Received: from angel.comcen.com.au (angel.comcen.com.au [203.23.236.69]) by mx1.freebsd.org (Postfix) with ESMTP id B39F18FC25 for ; Sat, 22 Mar 2008 00:28:08 +0000 (UTC) (envelope-from rock_on_the_web@comcen.com.au) Received: from [192.168.0.199] (202-172-126-254.cpe.qld-1.comcen.com.au [202.172.126.254]) by angel.comcen.com.au (8.13.4/8.12.9) with ESMTP id m2M0RS0o063369 for ; Sat, 22 Mar 2008 11:27:29 +1100 (EST) From: Da Rock To: freebsd-questions@freebsd.org In-Reply-To: <200803211621.15772.tijl@ulyssis.org> References: <1205978132.27757.28.camel@laptop2.herveybayaustralia.com.au> <20080320074312.GB59070@slackbox.xs4all.nl> <1206014137.27757.132.camel@laptop2.herveybayaustralia.com.au> <200803211621.15772.tijl@ulyssis.org> Content-Type: text/plain Date: Sat, 22 Mar 2008 10:27:22 +1000 Message-Id: <1206145643.6973.16.camel@laptop2.herveybayaustralia.com.au> Mime-Version: 1.0 X-Mailer: Evolution 2.12.3 (2.12.3-3.fc8) Content-Transfer-Encoding: 7bit X-comcen-MailScanner-Information: Please contact the ISP for more information X-comcen-MailScanner: Found to be clean X-comcen-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-16.444, required 4, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.36, BAYES_00 -15.00) X-comcen-MailScanner-From: rock_on_the_web@comcen.com.au Subject: Re: removable devices auto umounting 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: Sat, 22 Mar 2008 00:28:09 -0000 On Fri, 2008-03-21 at 16:21 +0100, Tijl Coosemans wrote: > >> On Thu, Mar 20, 2008 at 11:55:32AM +1000, Da Rock wrote: > >>> I'm just looking into the removable device issue for freebsd. I can > >>> see its easy enough to auto mount a removable device (although I > >>> could use some help getting sd/xd devices working with my card > >>> reader), but the removal seems to come unstuck. > >>> > >>> I have some barely literates on my systems, so I do need to work > >>> this out. Is it possible to use a forced umount to do this? What > >>> are the options here? > > In KDE (same for GNOME and such I figure), removable devices like usb > keys, cameras, cd/dvd are automounted and appear on the desktop. > Using the right-click popup menu you can "Safely remove" or "Eject" > them. > > For this to work, you need to have sysutils/hal installed and configure > x11/kdebase3 to enable hal support (this is the default). > > Then you need to give users permission to access necessary devices. > It's best to create a separate group for that like plugdev and then > add users to this group. To give a plugdev group access to devices > create/edit the file /etc/devfs.rules to contain: > > --- begin /etc/devfs.rules --- > [local_ruleset=10] > #allow plugdev to access the CAM subsystem (required for cd/dvd burning and usb mass storage) > add path xpt0 user root group plugdev mode 0660 > add path 'pass*' user root group plugdev mode 0660 > #only allow root for specific fixed SCSI drives if any > #add path pass0 user root group operator mode 0660 > #add path pass1 user root group operator mode 0660 > #... > > #allow plugdev to access the cdrom > add path cd0 user root group plugdev mode 0660 > > #allow plugdev to access usb mass storage > add path 'da*' user root group plugdev mode 0660 > #only allow root for specific fixed SCSI drives if any > #add path 'da0*' user root group operator mode 0660 > #add path 'da1*' user root group operator mode 0660 > #... > > #allow plugdev to access generic usb devices (cameras/mp3 players using libusb) > add path 'usb*' user root group plugdev mode 0660 > add path 'ugen*' user root group plugdev mode 0660 > --- end /etc/devfs.rules --- > > (You don't need anything special in /etc/devfs.conf. If you've put > stuff there to get cd burning working for normal users, you can > remove it. (permission for cd,xpt,pass devices)) > > In /etc/rc.conf then make sure you have these lines: > > dbus_enable="YES" > devfs_system_ruleset="local_ruleset" > hald_enable="YES" > polkitd_enable="YES" > > And finally, give plugdev access to hal by editing > /usr/local/etc/dbus-1/system.d/hal.conf > At the end of that file it says: > > > > > > > > > > On the second line above, change "operator" to "plugdev". > > Then make sure you have a /var/media directory and /media linking to it > and nothing related to removable devices in /etc/fstab (including cdrom). > Reboot your system and if I didn't miss anything, any user in the > plugdev group should be able to use removable devices quite easily. Thanks for that- I was just looking into that from the Project Utopia article. Just a couple of things- 1. You still have to click eject before removing the device. Is there a way to skip this and just remove the device? 2. The D-Bus system only works with an X wm doesn't it? I know it seems contrary, but is there a way I can set this up so that it will work from a standard tty? The amd system appears to allow this, but it does have its faults as well. Consider this theory: IF the X windows system is running- D-Bus and all- can other background daemons use this system? I guess they wouldn't need to concern themselves with this problem as the X windows will be taking care of it automatically. Another thought: do all wm's use the D-Bus? Or is it only kde and gnome? Thanks for being a sounding board guys.