LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   udev and mounting devices to a specific /dev (https://www.linuxquestions.org/questions/slackware-14/udev-and-mounting-devices-to-a-specific-dev-4175534726/)

badbetty 02-21-2015 02:49 PM

udev and mounting devices to a specific /dev
 
Hi there folks


Slackware 14.1

Current behaviour: mounting a USB HDD causes Thunar to automatically display in 'devices' (with its partition name it seems) an entry for the newly mounted device ready to select to mount.

Q1) please will someone help me understand by brief description, how the system (which major programs/modules) tells Thunar, in this case, a device has been plugged in so it knows to show it in 'devices'?


In relation to a requirement, if I want to mount the device to a known or fixed '/dev/mydevice', I would create a 'udev' rule file in /etc/udev/rules.d including using a SYMLINK+ keyword and so forth. I have done this and it does as intended.

The behaviour is then: the device is plugged in and Thunar may briefly (but not always) show the device as available in 'devices', but that then clears (or does not show to start with) and is then no longer ever visible, unless I navigate to the mount point and drag it to the 'places' list in Thunar. However, the device is showing in an 'ls' of '/dev' and can always be u/mounted as required etc.

At that stage having been udev assigned to its fixed '/dev/mydevice' as a result of udev rule and subsequently manually mounted, then if the device is unmounted, it reappears automagically in the 'devices' list as described above as if the system has rescanned and notified Thunar to relist it.

Q2) again which modules/programs/daemons if any, are at work here to cause the re-scan (if different to those in Q1) and how would I stop it ever auto-detecting this device in the first place, so I can leave it to just my fixed 'udev' detection rule please?

It is as if there are two 'things' at work - udev (by my rule creation) but also some auto function.

I hope that makes sense. Sorry, but I struggled to find a way to better word it more succinctly.


Any help/advice/insight on the above scenarios and mainly my questions is appreciated. Thank you. Any links/pointers to help me dig further too.

Regards to all.

Didier Spaier 02-21-2015 03:29 PM

If you have just a few removable devices you could just make an entry for each in /etc/fstab, naming it by its LABEL or UUID and choosing a mount point that you see fit. Then I assume that Thunar will use that mount point whenever you demand to mount that device once plugged in.

chemfire 02-21-2015 03:43 PM

Didier Spaier is correct, Thunar uses udisks. It will respect whatever you have in fstab. This is easier than doing customer udev rules IMHO.

badbetty 02-21-2015 05:09 PM

Thank you very much for the replies. That did the trick. Simple solution as well. Thank you again.


All times are GMT -5. The time now is 03:43 AM.