HAL problems when unmounting after physical removal of usb key

kareemy kareemy at gmail.com
Thu Feb 8 09:57:30 PST 2007


I've built my system using Linux From Scratch and

dbus 1.0.2
hal 0.5.8.1
udev 104
pmount 0.9.13
ivman 0.6.13

My goal is to be able to insert a usb key and have it mounted automatically,
then remove the key and have it automatically unmounted. I use ivman to
mount the device and then a udev rule to unmount it once its removed. I
copied the rule from both knoppix 5.1.1 and debian. Here is my
/etc/udev/rules.d/90-hal.rules file:

# pass all events to the HAL daemon
RUN+="socket:/org/freedesktop/hal/udev_event"

# unmount block devices when they are removed
SUBSYSTEM=="block", ACTION=="remove", RUN+="/usr/lib/hal/hal-unmount.sh"

hal-unmount.sh just calls pmount -l $DEVNAME. I've linked to that script
below. Here is what happens though.

I insert the usb device. HAL sees it and adds it to the GDL. The device is
registered as /dev/sdb and /dev/sdb1 is the partition. ivman automatically
mounts /dev/sdb1 to /media/sdb1.

I physically remove the usb device without unmounting first. Udev runs
/usr/lib/hal/hal-unmount.sh and the device is unmounted. HAL then starts
repeating the following error:

[E] addon-storage.c:423: open failed for /dev/sdb: No such file or
directory.

and HAL never removes the device entry from its GDL, so when I reinsert it,
HAL does not generate any events, so ivman cannot automatically mount it
again. Here are links to the full debug logs from hald. The first log is
from what I described above, the second is from when I unmount the device
manually first then remove it to show hal operating correctly.

http://www.duke.edu/~kcd6/hal-unmount.sh
http://www.duke.edu/~kcd6/hald-error-log
http://www.duke.edu/~kcd6/hald-good-log

Let me know if more information is needed.

Thanks for any help,

Kareem Dana
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/hal/attachments/20070208/ee34a2a5/attachment.htm


More information about the hal mailing list