[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: udev auto mount usb disk



On Fri, 8 Oct 2010, Camaleón <noelamac@gmail.com> writes:
> On Fri, 08 Oct 2010 15:31:37 +0300, Volkan YAZICI wrote:
>> On Fri, 8 Oct 2010, Camaleón writes:
>>> On Thu, 07 Oct 2010 23:06:12 +0300, Volkan YAZICI wrote:
>>>>   # cat /etc/udev/rules.d/89-tosun.rules ACTION=="add",
>>>>   ENV{ID_FS_UUID}=="0C98AFAF98AF95AC", RUN+="mount /media/tosun"
>>>>   ACTION=="remove", ENV{ID_FS_UUID}=="0C98AFAF98AF95AC", RUN+="umount
>>>>   -l /media/tosun"
>>>
>>> (...)
>>>
>>> I see no point for that rule. What are you trying to achieve? :-?
>> 
>> Trying to mount my USB disk to /media/tosun everytime it is plugged in,
>> and umount whenever it is unplugged.
>
> USB devices are handled by desktop environment, no need to write rules 
> for that. What DE are you using?
>
> In GNOME/KDE as soon as you plug any USB storage device it is 
> automatically mounted under "/media/device_label". Likewise, the disk is 
> umounted/disconnected as soon as you select "safely disconnect or safely 
> remove" from icon desktop context menu or any desktop applet.

There is no DE, and I don't want auto-mount. This case is just for this
specific device.

> But do not mix static mount points (those defined in "/etc/fstab") with 
> udev rules neither "/media" mout points to avoid conflicts. Just choose 
> what method best suits your needs (the static one -using fstab file and 
> manually calling mount/umount as required- or dynamic one -letting udev 
> to handle the whole mount/umount process-).

Yep, I know, but thanks for the clarification. udev maintainer helped me
to spot the problem: I need to use "sh -c 'mount ...'" to execute
commands. BTW, enabling /dev/hotplug.log in
/lib/udev/rules.d/80-driver.rules is also quite helpful for debugging
purposes.


Regards.


Reply to: