Date: Fri, 21 Mar 2008 16:21:14 +0100 From: Tijl Coosemans <tijl@ulyssis.org> To: Da Rock <rock_on_the_web@comcen.com.au> Cc: freebsd-questions@freebsd.org Subject: Re: removable devices auto umounting Message-ID: <200803211621.15772.tijl@ulyssis.org> In-Reply-To: <1206014137.27757.132.camel@laptop2.herveybayaustralia.com.au> References: <1205978132.27757.28.camel@laptop2.herveybayaustralia.com.au> <20080320074312.GB59070@slackbox.xs4all.nl> <1206014137.27757.132.camel@laptop2.herveybayaustralia.com.au>
next in thread | previous in thread | raw e-mail | index | archive | help
>> 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: <!-- You can change this to a more suitable user, or make per-group --> <policy group="operator"> <allow send_interface="org.freedesktop.Hal.Device.SystemPowerManagement"/> <allow send_interface="org.freedesktop.Hal.Device.LaptopPanel"/> <allow send_interface="org.freedesktop.Hal.Device.Volume"/> <allow send_interface="org.freedesktop.Hal.Device.Volume.Crypto"/> </policy> 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200803211621.15772.tijl>