On Thursday 27 August 2009 09:51:41 Rodney Baker wrote:
Hi all.
I have 2 external USB HDD's that I use for backup purposes, one of which is used for nightly backups run from cron, the other for ad-hoc backup and general storage use.
I have setup udev rules for these drives to create persistent dev symlinks for them and they auto-mount when accessed from dolphin, but I would like them to auto-mount as soon as the system detects that they're plugged in.
I know that this used to be possible, and I'm sure it still is; I just don't know which config files I need to create/edit to make it happen under openSuse.
Can some kind person please point me in the right direction, either with an example or a link to a web page where I can find the right info? Google hasn't been particularly helpful so far (but maybe I'm just searching for the wrong text).
Thanks in advance,
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",SYMLINK+="backup" KERNEL=="sd*[0-9]",SYSFS{idVendor}=="1058",SYSFS{idProduct}=="1003",SYMLINK+="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. I hope this helps someone else out - it took a bit of digging to find it but it was worth the effort :-). Cheers, Rodney. -- =================================================== 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