[Breezy] Current status on USB hotplug ?

Vincent Trouilliez vincent.trouilliez at modulonet.fr
Tue Jul 12 04:49:21 UTC 2005


> Beside that you should tell if you are running gnome-volume-manager and
> explain why are you trying to mount allready mounted device. You
> shouldn't mount devices with right click -> mount. They should
> automount. If they don't do that, then you aren't runing dbus, hal or
> gnome-volume-manager.

> I'm preety sure that, when you provide information that I said few lines before,
>  we will find error in your setup.

Okay, I did my homework and I read the man pages a bit.

My understanding is that USB hotplugging goes like this :

1) Kernel
2) Udev dynamically creates device nodes when inserting USB drives, and
memory cards.
3) hotplug wraps udev
4) HAL listens to hotplug to detect when new drives and/or media are
inserted, and informs the user/Gnome, through the D-bus messaging
system.
5) Gnome-volume-manager listen for Hal events on D-bus, and mounts
(using 'pmount' ?) the partitions/memory cards/disks/sticks/camera and
puts appropriate icons in the 'Computer' location of Nautilus, to allow
the user to browse the newly mounted partition.

I hope I have this about right.
So, I looked in Gnome's System Monitor for processes. From top to
bottom, I have : g-v-m, d-bus, hal, udev. so it looks like everyting is
in place ? I didn't see any process by the name of hotplug, not sure if
it's serious or not...


Problem #1
----------

When the card reader has it's four slots EMPTY, and I insert it:

1) device nodes are created properly: sda sdb, sdc, sdd
2) hal device manager attests it
3) Nautilus reacts and puts for icons (see bug report) in the Computer
location.

-> it shouldn't put any icon, since all four slots are empty. Doing
other wise put loads of useless icons and clutters the Computer location
uselessly. As per Hoary (and as per common sense ;-), an icon should
only appear when there is actually a memory card inserted.

The kernel doesn't print any message that could make me believe that
something went wrong. So either HAL somehow made gvm believe that it
would be useful/appropriate to add icons for empty slots, or gvm took
this decision under its own responsibility. 


Problem #2
----------

Now, I insert a memory card into slot #3 of the card reader (/dev/sdc).

1) kernel sees the memor card, and detect it's size 60+ MB, and prints :

kernel: [4388911.562000] sdc: Spinning up disk.....ready
kernel: [4388913.816000] SCSI device sdc: 121856 512-byte hdwr sectors
(62 MB)
kernel: [4388913.840000] sdc: Write Protect is off
kernel: [4388913.877000] SCSI device sdc: 121856 512-byte hdwr sectors
(62 MB)
kernel: [4388913.890000] sdc: Write Protect is off
[4388913.890000]  /dev/scsi/host2/bus0/target0/lun2: p1

2) again, udev reacts properly and instantly creates an /dev/sdc1
device.

3) hal doesn't see it (device manager doesn't reflect the change)

4) Nautilus doesn't auto-mount the partition/memory card, corresponding
icon in the Computer location doesn't change shape, volume label is not
indicated, the generic "generic STORAGE DEVICE (3)" icon label remains
in place, no change.


So I assume that here, HAL didn't do its job of seeing the
partition/memort card, and therefore didn't inform g-v-m through d-bus,
of this event.

As suggested, Hal is possibly also in cause in problem #1.

So looks like Hal is at fault right now on my up to date Breezy.
I shall then be looking forward to seeing Hal related updates in the
coming weeks...


--
Vince





More information about the ubuntu-users mailing list