LinuxQuestions.org

LinuxQuestions.org (http://www.linuxquestions.org/questions/index.php)
-   Linux - Hardware (http://www.linuxquestions.org/questions/forumdisplay.php?f=18)
-   -   Auto mount with custom permissions to custom location (http://www.linuxquestions.org/questions/showthread.php?t=4175435742)

Tarantula 11-05-2012 10:52 AM

Auto mount with custom permissions to custom location
 
I have a (Slackware64 14.0) Linux and an external USB that auto-mounts just fine, out of the box to the /run/media/ filesystem.

But I would like it to be auto-mounted (of course without needing to log in as root) to a custom location - say /mnt/zzz, with custom permissions and custom umask.

And that not at boot time, but whenever the disk is inserted.

Is it doable?
What do I need to do?
Can someone explain what applications in what succession are involved in auto-mounting a USB disk?

malekmustaq 11-05-2012 11:54 AM

Quote:

Is it doable?
Yes.

Quote:

What do I need to do?
Write a one-line udev rule and use policy mounting "pmount".

Quote:

Can someone explain what applications in what succession are involved in auto-mounting a USB disk?
1. Identify a unique attribute to your hot-plug usb device.
2. Insert or create a rule-line in a file and save it as /etc/udev/rules.d/50-persistent-usbdisk-rule. Here click this easy tutorial for that. The basic commands are easy to use that can help you do the needed procedures.

By the way, come back if you have difficulty at writing the rule.

Hope that helps.

Goodluck.

Tarantula 11-07-2012 04:58 AM

Thank you for the advice.

I have created a file (/etc/udev/rules.d/50-wd-usb-hdd.rules) as suggested, with just one line it it:

Code:

ACTION=="add", KERNEL=="sde1" SUBSYSTEM=="block" RUN+="/sbin/mount.ntfs-3g %k /mnt/WDP"
but it does not work.
Upon inserting the USB disk the partition is not mounted.
No error is reported in the system log.
What am I doing wrong?

Note: pmount is not (readily) available on Slackware64 14.0 and I'd like to solve this without it.

I am not sure whether this is Slackware specific or not, whether I should ask it here of in the Slackware sub-forum, but what is it that mounts the device when I click it's icon in Thunar's tree sidebar?
And where is the setting that make Thunar mount the removable devices under /run/media/<user>/<volume label/serial>?
In fact is there such a setting or is it preset?


All times are GMT -5. The time now is 03:46 PM.