Despite I tried restarting the system and udev many times, plugging -in
and -out the USB disk doesn't make udev to trigger any events. dmesg
just informs me about the disk as usual:
[ 1981.290165] udev: starting version 160
[ 2031.599488] usb 2-1.5: USB disconnect, address 5
[ 2042.422847] udev: starting version 160
[ 2057.352064] usb 2-1.5: new high speed USB device using ehci_hcd and address 6
[ 2057.445887] usb 2-1.5: New USB device found, idVendor=152d, idProduct=2329
[ 2057.445891] usb 2-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=5
[ 2057.445894] usb 2-1.5: Product: USB to ATA/ATAPI bridge
[ 2057.445897] usb 2-1.5: Manufacturer: JMicron
[ 2057.445899] usb 2-1.5: SerialNumber: 95EF50EFFFFF
[ 2057.446829] usb-storage 2-1.5:1.0: Quirks match for vid 152d pid 2329: 8020
[ 2057.446865] scsi6 : usb-storage 2-1.5:1.0
[ 2058.443128] scsi 6:0:0:0: Direct-Access TOSHIBA MK5055GSX PQ: 0 ANSI: 2 CCS
[ 2058.443995] sd 6:0:0:0: Attached scsi generic sg2 type 0
[ 2058.444549] sd 6:0:0:0: [sdb] 976773168 512-byte logical blocks: (500 GB/465 GiB)
[ 2058.445306] sd 6:0:0:0: [sdb] Write Protect is off
[ 2058.445314] sd 6:0:0:0: [sdb] Mode Sense: 34 00 00 00
[ 2058.445319] sd 6:0:0:0: [sdb] Assuming drive cache: write through
[ 2058.446805] sd 6:0:0:0: [sdb] Assuming drive cache: write through
[ 2058.446812] sdb: sdb1
[ 2058.476735] sd 6:0:0:0: [sdb] Assuming drive cache: write through
[ 2058.476738] sd 6:0:0:0: [sdb] Attached SCSI disk
OTOH, manually issuing "mount /media/tosun" works without a problem. Any
ideas about what might be missing?
Regards.
--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 87tykxpy2z.fsf@alamut.ozu.edu.tr">http://lists.debian.org/87tykxpy2z.fsf@alamut.ozu.edu.tr
10-08-2010, 12:12 PM
Camaleón
udev auto mount usb disk
On Thu, 07 Oct 2010 23:06:12 +0300, Volkan YAZICI wrote:
> Below are the configurations related with my USB disk.
>
> # grep tosun /etc/fstab UUID=0C98AFAF98AF95AC /media/tosun ntfs-3g noauto,fmask=133,dmask=022 0 0
That line should be enough to get the disk mounted.
I see no point for that rule. What are you trying to achieve? :-?
Greetings,
--
Camaleón
--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: pan.2010.10.08.12.12.19@gmail.com">http://lists.debian.org/pan.2010.10.08.12.12.19@gmail.com
10-08-2010, 12:31 PM
Volkan YAZICI
udev auto mount usb disk
On Fri, 8 Oct 2010, Camaleón <noelamac@gmail.com> 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.
Regards.
--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 87aamoeuhi.fsf@alamut.ozu.edu.tr">http://lists.debian.org/87aamoeuhi.fsf@alamut.ozu.edu.tr
10-08-2010, 01:34 PM
Camaleón
udev auto mount usb disk
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.
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-).
Greetings,
--
Camaleón
--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: pan.2010.10.08.13.34.45@gmail.com">http://lists.debian.org/pan.2010.10.08.13.34.45@gmail.com
10-08-2010, 01:48 PM
Volkan YAZICI
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.
--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 8739sgsslp.fsf@alamut.ozu.edu.tr">http://lists.debian.org/8739sgsslp.fsf@alamut.ozu.edu.tr
10-10-2010, 01:55 AM
Dave Thayer
udev auto mount usb disk
On Thu, Oct 07, 2010 at 11:06:12PM +0300, Volkan YAZICI wrote:
> Hi,
>
> Below are the configurations related with my USB disk.
>
> # grep tosun /etc/fstab
> UUID=0C98AFAF98AF95AC /media/tosun ntfs-3g noauto,fmask=133,dmask=022 0 0
>
> # 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"
[...]
> Despite I tried restarting the system and udev many times, plugging -in
> and -out the USB disk doesn't make udev to trigger any events. dmesg
> just informs me about the disk as usual:
[...]
> OTOH, manually issuing "mount /media/tosun" works without a problem. Any
> ideas about what might be missing?
>
I'm not sure why your udev rules aren't firing, but, shouldn't you be
umounting the filesystem *Before* removing the drive? Your udev "remove"
rule is not going to fire until after the drive is pulled. This seems
like you would be risking a corrupted filesystem by umounting an
already removed drive.
I prefer to use a combination of udev rules and automount to handle
removable media, since I generally avoid using desktop managers.
dt
--
Dave Thayer | Whenever you read a good book, it's like the
Denver, Colorado USA | author is right there, in the room talking to
dave@thayer-boyle.com | you, which is why I don't like to read
| good books. - Jack Handey "Deep Thoughts"
--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20101010015535.GA11369@thayer-boyle.com">http://lists.debian.org/20101010015535.GA11369@thayer-boyle.com