# hal doesn't detect usb hardware changes

## define

hal does not detect any changes in usb devices while it's runnig. It seems like it is ignoring when a usb device is pluged in. when i plug in the device (a usb disk-on-key) the output of lshal doesn't change and also when i unplugged the diskonkey it doesn't change. only when i stop hal plug the diskonkey and start hal again hal is aware of my diskonkey but ivman doesn't automount it, although it says it's mountable.

I don't have any problems mounting the diskonkey manualy. hal does detect changes in my cdrom drive and ivman automount correctly.

I am using 

Hal 0.5.5.1-r3

Dbus 0.60-r4

ivman 0.6.10

kde 3.4.3

gentoo 2006 AMD64

thanks for everyone who can helpLast edited by define on Wed Apr 19, 2006 10:33 am; edited 2 times in total

----------

## JeliJami

using the exact same versions of dbus, hal and ivman, everything works fine here

i would suspect it is dbus not picking up the new usb device, rather than hal

you can watch dbus at work with:

```
# dbus-monitor --system
```

it should show that your device is added (DeviceAdded) and removed (DeviceRemoved)

----------

## define

you were right dbus doesn't pick up the usb device. when I did dbus-monitor --system i got:

```

dbus-monitor --system

signal sender=org.freedesktop.DBus -> dest=:1.23 interface=org.freedesktop.DBus; member=NameAcquired

 string ":1.23"

                  
```

and it remained that way no matter if plug in or plug out the usb device.

The device is recognized by dmesg correctly and appears in lsusb

```

# lsusb

Bus 003 Device 008: ID 058f:9382 Alcor Micro Corp. Acer/Sweex Flash drive

```

when i plug in the device i get on dmesg this output

```

ohci_hcd 0000:00:02.1: wakeup

usb 3-2: new full speed USB device using ohci_hcd and address 8

scsi8 : SCSI emulation for USB Mass Storage devices

usb-storage: device found at 8

usb-storage: waiting for device to settle before scanning

  Vendor: Generic   Model: Flash Disk        Rev: 7.78

  Type:   Direct-Access                      ANSI SCSI revision: 02

SCSI device sdb: 128000 512-byte hdwr sectors (66 MB)

sdb: Write Protect is off

sdb: Mode Sense: 03 00 00 00

sdb: assuming drive cache: write through

SCSI device sdb: 128000 512-byte hdwr sectors (66 MB)

sdb: Write Protect is off

sdb: Mode Sense: 03 00 00 00

sdb: assuming drive cache: write through

 sdb: sdb1

sd 8:0:0:0: Attached scsi removable disk sdb

usb-storage: device scan complete

```

How do I fix it?

----------

## sonicbhoc

did you emerge hotplug? I forgot to do that once and it didn't recognize my USB sticks.

----------

## define

i have got both hotplug and coldplug installed.

coldplug 20040920

hotplug 20040923-r1

----------

## JeliJami

coldplug is no longer needed

----------

## define

can coldplug be the problem?

----------

## define

Can someone please help me fix this problem?

----------

## define

Doesn't  matter anymore - solved it

----------

## drakia

Hi, I'm having the same problem, could you please post how you fixed it?

----------

## define

i thought i solved it because after i restarted my computer an icon for the usb device appeard and it was automounted. This brought me to the thought that the problem resides in hotplug. I check and discovered that the file /proc/sys/kernel/hotplug was empty while it should include the path to the program the kernel should call for hotpluging events so i've wrote there 

```

/sbin/hotplug

```

that seems to fix hotplug and by doing so hal started to respond to the pluging of usb devices. 

i did

```

ivman --nofork -d

```

and tried to plug in the diskonkey and to see what ivman does all i got was:

```

hal_interface.c:47 (hal_device_added) New Device: /org/freedesktop/Hal/devices/usb_device_58f_9382_noserial

manager.c:1004 (ivm_media_changed) /org/freedesktop/Hal/devices/usb_device_58f_9382_noserial wasn't mounted, by us or by others...

hal_interface.c:47 (hal_device_added) New Device: /org/freedesktop/Hal/devices/usb_device_58f_9382_noserial_if0

manager.c:1004 (ivm_media_changed) /org/freedesktop/Hal/devices/usb_device_58f_9382_noserial_if0 wasn't mounted, by us or by others...

hal_interface.c:47 (hal_device_added) New Device: /org/freedesktop/Hal/devices/usb_device_58f_9382_noserial_if0_scsi_host_0

manager.c:1004 (ivm_media_changed) /org/freedesktop/Hal/devices/usb_device_58f_9382_noserial_if0_scsi_host_0 wasn't mounted, by us or by others...

hal_interface.c:47 (hal_device_added) New Device: /org/freedesktop/Hal/devices/usb_device_58f_9382_noserial_if0_scsi_host_0_scsi_device_lun0

manager.c:1004 (ivm_media_changed) /org/freedesktop/Hal/devices/usb_device_58f_9382_noserial_if0_scsi_host_0_scsi_device_lun0 wasn't mounted, by us or by others...

```

and it won't automount the diskonkey although i could mount it manauly by pmount.

so i only could get to work if i plug in the disk on key and restart the whole system - what a true hotpluging and automounting!

i hope someone could help me fix ivman...

----------

## JeliJami

check with lshal if the device is considered mountable by hal, and what the desired_mount_point is

make sure you use pmount with ivman in /etc/ivman/IvmConfigBase.xml (mountcommand Option)

and restart ivman if you made any changes

----------

## define

ivman uses pmount as the mountcommand.

i checked ls hal for my usb device to see if it is considered mountable but i didn't write that if it is mountable... the only diff between the output of lshal before i pluged in the device and between i after i plug it in is :

```

udi = '/org/freedesktop/Hal/devices/usb_device_58f_9382_noserial'

  info.udi = '/org/freedesktop/Hal/devices/usb_device_58f_9382_noserial'  (string)

  linux.subsystem = 'usb'  (string)

  linux.hotplug_type = 1  (0x1)  (int)

  usb_device.bus_number = 3  (0x3)  (int)

  usb_device.can_wake_up = false  (bool)

  usb_device.is_self_powered = false  (bool)

  usb_device.version_bcd = 272  (0x110)  (int)

  usb_device.speed_bcd = 4608  (0x1200)  (int)

  usb_device.linux.device_number = 16  (0x10)  (int)

  usb_device.num_ports = 0  (0x0)  (int)

  usb_device.max_power = 100  (0x64)  (int)

  usb_device.device_revision_bcd = 256  (0x100)  (int)

  info.product = 'Acer/Sweex Flash drive'  (string)

  usb_device.product = 'Acer/Sweex Flash drive'  (string)

  info.vendor = 'Alcor Micro Corp.'  (string)

  usb_device.vendor = 'Alcor Micro Corp.'  (string)

  usb_device.product_id = 37762  (0x9382)  (int)

  usb_device.vendor_id = 1423  (0x58f)  (int)

  usb_device.device_protocol = 0  (0x0)  (int)

  usb_device.device_subclass = 0  (0x0)  (int)

  usb_device.device_class = 0  (0x0)  (int)

  usb_device.num_interfaces = 1  (0x1)  (int)

  usb_device.num_configurations = 1  (0x1)  (int)

  usb_device.configuration_value = 1  (0x1)  (int)

  usb_device.linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:02.1/usb3/3-2'  (string)

  info.linux.driver = 'usb'  (string)

  info.bus = 'usb_device'  (string)

  info.parent = '/org/freedesktop/Hal/devices/usb_device_0_0_0000_00_02_1'  (string)

  linux.sysfs_path_device = '/sys/devices/pci0000:00/0000:00:02.1/usb3/3-2'  (string)

  linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:02.1/usb3/3-2'  (string)

udi = '/org/freedesktop/Hal/devices/usb_device_0_0_0000_00_02_1_if0_0'

  info.udi = '/org/freedesktop/Hal/devices/usb_device_0_0_0000_00_02_1_if0_0'  (string)

  linux.subsystem = 'usb'  (string)

  linux.hotplug_type = 1  (0x1)  (int)

  info.product = 'USB Mass Storage Interface'  (string)

  usb.interface.protocol = 80  (0x50)  (int)

  usb.interface.subclass = 6  (0x6)  (int)

  usb.interface.class = 8  (0x8)  (int)

  usb.interface.number = 0  (0x0)  (int)

  info.linux.driver = 'usb-storage'  (string)

  usb.linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:02.1/usb3/3-2/3-2:1.0'  (string)

  usb.configuration_value = 1  (0x1)  (int)

  usb.num_configurations = 1  (0x1)  (int)

  usb.num_interfaces = 1  (0x1)  (int)

  usb.device_class = 9  (0x9)  (int)

  usb.device_subclass = 0  (0x0)  (int)

  usb.device_protocol = 0  (0x0)  (int)

  usb.vendor_id = 0  (0x0)  (int)

  usb.product_id = 0  (0x0)  (int)

  usb.vendor = 'Linux 2.6.15-gentoo-r7 ohci_hcd'  (string)

  usb.product = 'USB Mass Storage Interface'  (string)

  usb.device_revision_bcd = 518  (0x206)  (int)

  usb.max_power = 0  (0x0)  (int)

  usb.num_ports = 4  (0x4)  (int)

  usb.linux.device_number = 1  (0x1)  (int)

  usb.serial = '0000:00:02.1'  (string)

  usb.speed_bcd = 4608  (0x1200)  (int)

  usb.version_bcd = 272  (0x110)  (int)

  usb.is_self_powered = true  (bool)

  usb.can_wake_up = true  (bool)

  usb.bus_number = 3  (0x3)  (int)

  info.bus = 'usb'  (string)

  info.parent = '/org/freedesktop/Hal/devices/usb_device_0_0_0000_00_02_1'  (string)

  linux.sysfs_path_device = '/sys/devices/pci0000:00/0000:00:02.1/usb3/3-2/3-2:1.0'  (string)

  linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:02.1/usb3/3-2/3-2:1.0'  (string)

udi = '/org/freedesktop/Hal/devices/usb_device_0_0_0000_00_02_1_if0_0_scsi_host'

  info.udi = '/org/freedesktop/Hal/devices/usb_device_0_0_0000_00_02_1_if0_0_scsi_host'  (string)

  linux.subsystem = 'scsi_host'  (string)

  linux.hotplug_type = 2  (0x2)  (int)

  scsi_host.host = 15  (0xf)  (int)

  info.product = 'SCSI Host Adapter'  (string)

  info.capabilities = {'scsi_host'} (string list)

  info.category = 'scsi_host'  (string)

  info.parent = '/org/freedesktop/Hal/devices/usb_device_0_0_0000_00_02_1_if0_0'  (string)

  linux.sysfs_path_device = '/sys/devices/pci0000:00/0000:00:02.1/usb3/3-2/3-2:1.0/host15'  (string)

  linux.sysfs_path = '/sys/class/scsi_host/host15'  (string)

udi = '/org/freedesktop/Hal/devices/usb_device_0_0_0000_00_02_1_if0_0_scsi_host_scsi_device_lun0'

  info.udi = '/org/freedesktop/Hal/devices/usb_device_0_0_0000_00_02_1_if0_0_scsi_host_scsi_device_lun0'  (string)

  linux.subsystem = 'scsi'  (string)

  linux.hotplug_type = 1  (0x1)  (int)

  info.product = 'SCSI Device'  (string)

  scsi.lun = 0  (0x0)  (int)

  scsi.target = 0  (0x0)  (int)

  scsi.bus = 0  (0x0)  (int)

  scsi.host = 15  (0xf)  (int)

  info.parent = '/org/freedesktop/Hal/devices/usb_device_0_0_0000_00_02_1_if0_0_scsi_host'  (string)

  info.bus = 'scsi'  (string)

  linux.sysfs_path_device = '/sys/devices/pci0000:00/0000:00:02.1/usb3/3-2/3-2:1.0/host15/target15:0:0/15:0:0:0'  (string)

  linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:02.1/usb3/3-2/3-2:1.0/host15/target15:0:0/15:0:0:0'  (string)

```

----------

## JeliJami

if I insert a cf card in my card reader, which is connected on the usb bus, i get:

```
$ lshal > lshal.before

$ lshal > lshal.after 

$ diff lshal.before lshal.after 

2c2

< Dumping 90 device(s) from the Global Device List:

---

> Dumping 91 device(s) from the Global Device List:

984a985,1016

> udi = '/org/freedesktop/Hal/devices/volume_uuid_2AEB_3A3F'

>   volume.policy.desired_mount_point = 'POWERSHOT'  (string)

>   volume.policy.mount_filesystem = 'vfat'  (string)

>   volume.policy.should_mount = true  (bool)

>   info.udi = '/org/freedesktop/Hal/devices/volume_uuid_2AEB_3A3F'  (string)

>   volume.partition.msdos_part_table_type = 1  (0x1)  (int)

>   info.product = 'POWERSHOT'  (string)

>   volume.size = 16039936  (0xf4c000)  (uint64)

>   volume.num_blocks = 31328  (0x7a60)  (int)

>   volume.block_size = 512  (0x200)  (int)

>   volume.partition.number = 1  (0x1)  (int)

>   info.capabilities = {'volume', 'block'} (string list)

>   info.category = 'volume'  (string)

>   volume.is_partition = true  (bool)

>   volume.is_disc = false  (bool)

>   volume.is_mounted = true  (bool)

>   volume.mount_point = '/media/POWERSHOT'  (string)

>   volume.label = 'POWERSHOT'  (string)

>   volume.uuid = '2AEB-3A3F'  (string)

>   volume.fsversion = 'FAT12'  (string)

>   volume.fsusage = 'filesystem'  (string)

>   volume.fstype = 'vfat'  (string)

>   block.storage_device = '/org/freedesktop/Hal/devices/storage_model_Card_Reader_12X_2'  (string)

>   block.is_volume = true  (bool)

>   block.minor = 17  (0x11)  (int)

>   block.major = 8  (0x8)  (int)

>   block.device = '/dev/sdb1'  (string)

>   linux.hotplug_type = 3  (0x3)  (int)

>   info.parent = '/org/freedesktop/Hal/devices/storage_model_Card_Reader_12X_2'  (string)

>   linux.sysfs_path_device = '/sys/block/sdb/sdb1'  (string)

>   linux.sysfs_path = '/sys/block/sdb/sdb1'  (string)

> 

1995c2027

< Dumped 90 device(s) from the Global Device List.

---

> Dumped 91 device(s) from the Global Device List.

```

(and something similar with other usb devices)

what strikes me is that in your case, hal does not seem to recognize this device as a volume,

let alone as a mountable volume

maybe this is related to disk-on-key devices

----------

## define

I tried with a different diskonkey and i get the same results. Can it be caused by a misconfiguration of hal?

----------

