Yeah, I totally agree, but I do use a very minimalistic install of TC and access the internet from another machine. That would make me write down every input/output instead of copy paste. So please have mercy with me. I could transfer it by USB, if I could, lol!!!
But to make it clear. Something between ntfs-3g and udev doesn't work as expected. So /mnt/$1 (without space inbetween) is not recognized and I get an "mount: can't find /mnt/ in /etc/fstab". $1 is obviously completely ignored. Using ext3 and ext4 filesystems, it works.
Have got to correct me. If I run "sudo sh /foo sdb1" it gets actually mounted. But why the bl**** He** doesn it work by using the script when it is called by 98-udev-rule
Another edit (I found the wysiwyg editor now, sorry for the mess in earlier posts, took wrong button for editing, gotten very late yesterday):
By fiddling around with this again, I noticed the following:
Running the usb-mount script in /usr/local/sbin
#!/bin/sh
rebuildfstab
sleep 3
mount /mnt/$1
and increasing the sleep time also delays creation of fstab. So if I increase up to ten, then a rebuild fstab is available after 10 seconds. So may it be, that the given mount command doesn't find the correct entry in fstab and therefore can't mount an ntfs-drive?
Mount point in fstab is available just after ten seconds then, but there is no entry in mtab, so running
sudo usb-mount sdb1
does mount sdb1 correctly with rw permission but NOT when called by script. sdb1 again is created in /mnt/ but is, of course, empty.
Would it make sense, to try something like
KERNEL=="ram*", SUBSYSTEM=="block", GOTO="tc.rules_end"
KERNEL=="loop*", SUBSYSTEM=="block", GOTO="tc.rules_end"
ACTION=="add", SUBSYSTEM=="block", RUN+="/bin/sh -c '/usr/sbin/rebuildfstab'", RUN+="/bin/sh -c '/usr/local/sbin/usb-mount %k'"
ACTION=="remove", SUBSYSTEM=="block", RUN+="/bin/sh -c '/usr/local/sbin/usb-umount %k'"
LABEL="tc.rules_end"
and remove the rebuildfstab command from the usb-mount script? Is it possible to run two commands as follw ups in an udev rule?
And what finally drives me completely nuts is, that using the script on ext3 ext4 drives is working as expected.