USB Media card - works at boot-up, removal works, re-insert
doesn't
David Zeuthen
david at fubar.dk
Tue Sep 21 11:52:23 PDT 2004
On Tue, 2004-09-21 at 19:02 +0100, Luke Kenneth Casson Leighton wrote:
> hello hello, well i can live with floopies appearing as two thingies
> in KVM, however USB media cards not quite working i can't. i'm
> uploading a typescript and a lshal to http://hands.com/~lkcl
>
> what's happening:
>
> - boot up with a USB media card inserted, it gets mounted, it gets
> found fine, KVM is happy, everything is hunky-dory.
>
> it's one of those USB media readers with four partitions, one per
> each of the 5-in-1 usb card slots (err.. four... five... errr..)
> okay it's a 5-in-1 usb card reader, but there are only four
> partitions. um.
>
I think you mean to say four LUN's rather than four partitions.
> - remove the media card, it disappears, everything is fine.
>
> i observe that hald, every 2 seconds, says it's trying to re-read
> the partition table for /dev/sdc.
>
You should be getting the hotplug events - it looks like [1] for me.
> - re-insert the media card: no observable events occur, no KVM
> response, no HAL log messages saying "mounted, off we go".
>
> i observe that hald stops saying it's trying to re-read the
> partition table.
>
> - manually do a mount /media/usbdisk7 (corresponding to /dev/sdc1).
> HAL responds by going "oo, /etc/mtab changed" and off it goes
> notifying KVM which responds by plopping the volume icon on
> the devices list.
>
>
> the bit that's obviously gone haywire is the
> linux/block_class_device.c:457 rereading partition table thing /dev/sdc
>
> reading more closely, the comments say "all this work [ioctl("/dev/sdc",
> BLKRRPART)] should result in hotplug events to actually remove the
> child devices".
>
> clearly that ain't happening!!!
>
Trivial questions, but best I can think of: Is hal.hotplug setup
correctly in /etc/hotplug.d/default, is hotplug enabled, did the kernel
oops?
>
> okay... i found out some more info.
>
> i put in a strerror(errno) message and it says "Device busy" from
> that ioctl.
>
> re-running the process above, i notice a "running forced unmount" thing
> happening...
>
> the failure means that KDE still has file handles open on
> /media/usbdisk7.
>
> i'm going to change the umount to a umount -l -f and see what happens...
>
hald already does 'umount -l' if we detect lack of media in a drive and
there exist mounted volumes for that drive.
David
[1] :
20:47:44.557 [I] linux/block_class_device.c:466: Rereading partition table for /dev/sdd
20:47:44.708 [I] linux/osspec.c:1291: action=remove, seqnum=0 subsystem=block devpath=/block/sdd/sdd1 devname=/dev/sdd1
20:47:44.708 [I] linux/osspec.c:1511: Queing up seqnum=317, sysfspath=/block/sdd/sdd1, subsys=block
20:47:44.708 [I] linux/osspec.c:1232: action=remove seqnum=317 subsystem=block sysfs_path=/sys/block/sdd/sdd1
20:47:44.708 [I] linux/osspec.c:1024: in remove_device for udi=/org/freedesktop/Hal/devices/block_8_49
20:47:44.709 [I] linux/osspec.c:1366: ******************************************
20:47:44.709 [I] linux/osspec.c:1367: **** hotplug_counter is now 1
20:47:44.709 [I] linux/osspec.c:1368: ******************************************
20:47:44.709 [I] callout.c:332: Invoking /etc/hal/device.d/40-hal-hotplug-map.hal
20:47:44.755 [I] callout.c:332: Invoking /etc/hal/device.d/printer_remove.hal
20:47:45.034 [I] callout.c:332: Invoking /etc/hal/device.d/50-fstab-sync.hal
12831: ###################################
12831: fstab-sync entering; remove udi=/org/freedesktop/Hal/devices/block_8_49
12831: mount_root=/media use_managed=yes managed_keyword=kudzu
12831: Acquiring advisory lock on /etc/fstab
12831: Lock acquired
12831: using temporary file '/etc/.fstab.hal.v'
12831: removed mount point for device '/dev/sdd1'
12831: Releasing advisory lock on /etc/fstab
12831: Lock released
12831: fstab-sync exiting; remove udi=/org/freedesktop/Hal/devices/block_8_49
12831: ###################################
20:47:45.490 [I] linux/osspec.c:980: in remove_callouts_finished for udi=/org/freedesktop/Hal/devices/block_8_49
20:47:45.490 [I] hald.c:83: Removed device from GDL; udi=/org/freedesktop/Hal/devices/block_8_49
20:47:45.490 [I] linux/osspec.c:1379: ==========================================
20:47:45.490 [I] linux/osspec.c:1380: ==== hotplug_counter is now 0
20:47:45.490 [I] linux/osspec.c:1381: ==========================================
20:47:46.601 [I] linux/block_class_device.c:2310: Directory /etc changed
_______________________________________________
hal mailing list
hal at freedesktop.org
http://freedesktop.org/mailman/listinfo/hal
More information about the Hal
mailing list