Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


Closed Thread
  Search this Thread
Old 04-12-2012, 08:37 AM   #1
LQ Newbie
Registered: Apr 2012
Posts: 3

Rep: Reputation: Disabled
Udev Ruless

Hi all,

I am writing a rule so that my usb drive will automatically mount to a point.

Iam new bie to this please help me out to write rules..

I tried somehow like this

created a file by name zzz.rules in /etc/udev/rules.d/
1ST Try
ACTION=="add",KERNEL=="sd?1-9]",SUBSYSTEM=="block",SUBSYSTEMS=="usb",SYMLINK+="vijayPD",RUN+="/bin/mount /dev/vijayPD /mnt"

ACTION=="remove",KERNEL=="sd?1-9]",SUBSYSTEM=="block",SUBSYSTEMS=="usb",RUN+="/bin/umount /mnt"
But not succeded infact the Symlink is getting created but it is not mounting to /mnt

when I manually typed /usr/bin/sudo /bin/mount /dev/vijayPD /mnt it is getting mounted.
2nd try
RUN+="/bin/su root -c /bin/mount /dev/vijayPD /mnt"
RUN+="/bin/su root -c /bin/umount /mnt"
3rd try
RUN+="/usr/bin/sudo /bin/mount /dev/vijayPD /mnt"
RUN+="/usr/bin/sudo /bin/umount /mnt"
I came across some threads mentioning to make use pmount and pumount and tried with it but no luck
4th try
RUN+="/usr/bin/pmount /dev/vijayPD /mnt"
RUN+="/usr/bin/pumount /mnt"
So posting here would help me.

Help me.

Old 04-13-2012, 02:00 AM   #2
LQ Guru
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295

I've found this link very helpful when I needed to work with udev rules the first time. Hope it helps for you too.

Kind regards,

Old 04-13-2012, 02:17 AM   #3
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,577
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
The mount command is /sbin/mount, not /bin/mount

BTW, IMHO the remove ACTION should not be required. The umount should happen before the remove or the file system is likely to be damaged.
Old 04-13-2012, 03:28 PM   #4
Registered: Jan 2005
Location: Summer Midwest USA, Central Illinois, Winter Central Florida
Distribution: SlackwareŽ
Posts: 13,296
Blog Entries: 29

Rep: Reputation: 2507Reputation: 2507Reputation: 2507Reputation: 2507Reputation: 2507Reputation: 2507Reputation: 2507Reputation: 2507Reputation: 2507Reputation: 2507Reputation: 2507
Moderator response

Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate of

Closed Thread

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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
UDEV: Unable to run a command line interface script after USB automount using udev mohamr2 Linux - Embedded & Single-board computer 8 08-16-2011 11:39 AM
[SOLVED] Chose udev for services... udev starts twice... hotplug fails flipjarg Linux - Newbie 2 09-19-2010 01:49 PM
UDEV - SBLive(emu10k) - Mandriva hangs at UDEV during boot.....still! Grrr. peterlowrie Linux - Hardware 2 05-23-2010 07:37 PM
current users - udev-128 - don't forget! tobyl Slackware 3 10-08-2008 04:28 AM
slackware-current, udev 0.96, and custom udev rules not working rignes Slackware 6 08-10-2006 04:43 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:33 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