LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
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?

Notices


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

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
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,669

Rep: Reputation: 498Reputation: 498Reputation: 498Reputation: 498Reputation: 498
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.

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

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:

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?
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

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

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