Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Hardware
User Name
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?


  Search this Thread
Old 11-05-2012, 10:52 AM   #1
LQ Newbie
Registered: Nov 2012
Posts: 2

Rep: Reputation: Disabled
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?
Old 11-05-2012, 11:54 AM   #2
Senior Member
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,665

Rep: Reputation: 488Reputation: 488Reputation: 488Reputation: 488Reputation: 488
Is it doable?

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

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.


Last edited by malekmustaq; 11-05-2012 at 12:04 PM.
Old 11-07-2012, 04:58 AM   #3
LQ Newbie
Registered: Nov 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
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:

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?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] perl module installation in custom location using cpanplus rohit.dhaval1 Linux - Software 2 08-16-2012 04:44 PM
Perl installation in custom location rohit.dhaval1 Linux - Software 2 05-12-2011 09:48 AM
Editing SARG to link it to custom location. linuxlover.chaitanya Linux - Software 2 01-12-2011 11:18 PM
intall software in custom location zero_cool666 Linux - Software 3 05-13-2008 12:57 PM
Location for Custom udev Rules Toods Slackware 7 11-19-2007 12:42 PM > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 12:11 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration