# Automounting of USB devices no longer working

## mihochan

I recently upgraded the kernel to 2.6.20 and now my usb stick automount is not working.

I was using DBUS, HAL and IVMAN to automount USB devices but this has suddenly stopped working.

I upgraded all the packages and reinstalled them but still no joy.

The system logs are not very helpful. This appears when I plug in the device

```

Apr 12 10:20:10 [kernel] usb 1-1: new full speed USB device using uhci_hcd and address 5

Apr 12 10:20:10 [kernel] usb 1-1: configuration #1 chosen from 1 choice

```

but nothing is logged by DBUS, HAL or IVMAN as I would have expected.

Also when I start hald I get these messages.

```

* Stopping Automounter ...                                               [ ok ] 

* Stopping Hardware Abstraction Layer daemon ...               [ ok ] 

* Starting Hardware Abstraction Layer daemon ...                 [ ok ] 

* Starting Automounter ...

/bin/sh: /proc/sys/dev/cdrom/lock: No such file or directory              [ ok ]

```

Does anyone have any clues as to what might be going on?

Thanks

----------

## mihochan

Switching back to the old kernel everything works fine. 

Here is the system log when I plug in the USB device

```

Apr 13 08:54:08 [kernel] usb 1-2: new full speed USB device using uhci_hcd and address 2

Apr 13 08:54:08 [kernel] usb 1-2: configuration #1 chosen from 1 choice

Apr 13 08:54:09 [kernel] Initializing USB Mass Storage driver...

Apr 13 08:54:09 [kernel] scsi0 : SCSI emulation for USB Mass Storage devices

Apr 13 08:54:09 [kernel] usbcore: registered new interface driver usb-storage

Apr 13 08:54:09 [kernel] USB Mass Storage support registered.

Apr 13 08:54:14 [kernel] usb 1-2: reset full speed USB device using uhci_hcd and address 2

Apr 13 08:54:14 [kernel] usb 1-2: device firmware changed

Apr 13 08:54:14 [kernel] usb 1-2: new full speed USB device using uhci_hcd and address 3

Apr 13 08:54:14 [kernel] usb 1-2: configuration #1 chosen from 1 choice

Apr 13 08:54:14 [kernel] scsi1 : SCSI emulation for USB Mass Storage devices

Apr 13 08:54:19 [kernel] scsi 1:0:0:0: Direct-Access     DSE      MICRO AV         1.00 PQ: 0 ANSI: 0 CCS

Apr 13 08:54:20 [kernel] SCSI device sda: 2024865 512-byte hdwr sectors (1037 MB)

Apr 13 08:54:20 [kernel] sda: Write Protect is off

Apr 13 08:54:20 [kernel] sda: assuming drive cache: write through

Apr 13 08:54:20 [kernel] SCSI device sda: 2024865 512-byte hdwr sectors (1037 MB)

Apr 13 08:54:20 [kernel] sda: Write Protect is off

Apr 13 08:54:20 [kernel] sd 1:0:0:0: Attached scsi removable disk sda

```

This is very strange as the new kernel was built with the same .config file

----------

## mihochan

Any ideas anyone why the SCSI emulation doesn't kick in? SCSI device support and SCSI disk support are both selected and loaded as modules. 

I've got the machine to select USB 1-2 by dropping the OHCI module

----------

## aries

Hi mihochan,

Same problem over here: 2.6.19-gentoo-r5 works fine, 2.6.20-gentoo-r6 does not.

But no idea what's going on.

----------

## terracotta_shore

Hi.

Thought I'd bump this thread by saying that I'm getting a similar problem (USB HD not automounting with the 2.6.20-r6 kernel, but no problem with USB flash drive or internal USB card reader) with Gnome. See this thread.

Anyone any more ideas?

----------

## aries

With this KDE automount works for me:  enable create sysfs files in the kernel .

```

 Kernel Configuration

     General setup  --->  

        ....

        [*] Create deprecated sysfs files

        .....    
```

Why does automount not work without sysfs? 

When you read the subject kernel help

```
 If you are using a distro that was released in 2006 or later, 

 it should be safe to say N here. 
```

My make.conf does not use the sysfs use-flag.

Any idea?

[edit]The kernel I used is gentoo-2.6.21, but 2.6.20 has the same option for sysfs [/edit]

----------

## urcindalo

 *aries wrote:*   

> With this KDE automount works for me:  enable create sysfs files in the kernel .
> 
> ```
> 
>  Kernel Configuration
> ...

 

I have also a problem with USB sticks since I upgraded to kernel 2.6.20-r7 (stable gentoo-sources on AMD64). I didn't activate the option you mention when cinfiguring the new kernel:

```
/usr/src/linux $ cat .config | grep SYSFS

# CONFIG_SYSFS_DEPRECATED is not set

# CONFIG_PM_SYSFS_DEPRECATED is not set

CONFIG_RTC_INTF_SYSFS=m

CONFIG_SYSFS=y
```

As a consequence, it is not that my USB sticks are not recognized. It is that they are considered regular hard disks. Let me explain.

I use KDE. When I boot with my old kernel (2.6.19-r5) and insert a USB stick, KDE informs me a new device type has been found, with three options: open a new folder, download photos with digiKam and do nothing. If I open it, I see a USB stick icon appearing in the Media Applet.

But if I boot with the new kernel, KDE tells me an unmounted hard disk volume has been found when I plug in the USB stick, and shows me only two options (the 'digiKam' one is missing). If I mount it, no USB stick icon appears in the Media Applet. However, if I configure the Media Applet to show also the mounted hard drives, then an icon representing the USB sticks appears.

So, the question is: why does the new kernel consider a USB stick is a regular hard disk?   :Confused: 

----------

## TheCoop

have a look at the lshal output for your usb harddisks - whats the value of storage.bus?

----------

## aries

1. The  KDE automount + kernel >2.6.20 problem:

The reason for this problem is the HAL version:

This works for me / solved the problem:

- hal-0.5.9-r1

- kernel: gentoo-2.6.21 with the deprecated sysfs not enabled

```

 Kernel Configuration 

     General setup  --->  

        .... 

        [ ] Create deprecated sysfs files 
```

2. USB disk as regular harddisks:

Sorry urcindalo, I have not seen this problem on my x86.

----------

## urcindalo

 *TheCoop wrote:*   

> have a look at the lshal output for your usb harddisks - whats the value of storage.bus?

 

```
  storage.bus = 'scsi'  (string)  storage.bus = 'scsi'  (string)
```

It is recognized as a SCSI device. I think it's OK, isn't it?

When I got the chance I'll try updating my hal from stable 0.5.7.1-r3 to ~0.5.9-r1, as aries suggests.

----------

## terracotta_shore

Thanks, aries. Unmasking and merging hal-0.5.9-r1 solves my (slightly different) automount problem in Gnome with both the 2.6.20-gentoo-r6 and 2.6.21-gentoo kernels.

----------

## urcindalo

 *urcindalo wrote:*   

> When I got the chance I'll try updating my hal from stable 0.5.7.1-r3 to ~0.5.9-r1, as aries suggests.

 

I just updated also to hal-0.5.9-r1 (~AMD64) and everything's back to normal   :Very Happy: 

Thanks, aries.

----------

## fb

I kind of have a similar issue. I have two machine a x86 one and a ppc one.

I have the problem on the ppc machine but not on x86. They are configured 

in the way as much as possible. Both have a kernel 2.6.20 and hal-0.5.7-r3.

The difference is that on x86 hal is compiled with USE="dmi" which pulls dmidecode,

I don't have it enabled on ppc - in fact it is hard masked on ppc so I cannot 100%

check that just including that flag solve the problem.

----------

