kernel does not regard some USB devices as removable

Bug #20303 reported by rubinstein
This bug report is a duplicate of:  Bug #11517: Can not eject removable devices. Edit Remove
14
Affects Status Importance Assigned to Milestone
linux-source-2.6.15 (Ubuntu)
Invalid
Medium
Ben Collins

Bug Description

This is with breezy.
When I plug my external usb drive in it fails to create an icon on the desktop.
dmesg shows that it recognises the drive, and I also can mount it manually.
With hoary I get the icon on the desktop.

dmesg output:
[4294766.749000] usb 5-6: new high speed USB device using ehci_hcd and address
2[4294767.053000] Initializing USB Mass Storage driver...
[4294767.058000] scsi2 : SCSI emulation for USB Mass Storage devices
[4294767.060000] usb-storage: device found at 2
[4294767.060000] usb-storage: waiting for device to settle before scanning
[4294767.060000] usbcore: registered new driver usb-storage
[4294767.060000] USB Mass Storage support registered.
[4294772.063000] Vendor: SAMSUNG Model: SV1204H Rev: 0811
[4294772.063000] Type: Direct-Access ANSI SCSI revision: 00
[4294772.066000] SCSI device sdb: 234493056 512-byte hdwr sectors (120060 MB)
[4294772.066000] sdb: assuming drive cache: write through
[4294772.069000] SCSI device sdb: 234493056 512-byte hdwr sectors (120060 MB)
[4294772.069000] sdb: assuming drive cache: write through
[4294772.069000] /dev/scsi/host2/bus0/target0/lun0: p1
[4294772.084000] Attached scsi disk sdb at scsi2, channel 0, id 0, lun 0
[4294772.085000] usb-storage: device scan complete

Revision history for this message
Matt Zimmerman (mdz) wrote :
Revision history for this message
Martin Pitt (pitti) wrote :

So the device is not mounted automatically? If that's the case, then please do
the debugging procedure. Or is the device mounted automatically, but you just
don't get an icon and/or a Nautilus (file manager) icon for it?

Revision history for this message
rubinstein (rubinstein) wrote :

Created an attachment (id=3364)
gvm.log

Revision history for this message
rubinstein (rubinstein) wrote :

Created an attachment (id=3365)
lshal.txt

Revision history for this message
rubinstein (rubinstein) wrote :

Created an attachment (id=3366)
devices.txt

Revision history for this message
rubinstein (rubinstein) wrote :

Created an attachment (id=3367)
dmesg.txt

Revision history for this message
rubinstein (rubinstein) wrote :

(In reply to comment #2)
> So the device is not mounted automatically?
It is not mounted automatically, I have to mount it myself.
gvm.log says "manager.c/1516: not a mountable volume:
/org/freedesktop/Hal/devices/storage_model_SV1204H"

Revision history for this message
Martin Pitt (pitti) wrote :

brw-rw---- 1 root disk 8, 0 2005-08-24 10:50 /dev/sda

Here we have the reason -- your device permissions are wrong. A recent udev
upgrade was supposed to fix this (see #13520). What is your udev version? Can
you please upgrade to the latest one (0.060-1ubuntu6) and try again?

Revision history for this message
rubinstein (rubinstein) wrote :

(In reply to comment #8)
> What is your udev version? Can
> you please upgrade to the latest one (0.060-1ubuntu6) and try again?
I already have the latest udev 0.060-1ubuntu6; I did a "dpkg-reconfigure udev" ,
but it didn't help either.

Revision history for this message
Martin Pitt (pitti) wrote :

(In reply to comment #9)
> (In reply to comment #8)
> > What is your udev version? Can
> > you please upgrade to the latest one (0.060-1ubuntu6) and try again?
> I already have the latest udev 0.060-1ubuntu6; I did a "dpkg-reconfigure udev" ,
> but it didn't help either.
>
OK, thanks for checking this.

Can you please give me the output of

 sh -x /etc/udev/scripts/removable.sh /dev/sda

Revision history for this message
rubinstein (rubinstein) wrote :

to comment #8:
> brw-rw---- 1 root disk 8, 0 2005-08-24 10:50 /dev/sda
/dev/sda is my sata harddisk
/dev/sdb is the usb drive

so...
sh -x /etc/udev/scripts/removable.sh /dev/sda
+ DEV=/dev/sda
+ SCAN_BUS=
+ BLOCKPATH=/sys/block//dev/sda
+ '[' -d /sys/block//dev/sda ']'
+ exit 1

sh -x /etc/udev/scripts/removable.sh /dev/sdb
+ DEV=/dev/sdb
+ SCAN_BUS=
+ BLOCKPATH=/sys/block//dev/sdb
+ '[' -d /sys/block//dev/sdb ']'
+ exit 1

Revision history for this message
Martin Pitt (pitti) wrote :

(In reply to comment #10)
>
> Can you please give me the output of
>
> sh -x /etc/udev/scripts/removable.sh /dev/sda

Sorry, my fault. It is really

   sh -x /etc/udev/scripts/removable.sh sda

Can you please do it again? Thanks!

Revision history for this message
rubinstein (rubinstein) wrote :

Do you really want sda? sda is my sata drive inside the computer, sdb is the
external usb drive.
rs@ubuntu:~$ sh -x /etc/udev/scripts/removable.sh sda
+ DEV=sda
+ SCAN_BUS=
+ BLOCKPATH=/sys/block/sda
+ '[' -d /sys/block/sda ']'
++ read_value /sys/block/sda/removable
++ local value
++ read -r value
++ echo 0
+ IS_REMOVABLE=0
+ '[' 0 '!=' 1 -a '' ']'
+ '[' 0 = 1 ']'
+ echo 0
0
+ exit 0
rs@ubuntu:~$ sh -x /etc/udev/scripts/removable.sh sdb
+ DEV=sdb
+ SCAN_BUS=
+ BLOCKPATH=/sys/block/sdb
+ '[' -d /sys/block/sdb ']'
++ read_value /sys/block/sdb/removable
++ local value
++ read -r value
++ echo 0
+ IS_REMOVABLE=0
+ '[' 0 '!=' 1 -a '' ']'
+ '[' 0 = 1 ']'
+ echo 0
0
+ exit 0
rs@ubuntu:~$

Revision history for this message
Martin Pitt (pitti) wrote :

(In reply to comment #13)
> Do you really want sda? sda is my sata drive inside the computer, sdb is the
> external usb drive.

No, sda was meant as an example. Correct, I was actually interested in sdb. :-)

> ++ read_value /sys/block/sdb/removable
> ++ local value
> ++ read -r value
> ++ echo 0
> + IS_REMOVABLE=0

There we have. Your kernel does not regard your USB device as removable.

We actually had a workaround for that in udev, but it's disabled now for some
reason. I will reenable it.

However, eventually this is a kernel bug.

Revision history for this message
Martin Pitt (pitti) wrote :

 udev (0.060-1ubuntu8) breezy; urgency=low
 .
   * extra/permissions.rules: When calling removable.sh, additionally scan usb
     and ieee1394 buses since sometimes the kernel does not regard those as
     removable. (Ubuntu #14063)
   * extra/removable.sh: Remove the quoting in the 'for bus in "$SCAN_BUS"'
     loop to make the loop actually work.

This should help. However, since eventually the kernel should be able to
properly tell apart removable and non-removable devices, I reassign this to Ben.
After all, it works for most devices.

Revision history for this message
rubinstein (rubinstein) wrote :

Thanks, now it works.
However, if I want to unmount it (right-click, Unmount volume), Nautilus tells me
"Unable to eject media"
"eject: unable to eject, last error: Invalid argument"
But actually the drive is unmounted:
# umount /dev/sdb5
umount: /dev/sdb5: not mounted
Should I file an extra bug report about this?

Revision history for this message
Martin Pitt (pitti) wrote :

*** Bug 20285 has been marked as a duplicate of this bug. ***

Revision history for this message
Nikolaus Rath (nikratio) wrote :

Coming from bug 20285, I'd like to add that the problem is still present after I
upgraded to breezy.

Revision history for this message
Ben Collins (ben-collins) wrote :

If possible, please upgrade to Dapper's 2.6.15-7 kernel. If you do not want to
upgrade to Dapper, then you can also wait for the Dapper Flight 2 CD's, which
are due out within the next few days.

Let me know if this bug still exists with this kernel.

Revision history for this message
rubinstein (rubinstein) wrote :

(In reply to comment #19)
> If possible, please upgrade to Dapper's 2.6.15-7 kernel. If you do not want to
> upgrade to Dapper, then you can also wait for the Dapper Flight 2 CD's, which
> are due out within the next few days.
>
> Let me know if this bug still exists with this kernel.
I made a Dapper Drake test partition and have Linux ubuntu 2.6.15-8-386 #1
PREEMPT Tue Dec 13
Unfortunately behaviour is the same as comment #16.

Revision history for this message
Ben Collins (ben-collins) wrote :

> > Let me know if this bug still exists with this kernel.
> I made a Dapper Drake test partition and have Linux ubuntu 2.6.15-8-386 #1
> PREEMPT Tue Dec 13
> Unfortunately behaviour is the same as comment #16.

See if "sudo eject -s /dev/sdb" works from the command line. I suspect this is
the same issue as another bug report. If that works, then I'll merge it into
that one.

Revision history for this message
rubinstein (rubinstein) wrote :

(In reply to comment #21)
> See if "sudo eject -s /dev/sdb" works from the command line. I suspect this is
> the same issue as another bug report. If that works, then I'll merge it into
> that one.

Yes, "sudo eject -s /dev/sdb1" works for me (sdb1) so I think you can merge the
bug reports.

Revision history for this message
Ben Collins (ben-collins) wrote :

This bug has been marked as a duplicate of bug 11517.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.