# [SOLVED] hal storage.bus='usb' changed to storage.bus='scsi'

## TheCoop

Recently, my usb disks have not been recognised as such; the storage.bus field has been set as 'scsi' rather than 'usb', which, considering my internal hd is also scsi,  makes matching them for generic hotplugging very difficult. Does anyone know why this has occured? I can't pin it down to one particular update, I havent updated hal recently, and ivman is 0.6.14...

----------

## jstead1

For me the difference was kernel 2.6.20-r6

Under that kernel, my sansa music player (flash based) is detected as a hard drive (by kde's media manager)

My Lexar usb key isn't detected by kde's media manager.  It is detected by the system according to dmesg, but doesn't show up as media.

Under 2.6.19-r5, both are detected by kde's media manager as removable media (again by kde's media manager).  The only difference is which kernel I boot into (I kept 2.6.19 around).  I didn't have any significant changes to the kernel config (with the possible exception of deprecated sysfs functions).   

The only difference in the dmesg output is under 2.6.19, the references are to usb 4-3, under 2.6.20, the references are to usb 5-3 (things like, usb 4-3.4: new high speed USB device using ehci_hcd and address 5).  Other than that the dmesg output is identical.  In each case, devices are created under /dev

I don't know if it's a kde thing in having to change to interface correctly with the new kernel, or something else not interfacing correctly or a kernel bug.  I wouldn't know where to start.  I do know where to end, I reverted back to 2.6.19-r5.  At least it works.  Perhaps someone could shed some light on this?

There is also this post.  It describes deprecated sysfs functions.  That may have something to do with it.  I believe I did not include the kernel option to support these deprecated sysfs functions since it was described as being required for systems configured in 2006, or something like that.

----------

## TheCoop

ahah, thats fixed it

----------

## jstead1

Not sure what fixed it, but on recompiling the 2.6.20-r6 kernel, with the 

```
General Setup

     Create deprecated sysfs files
```

as Yes, the USB detection works the same as in the 2.6.19 kernel.

I would guess the reason my Lexar jumpdrive wasn't detected at all was because I had a local udev rule that used the sysfs naming stuff.  I had no such rule with my sansa music player. 

Anyway, recompiling the kernel fixed the behavior, regardless of whether I use the local udev rule with sysfs naming conventions.

I don't know if there is something in the rest of the udev rules that requires sysfs files that are deprecated, but I will leave it in the kernel for now and check through my udev rules (the ones I didn't add) to see if they have references to sysfs, and if I can figure out what the heck they do.

----------

## jstead1

One last update, with the gentoo sources 2.6.20 kernel, with kernel config option "Create deprecated sysfs files" not enabled (no deprecated sysfs files) and hal-0.5.9-r1 (keyworded ~x86, at the present time), usb drive detection and interface with kde media works just fine.  All media detected, removable drives are detected as removable drives.

So I assume it was the older version of hal, 0.5.7.1-r5, that needed deprecated sysfs files.  Although upgrading hal did pull in a new package, sys-apps/dmidecode, DMI (Desktop Management Interface) table related utilities, so that may be what did the trick.

Anyway, problem even more solved than before.

----------

## KRF

See also: https://bugs.gentoo.org/show_bug.cgi?id=176735

----------

## lorebett

 *jstead1 wrote:*   

> Not sure what fixed it, but on recompiling the 2.6.20-r6 kernel, with the 
> 
> ```
> General Setup
> 
> ...

 

Hi, I have enabled this option, and I still have HAL 0.5.7.1-r5, but when I insert an USB stick it is not recognized...

----------

## jstead1

 *lorebett wrote:*   

>  *jstead1 wrote:*   Not sure what fixed it, but on recompiling the 2.6.20-r6 kernel, with the 
> 
> ```
> General Setup
> 
> ...

 

Not recognized as what?

Is it detected (look at dmesg)?

Does it show up in /dev (such as /dev/sda)?

If so, and you are using kde and are expecting something to pop up somewhere, do you have the right check boxes selected in the media configuration for kde?  For instance for the media applet, there is a preferences box that has two tabs, media types, and media (e.g. mounted hard drive is a type, 16G media would be a specific hard drive, both would need to be checked for the mounted 16G media to show up

Finally, double check your kernel config, and that you are actually using the kernel you built.

----------

## lorebett

 *jstead1 wrote:*   

>  *lorebett wrote:*    *jstead1 wrote:*   Not sure what fixed it, but on recompiling the 2.6.20-r6 kernel, with the 
> 
> ```
> General Setup
> 
> ...

 

I switched to hal in ~x86 and now the /dev/sda1 is created and dmesg correctly shows:

 *Quote:*   

> 
> 
> Initializing USB Mass Storage driver...
> 
> scsi0 : SCSI emulation for USB Mass Storage devices
> ...

 

However, the kde media configuration does not seem to work: if I click on the removable icon on the desktop I get the error: "Feature available with HAL"...

I don't get any popup (as I used to) asking to open a new window.

I can mount the device manually with mount command, but the icon on the desktop is not "synchronized" with the mounted device: e.g., when I unmount the device manually it does not realize the device is unmounted.

In the "Storage media" of the KDE Control Panel, in the "Advanced" tab I have 3 checked checkboxes:

Enable HAL Backend

Enable CD Polling

Enable medium application autostart after mount

they are all checked, but the first two are grayed (i.e., they're not modifiable)

----------

## jstead1

So your media is detected and can be mounted, and kde seems to know it is there (I assume this because of the removable icon on the desktop, is this something that is created when you insert the usb key?)

It almost seems as if your kde doesn't know about the new hal.

I say this because of the error you get "Feature available with HAL", as in if you had hal, you could do this.

Have you run revdep-rebuild, it may be that kde needs to be rebuilt along with hal.  I did this right around the time that there was a kde update, and I routinely run revdep-rebuild, so I may have done it without realizing.

----------

## jstead1

Another thing that may be affecting hal is if you have some custom udev rules that use deprecated sysfs files. If you disable the Create deprecated sysfs files in the kernel, the rule could screw things up.  When I had the stable hal and deprecated sysfs files disabled, devices that I had a local udev rule for did not show up at all in kde's media manager.  Devices with no local rule using sysfs, did show up, but as non-removable drives (which don't show up on the desktop or your panel if you don't have the check box on that medium.

As for the box popping up asking for an action (open in new window, or do nothing...) this will only show up if a default action hasn't been chosen.

If the do nothing action has been selected as the auto action, nothing will happen when the medium is mounted.  You can tell what the auto action is in the kde control panel, peripherals, storage media, choose your type from the drop down, and auto action is next to the default action, if nopne have auto action next to them, there is no auto action, and the window asking you to choose will pop up when the device is auto-mounted.  The device will only be automounted if you choose it to be (in the services section of konqueror, storage media, all your devices are shown, you can right click on these and choose properties, and on the mounting tab choose to mount it automatically.

Of course all the above only works if kde, hal and dbus are all working right.  It may be on your system, as I said before, that kde isn't getting hal, or possibly as I said in this post, that a local rule has sysfsified (in a deprecated fashion) your device and made it inaccessible to hal.

----------

## lorebett

 *jstead1 wrote:*   

> So your media is detected and can be mounted, and kde seems to know it is there (I assume this because of the removable icon on the desktop, is this something that is created when you insert the usb key?)
> 
> It almost seems as if your kde doesn't know about the new hal.
> 
> I say this because of the error you get "Feature available with HAL", as in if you had hal, you could do this.
> ...

 

Hi

revdep-rebuild says:

 *Quote:*   

> 
> 
> Dynamic linking on your system is consistent... All done.
> 
> 

 

and the icon on the desktop is always there, i.e., it is not created when I insert the usb key...

----------

## fb

 *lorebett wrote:*   

> 
> 
> Hi
> 
> revdep-rebuild says:
> ...

 

As far as I know that's one of these things that is _not_ caught by revdep-rebuild,

you may want to rebuild the following to make sure: kdelibs,  kdebase-kioslaves, 

kdemultimedia-kioslaves (split ebuild - kdelibs, kdebase and kdemultimedia for monolithic

I think).

I suffer from this problem on ppc but not x86, both machine have a kernel 2.6.20 and 

hal-0.5.7-r3. I think it comes down to the "dmi" use flag that I have enabled on x86 

but is not available on ppc.

----------

