On Wed, 2 Sep 2009 17:15:55 David C. Rankin wrote:
On Wednesday 26 August 2009 08:13:06 pm Rodney Baker wrote:
Never mind - found the answer with a custom udev rule and appropriate options in /etc/fstab. They now automount when plugged in and can be unmounted via the device-notifier if necessary.
For those interested, here is a new file that I created as /etc/udev/rules.d/98-automount_usb.rules:
#run mount -a every time a block device is added/removed. SUBSYSTEM=="block",RUN+="/bin/mount -a"
The following rules in /etc/udev/rules.d/ create the symlinks in /dev/ for the 2 USB HDD's:
KERNEL=="sd*[0-9]",SYSFS{idVendor}=="152d",SYSFS{idProduct}=="2338",SYMLI NK +="backup"
KERNEL=="sd*[0-9]",SYSFS{idVendor}=="1058",SYSFS{idProduct}=="1003",SYMLI N K+="Elements"
Finally, the additional lines in /etc/fstab to specify the mount points:
/dev/backup /media/backup ext3 auto,defaults,users 1 2 /dev/Elements /media/Elements ext3 auto,,defaults,users 1 2
The "users" parameter is necessary to allow a user other than the one that mounted the drive (in this case it is either root or udev) to be able to unmount/eject it e.g. to allow safe removal.
Excellent Rodney,
I don't know why the usb mounts just "stopped" working, but I have experienced similar problems. I'll give it a try.
Rereading the quote from my original email I just noticed a couple of things; 1. There is a typo in the second quoted line from /etc/fstab involving an extra comma (but that doesn't prevent it from working). 2. I didn't mention the filename in /etc/udev/rules.d/ nor did I specify where the numeric parameters came from... The 2 lines quoted I put into a new file 59-persistent-storage.rules (but you can name it whatever you like, provided the filename extension is .rules). The numeric parameters you can find from lsusb (with the devices plugged in of course) or via sysfs. There are other parameters you can use in udev rules, as long as you pick something that uniquely identifies each device that you want persistent naming for. This page is useful: http://reactivated.net/udevrules.php Cheers, -- =================================================== Rodney Baker VK5ZTV rodney.baker@iinet.net.au =================================================== -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org