LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-12-2012, 06:43 AM   #1
vijay496
LQ Newbie
 
Registered: Apr 2012
Posts: 3

Rep: Reputation: Disabled
Help me out regarding udev rules


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.

Thanks,
VJ
 
Old 04-12-2012, 06:38 PM   #2
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,420

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
What errors you get while mounting?
 
Old 04-13-2012, 12:17 AM   #3
vijay496
LQ Newbie
 
Registered: Apr 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
No errors....
 
Old 04-13-2012, 11:52 AM   #4
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,420

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
So now what's the problem you're facing?
 
Old 04-13-2012, 01:48 PM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
As I wrote in your other thread asking the same question ...

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.
 
  


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
overriding /etc/udev/rules.d/70-persistent-net.rules Skaperen Linux - Networking 11 03-06-2014 09:24 PM
Slack 13.1 : /etc/udev/rules.d70-persistent-net.rules Ramurd Slackware 10 02-18-2011 09:56 AM
cat: /etc/udev/rules.d/70-persistent-net.rules: No such file or directory rcg1984 Linux From Scratch 2 09-17-2008 07:02 AM
slackware-current, udev 0.96, and custom udev rules not working rignes Slackware 6 08-10-2006 03:43 AM
need help fixing my udev rules or ivman rules hedpe Linux - Hardware 2 03-18-2006 10:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:57 PM.

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