# kernel-2.6.20 declares external harddrives as non-removable!

## kEiNsTeiN

Hi!

I use HAL/dbus/kioslaves. When booting with kernel 2.6.20-viper4, removable devices dont work properly any more.

When I plugin in my USB-Pendrive, everything is fine, window pops up, I can mount and unmount.

Now if I plugin in my external harddrives (with each 2 partitions), nothing happens. 

BUT: if I start the computer with the hardrives already plugged in, kde (hal) detects them. Un- and replugging and they're gone again.

If I kill hald and start it with --daemon=no --verbose, I can see that only the pendrive gets the 

```
Doing addon-storage for /dev/sda (bus scsi) (drive_type disk) (udi /org/freedesktop/Hal/devices/storage_serial_cnmemory_cnmemory_09F08B60715358A2)
```

 part. The HDs dont.

with hal-device [path], I can see the difference between the harddrives and the stick: the stick is considered removable, the drives arent. 

I cant figure out which program specifies the removableness  :Wink:  of devices. Udev? dbus? hal?

yet I couldnt find any problem with udev and dbus and hal  :Smile:  at least not in the configuration files...

I'm currently trying different versions of every involved package, and, what I suspect most, revert from 2.6.20-viper back to the kernel I had before, when it still worked: 2.6.18-emission. 

Any ideas? Cause I ran out of mine....

edit: edited the title so we attract more people  :Very Happy:  kinda desperate for a solution...Last edited by kEiNsTeiN on Sun Mar 18, 2007 2:26 am; edited 3 times in total

----------

## kEiNsTeiN

Okay, I narrowed it down to the kernel. I couldn't find anything I  misconfigured, so my question:

do viper-sources-2.6.20-r4 have problems with removable storage devices?

----------

## kEiNsTeiN

*bump*... 

can it be that no one else has noticed problems with 2.6.20 kernels???

----------

## massimo

Same situation here with 2.6.20-viper4. Interestingly my usb pen drive gets recognised and I get a dialog box for mounting it but my usb hard disk with a fat32 and reiser4 partition does not get recognised at all. This happens on two different Gentoo-boxes, both x86 and running the same kernel as mentioned before, one Intel P4 and the other one AMD 3200+.

----------

## kEiNsTeiN

good. I'm not the only one  :Very Happy: 

Is it just viper4? I'm a little short of time right now, so I cant test it.

Could you report if you stumble upon a working viper-kernel? (or something comparable in speed)

thanks

----------

## xces

I have the same problem using gentoo-sources-2.6.20. No problems with gentoo-sources-2.6.19-r1.

----------

## kEiNsTeiN

okay... what are we going to do about it? Bug report? never done one....

this sucks! help!

----------

## massimo

It's working again. I didn't change anything in the kernel or the kernel as such. Updates that might have solved this: kdelibs-3.5.5-r9 was updated yesterday on my system and until now I didn't plug in any usb hard disk.

----------

## kEiNsTeiN

is this confirmed? 

i dont have direct internet access right now and downloading tarballs just sucks, so I'd only do it if neccessary

----------

## iulica

USB drives shouldn't be removable.  Check here

https://forums.gentoo.org/viewtopic-t-471648.html

for a discussion on the subject and also links to hal messages that explain the issue.

----------

## kEiNsTeiN

There is the problem. The harddrives aren't even hotpluggable!!!!

```
keinstein 10osvendor # hal-device /org/freedesktop/Hal/devices/storage_serial_TOSHIBA_MK6021GAS_DEF106F1A17F

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

  storage.policy.should_mount = false  (bool)

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

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

  storage.requires_eject = false  (bool)

  storage.hotpluggable = false  (bool)

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

  info.category = 'storage'  (string)

  info.product = 'MK6021GAS'  (string)

  info.vendor = 'TOSHIBA'  (string)

  storage.removable = false  (bool)

  storage.physical_device = '/org/freedesktop/Hal/devices/usb_device_4b4_6830_DEF106F1A17F_scsi_host_scsi_device_lun0'  (string)

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

  storage.firmware_version = '0001'  (string)

  storage.serial = 'TOSHIBA_MK6021GAS_DEF106F1A17F'  (string)

  storage.vendor = 'TOSHIBA'  (string)

  storage.model = 'MK6021GAS'  (string)

  storage.drive_type = 'disk'  (string)

  storage.automount_enabled_hint = true  (bool)

  storage.media_check_enabled = false  (bool)

  storage.no_partitions_hint = false  (bool)

  storage.bus = 'scsi'  (string)

  block.is_volume = false  (bool)

  block.minor = 0  (0x0)  (int)

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

  block.device = '/dev/portable'  (string)

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

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

  linux.sysfs_path_device = '/sys/block/sda'  (string)

  linux.sysfs_path = '/sys/block/sda'  (string)
```

and here the output from an usb-stick (which IS WORKING btw...) (note that KDE calls it "(un)mounted hard disk volume", without the "safely remove" feature)

```
keinstein 10osvendor # hal-device /org/freedesktop/Hal/devices/storage_serial_cnmemory_cnmemory_09F08B60715358A2

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

  storage.policy.should_mount = false  (bool)

  info.addons = { 'hald-addon-storage' } (string list)

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

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

  storage.requires_eject = false  (bool)

  storage.hotpluggable = false  (bool)

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

  info.category = 'storage'  (string)

  info.product = 'cnmemory'  (string)

  info.vendor = 'cnmemory'  (string)

  storage.removable = true  (bool)

  storage.physical_device = '/org/freedesktop/Hal/devices/usb_device_8ec_20_09F08B60715358A2_scsi_host_scsi_device_lun0'  (string)

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

  storage.firmware_version = '6.51'  (string)

  storage.serial = 'cnmemory_cnmemory_09F08B60715358A2'  (string)

  storage.vendor = 'cnmemory'  (string)

  storage.model = 'cnmemory'  (string)

  storage.drive_type = 'disk'  (string)

  storage.automount_enabled_hint = true  (bool)

  storage.media_check_enabled = true  (bool)

  storage.no_partitions_hint = false  (bool)

  storage.bus = 'scsi'  (string)

  block.is_volume = false  (bool)

  block.minor = 0  (0x0)  (int)

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

  block.device = '/dev/sda'  (string)

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

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

  linux.sysfs_path_device = '/sys/block/sda'  (string)

  linux.sysfs_path = '/sys/block/sda'  (string)
```

I also noticed that the usbstick takes about 3-4 times as long to show up in kde than with 2.6.18 kernel....

Here's my config: http://illhostit.com/files/e46105b3d9b53fe95e3fbc4ab2c8811c/linux-2.6.20-viper4.txt

and here one it last worked with: http://illhostit.com/files/231ec150d1fb3a8af81dfd0812b23438/linux-2.6.18-emission1.txt

what the fuck? Does anybody else have these problems?

edit: I found _my_ solution:

```
keinstein 10osvendor # cat /etc/hal/fdi/policy/mountpolicies.fdi

<?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->

<deviceinfo version="0.2">

      <device>

        <match key="info.category" string="storage">

          <match key="storage.bus" string="scsi">

            <merge key="storage.removable" type="bool">true</merge>

            <merge key="storage.hotpluggable" type="bool">true</merge>

            <merge key="storage.policy.should_mount" type="bool">true</merge>

          </match>

        </match>

      </device>

</deviceinfo>
```

this will just make all storage devices over scsi very hotpluggable and very removable... (which here applies to all usb-drives, since I dont have real scsi)

this is _not_ perfect. someone please fix that damn kernel?

----------

## l1th10n

I had the same problem with 2.6.21 based kernel and found that upgrading to hal 0.5.9 fixed this problem.

----------

