From owner-freebsd-questions@FreeBSD.ORG Fri Mar 21 15:21:27 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 3CE9E106564A for ; Fri, 21 Mar 2008 15:21:27 +0000 (UTC) (envelope-from tijl@ulyssis.org) Received: from cavuit02.kulnet.kuleuven.be (cavuit02.kulnet.kuleuven.be [134.58.240.44]) by mx1.freebsd.org (Postfix) with ESMTP id BADD68FC26 for ; Fri, 21 Mar 2008 15:21:26 +0000 (UTC) (envelope-from tijl@ulyssis.org) Received: from smtps02.kuleuven.be (smtpshost02.kulnet.kuleuven.be [134.58.240.75]) by cavuit02.kulnet.kuleuven.be (Postfix) with ESMTP id 57D0E51C012; Fri, 21 Mar 2008 16:21:17 +0100 (CET) Received: from kalimero.kotnet.org (kalimero.kotnet.org [10.4.16.222]) by smtps02.kuleuven.be (Postfix) with ESMTP id 11441F3863; Fri, 21 Mar 2008 16:21:17 +0100 (CET) Received: from kalimero.kotnet.org (kalimero.kotnet.org [127.0.0.1]) by kalimero.kotnet.org (8.14.2/8.14.2) with ESMTP id m2LFLGll004413; Fri, 21 Mar 2008 16:21:16 +0100 (CET) (envelope-from tijl@ulyssis.org) X-Kuleuven: This mail passed the K.U.Leuven mailcluster From: Tijl Coosemans To: Da Rock Date: Fri, 21 Mar 2008 16:21:14 +0100 User-Agent: KMail/1.9.7 References: <1205978132.27757.28.camel@laptop2.herveybayaustralia.com.au> <20080320074312.GB59070@slackbox.xs4all.nl> <1206014137.27757.132.camel@laptop2.herveybayaustralia.com.au> In-Reply-To: <1206014137.27757.132.camel@laptop2.herveybayaustralia.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200803211621.15772.tijl@ulyssis.org> X-KULeuven-Information: Katholieke Universiteit Leuven X-KULeuven-Scanned: Found to be clean X-Spam-Status: not spam, SpamAssassin (not cached, score=-50, required 5, autolearn=disabled, KUL_SMTPS -50.00) X-KULeuven-Envelope-From: tijl@ulyssis.org Cc: freebsd-questions@freebsd.org 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: Fri, 21 Mar 2008 15:21:27 -0000 >> 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.