udev rules not working

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

udev rules not working

Manuel Parrilla Sánchez
Hello

I have a usb pen drive and I want it to be mounted in a
particular directory when I plug it.

I have written a udev rule in the
file /etc/udev/rules.d/50-MyRule.rules:

BUS=="usb", KERNEL=="sd?1",
ATTRS{product}=="USB DISK 2.0", ATTRS{serial}=="078A184502BD", NAME="%
k", SYMLINK+="usb16GB%n"

and added to /etc/fstab the line:


/dev/usb16GB1 /mnt/usbdisk    ext3  users,noauto,exec,suid  0     0


But when I plug the pen drive, it is automounted in /media/usb0,
ignoring my udev rule.

If I umount the device and do:

mount  
/mnt/usbdisk

It is correctly mounted.

How can I get what I want?

Any
help will be appreciated.


Manuel Parrilla.

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: udev rules not working

Derek Broughton-2
[hidden email] wrote:

> I have a usb pen drive and I want it to be mounted in a
> particular directory when I plug it.
>
> I have written a udev rule in the
> file /etc/udev/rules.d/50-MyRule.rules:
>
> BUS=="usb", KERNEL=="sd?1",
> ATTRS{product}=="USB DISK 2.0", ATTRS{serial}=="078A184502BD", NAME="%
> k", SYMLINK+="usb16GB%n"

OK, but there's no mount command there...
>
> and added to /etc/fstab the line:
>
>
> /dev/usb16GB1 /mnt/usbdisk    ext3  users,noauto,exec,suid  0     0

It's "noauto" - how do you expect it to be automatically mounted there?

> But when I plug the pen drive, it is automounted in /media/usb0,
> ignoring my udev rule.

Itclearly didn't ignore the rule, because...
>
> If I umount the device and do:
>
> mount
> /mnt/usbdisk
>
> It is correctly mounted.

How could it be mounted on /dev/usb16GB1, unless your udev rule worked?

> How can I get what I want?

You could probably execute a "mount" command from udev, but you probably
really should be modify hal's .fdi files (and I have no idea how to do
that).  fwiw, I thought gnome let you just rename the /media mountpoint
by renaming the mounted device icon on your desktop (KDE 3.5 did, I have
no idea about 4.1).
--
derek


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: udev rules not working

Manuel Parrilla Sánchez
In reply to this post by Manuel Parrilla Sánchez
El Friday 12 December 2008 00:10:04 Derek Broughton escribió:
>
[hidden email] wrote:
> > I have a usb pen drive and I want it to be
mounted in a
> > particular directory when I plug it.
> >
> > I have
written a udev rule in the
> > file /etc/udev/rules.d/50-MyRule.rules:

> >
> > BUS=="usb", KERNEL=="sd?1",
> > ATTRS{product}=="USB DISK 2.0",
ATTRS{serial}=="078A184502BD", NAME="%
> > k", SYMLINK+="usb16GB%n"
>
>
OK, but there's no mount command there...
>
What do you mean? Where can
I get information about that?

> > and added to /etc/fstab the line:
>
>
> >
> > /dev/usb16GB1 /mnt/usbdisk    ext3  users,noauto,exec,suid  
0     0
>
> It's "noauto" - how do you expect it to be automatically
mounted there?
>
It is automatically mounted, but not in the place I
want.

> > But when I plug the pen drive, it is automounted in
/media/usb0,
> > ignoring my udev rule.
>
> Itclearly didn't ignore the
rule, because...
>
> > If I umount the device and do:
> >
> > mount
> >
/mnt/usbdisk
> >
> > It is correctly mounted.
>
> How could it be
mounted on /dev/usb16GB1, unless your udev rule worked?
>
Ok, the udev
rule works, but not in the way I'd like.

> > How can I get what I
want?
>
> You could probably execute a "mount" command from udev, but
you probably
> really should be modify hal's .fdi files (and I have no
idea how to do
> that).  fwiw, I thought gnome let you just rename the
/media mountpoint
> by renaming the mounted device icon on your desktop
(KDE 3.5 did, I have
> no idea about 4.1).
>
I'll do some research
about it.

> --
> derek
>
Thank you

Manuel Parrilla


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users