Pit Suetterlin schreef:
Hi Koenraad,
I think if automount doesn't see the disk when it's started it will ignore the entry...
Check out udev for that, it can trigger actions when new hardware is attached. I do have a file /etc/udev/rules.d/85-mount-fstab.rules: # check fstab and possibly mount SUBSYSTEM=="block", ACTION=="add", KERNEL=="sd*[0-9]|hd*[0-9]|sd*", RUN+="mount.sh"
mount.sh is a script (has to be in /lib/udev) that takes neccessary actions. I use it for automatically mounting different USB devices at fixed mountpoints that I define in /etc/fstab using the /dev/disk/by-id links
The mechanism/script is from an older openSuSE (10.3 I think), but the principle can easily be adapted to your needs.
In your case it might be enough to either have an entry for the disk in /etc/fstab and instead of RUN+="mount.sh" try a RUN+="/bin/mount -a" (*), or stick with autofs but restart it after the disk is there using RUN+="/etc/init.d/autofs restart" (though I haven't tested those and cannot guarantee they work...)
(*) in that case, as well in the one I'm using the backup script would have to umount the disk after it's done!
Pit Thanks for your response. I added in /etc/rules 85-mount-rev.rules : # mount Rev-drive SUBSYSTEM=="block", ACTION=="add", KERNEL=="sr*", RUN+="mount.sh"
In /lib/udev I have mount.sh (made mount.sh executable) : #!/bin/bash echo "udev rule triggered" >> /var/log/udev.log /bin/mount "/dev/disk/by-label/REV\x2070" /mnt/REV70 mountpoint /mnt/REV70 does exist. Is there a way to see what udev does ? Because I don't get anything. I tailed /var/log/messages and this is what I get when I insert a disk : Mar 6 15:57:49 linux-test kernel: UDF-fs INFO UDF: Mounting volume 'REV 70', timestamp 2009/02/26 15:12 (103c) Mar 6 15:57:49 linux-test hald: mounted /dev/sr2 on behalf of uid 0 When I run mount.sh manually it works fine. I rebooted the computer to make certain udev is restarted. Is it possible to restart udev without rebooting ? Or is it not needed to restart udev ? -- Met vriendelijke groeten, Koenraad Lelong