kernel does not recognize partition on USB stick

Bug #26466 reported by Jimmy Angelakos
10
Affects Status Importance Assigned to Milestone
linux-source-2.6.15 (Ubuntu)
Invalid
Medium
Ben Collins

Bug Description

I've got a SanDisk MobileMate MS+ memory stick reader, with a FAT-formatted
128mb Sony Memory Stick which works perfectly in KNOPPIX 4.0.2 but refuses to
work with Ubuntu Breezy (works with Windows under VMWare though!)

It is not automounted, no icon pops up on the desktop, and I cannot mount or
pmount it using either the msdos filesystem or vfat. When I insert it, /dev/sda
gets created but no /dev/sdaX.

Revision history for this message
Jimmy Angelakos (vyruss) wrote :

Created an attachment (id=5132)
/var/log/syslog output

This is very suspicious:

Nov 24 22:16:23 localhost scsi.agent[15526]: Attribute
/sys/devices/pci0000:00/0000:00:10.3/usb4/4-6/4-6:1.0/host2/target2:0:0/2:0:0:0/type
does not exist

Revision history for this message
Jimmy Angelakos (vyruss) wrote :

Created an attachment (id=5133)
uname -a output

Revision history for this message
Jimmy Angelakos (vyruss) wrote :

Created an attachment (id=5134)
pmount output

Revision history for this message
Jimmy Angelakos (vyruss) wrote :

Created an attachment (id=5135)
fdisk -l output

Revision history for this message
Jimmy Angelakos (vyruss) wrote :

Ubuntu version is Breezy Badger with latest kernel available for it.

Revision history for this message
Jimmy Angelakos (vyruss) wrote :

Created an attachment (id=5136)
gnome-volume-manager 2>&1 | tee gvm.log

Revision history for this message
Jimmy Angelakos (vyruss) wrote :

Created an attachment (id=5137)
dmesg > dmesg.txt

Revision history for this message
Jimmy Angelakos (vyruss) wrote :

Created an attachment (id=5138)
lshal > lshal.txt

Revision history for this message
Jimmy Angelakos (vyruss) wrote :

Created an attachment (id=5139)
ls -l /dev/sd* > devices.txt

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

According to the dmesg output, the kernel does not recognize the partition on
the stick. For cross-checking, what does

  sudo fdisk -l /dev/sda

say?

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

Martin, it's possible that there is no partition map, and that the whole stick
is just formatted to fat (like a floppy). Since it's removable media, this
wouldn't be uncommon.

Jimmy, can you try mounting /dev/sda directly (mount -t vfat /dev/sda /mnt)?

Revision history for this message
Jimmy Angelakos (vyruss) wrote :

"fdisk -l" just gives a long wait (1-2 minutes):

vyruss@gremlin:~$ sudo fdisk -l /dev/sda
Password:
vyruss@gremlin:~$

"mount -t vfat" or "msdos" give the same wait and then:

vyruss@gremlin:~$ sudo mount -t vfat /dev/sda /mnt/stick
mount: /dev/sda is not a valid block device
vyruss@gremlin:~$ sudo mount -t msdos /dev/sda /mnt/stick
mount: /dev/sda is not a valid block device

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

Just noticed something in dmesg. Unload all the vmware junk and try again. Shows
that vmware is doing something (claiming) the usb devices you plug in. I don't
think this is a kernel bug.

Your last test sort of confirms this. The kernel isn't even seeing it as a
device (/dev/sda is not valid).

Revision history for this message
Jimmy Angelakos (vyruss) wrote :

This has been happening since day one, before I installed VMWare. But I'll try
it now anyway:

vyruss@gremlin:~$ sudo /etc/init.d/vmware stop
Password:
Stopping VMware services:
   Virtual machine monitor done
   Bridged networking on /dev/vmnet0 done
   DHCP server on /dev/vmnet1 done
   Host-only networking on /dev/vmnet1 done
   DHCP server on /dev/vmnet8 done
   NAT service on /dev/vmnet8 done
   Host-only networking on /dev/vmnet8 done
   Virtual ethernet done

dmesg shows:

[4459267.808000] /dev/vmmon[28652]: Module vmmon: unloaded
[4459268.426000] bridge-eth0: down
[4459268.426000] bridge-eth0: detached
[4459292.972000] atkbd.c: Unknown key released (translated set 2, code 0xaa on
isa0060/serio0).
[4459292.972000] atkbd.c: Use 'setkeycodes e02a <keycode>' to make it known.
[4459293.642000] atkbd.c: Unknown key pressed (translated set 2, code 0xaa on
isa0060/serio0).
[4459293.642000] atkbd.c: Use 'setkeycodes e02a <keycode>' to make it known.
[4459293.854000] atkbd.c: Unknown key released (translated set 2, code 0xaa on
isa0060/serio0).
[4459293.854000] atkbd.c: Use 'setkeycodes e02a <keycode>' to make it known.
[4459293.954000] atkbd.c: Unknown key pressed (translated set 2, code 0xaa on
isa0060/serio0).
[4459293.954000] atkbd.c: Use 'setkeycodes e02a <keycode>' to make it known.
[4459313.469000] usb 4-6: new high speed USB device using ehci_hcd and address 8
[4459313.663000] scsi5 : SCSI emulation for USB Mass Storage devices
[4459313.681000] usb-storage: device found at 8
[4459313.681000] usb-storage: waiting for device to settle before scanning
[4459318.682000] Vendor: Generic Model: STORAGE DEVICE Rev: 9144
[4459318.682000] Type: Direct-Access ANSI SCSI revision: 00
[4459321.853000] SCSI device sda: 253888 512-byte hdwr sectors (130 MB)
[4459321.854000] sda: Write Protect is off
[4459321.854000] sda: Mode Sense: 02 00 00 00
[4459321.854000] sda: assuming drive cache: write through
[4459321.870000] SCSI device sda: 253888 512-byte hdwr sectors (130 MB)
[4459321.871000] sda: Write Protect is off
[4459321.871000] sda: Mode Sense: 02 00 00 00
[4459321.871000] sda: assuming drive cache: write through
[4459321.871000] /dev/scsi/host5/bus0/target0/lun0:

And everything is the same as before, so it's not VMWare.

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

Ok, now, after unloading vmware, please try mounting /dev/sda directly, and also
try "sudo fdisk -l /dev/sda".

Revision history for this message
Jimmy Angelakos (vyruss) wrote :

When I said everything is the same I meant I get the exact same output as
(running the fdisk and mounts) before, so I saved some time by not pasting it :)

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

(In reply to comment #16)
> When I said everything is the same I meant I get the exact same output as
> (running the fdisk and mounts) before, so I saved some time by not pasting it :)

Then something just isn't making sense. Did mount give you the same message, as
in "is not a valid block device"? Because the kernel would be seriously
contradicting itself (showing the device in dmesg, but returning EINVAL for
reading it).

Can you try this please:

dd if=/dev/sda of=/dev/null bs=2048 count=1

I just want to see if a raw read of the device works.

Revision history for this message
Jimmy Angelakos (vyruss) wrote :

vyruss@gremlin:~$ dd if=/dev/sda of=/dev/null bs=2048 count=1

Long wait and then:

dd: opening `/dev/sda': No such device or address

And this is why I always get a long wait:

[4294838.868000] /dev/scsi/host0/bus0/target0/lun0:<6>scsi: Device offlined - n
ot ready after error recovery: host 0 channel 0 id 0 lun 0
[4294959.075000] SCSI error : <0 0 0 0> return code = 0x50000
[4294959.075000] end_request: I/O error, dev sda, sector 0
[4294959.075000] Buffer I/O error on device sda, logical block 0
[4294959.075000] scsi0 (0:0): rejecting I/O to offline device
[4294959.075000] Buffer I/O error on device sda, logical block 0
[4294959.075000] unable to read partition table
[4294959.075000] Attached scsi removable disk sda at scsi0, channel 0, id 0, lun
 0 (...)

It tries for 1-2 minutes, then the device is disconnected and reconnected and
the same happens forever...

Revision history for this message
Jimmy Angelakos (vyruss) wrote :

I just tried compiling the standard Breezy kernel with USB Mass Storage verbose
debug (CONFIG_USB_STORAGE_DEBUG) enabled just to see what it says. I'm attaching
the new /var/log/syslog as syslog-debug.txt .

Revision history for this message
Jimmy Angelakos (vyruss) wrote :

Created an attachment (id=5267)
/var/log/syslog with CONFIG_USB_STORAGE_DEBUG enabled in kernel

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

Thanks, this does give me some extra info to go on.

Revision history for this message
Nicolas Aguirre (aguirre-nicolas) wrote :

I have same problem with Ipod 5G 30Go. Dapper flight 3 and Linux kernel 2.6.15-15-k7 #1 SMP PREEMPT

I attach dmesg output :

[4295354.748000] usb 3-6: new high speed USB device using ehci_hcd and address 3[4295354.863000] usb 3-6: configuration #1 chosen from 2 choices
[4295354.864000] scsi1 : SCSI emulation for USB Mass Storage devices
[4295354.864000] usb-storage: device found at 3
[4295354.864000] usb-storage: waiting for device to settle before scanning
[4295359.864000] Vendor: Apple Model: iPod Rev: 1.62
[4295359.864000] Type: Direct-Access ANSI SCSI revision: 00
[4295361.718000] SCSI device sda: 58605120 512-byte hdwr sectors (30006 MB)
[4295361.719000] sda: Write Protect is off
[4295361.719000] sda: Mode Sense: 6c 00 00 08
[4295361.719000] sda: assuming drive cache: write through
[4295361.720000] SCSI device sda: 58605120 512-byte hdwr sectors (30006 MB)
[4295361.722000] sda: Write Protect is off
[4295361.722000] sda: Mode Sense: 6c 00 00 08
[4295361.722000] sda: assuming drive cache: write through
[4295361.722000] sda: sda1 sda2
[4295361.738000] sd 1:0:0:0: Attached scsi removable disk sda
[4295361.738000] sd 1:0:0:0: Attached scsi generic sg0 type 0
[4295361.738000] usb-storage: device scan complete
[4295362.133000] usb 3-6: reset high speed USB device using ehci_hcd and address 3
[4295392.350000] usb 3-6: reset high speed USB device using ehci_hcd and address 3
[4295402.567000] usb 3-6: reset high speed USB device using ehci_hcd and address 3

and when I try to mount the device :

[4294845.847000] sd 0:0:0:0: rejecting I/O to offline device

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

This looks familiar: Please remove all USB devices, do

  sudo rmmod ehci_hcd

and try again. This disables the USB 2.0 driver and uses the 1.1 one, which is much slower, but more stable. Does that help?

Revision history for this message
Jimmy Angelakos (vyruss) wrote :

Thanks a lot, Martin! That worked! However this is an awful kludge and I believe there should be a proper fix in the kernel for our USB2 devices...

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

I've back ported some EHCI fixes from 2.6.16-git. Please test them once 2.6.15-17.25 gets upload (some time next week.

Changed in linux-source-2.6.15:
status: Confirmed → Needs Info
Revision history for this message
Jimmy Angelakos (vyruss) wrote :

I'm in the process of dist-upgrading from breezy to dapper and in an hour or two I'll be able to test. Current is 2.6.15-17.26, is that good for testing Ben?

Revision history for this message
Jimmy Angelakos (vyruss) wrote :

I'm sorry, the problem isn't fixed with 2.6.15-17.26 (k7).

Revision history for this message
Jimmy Angelakos (vyruss) wrote :

2.6.15-18.27 (k7) makes the usb stick stop working altogether, even with the uhci_hcd driver...! Same symptoms.

Revision history for this message
Tormod Volden (tormodvolden) wrote :

Does it work in Dapper final, or Edgy?

Revision history for this message
Jimmy Angelakos (vyruss) wrote :

Have now changed my PC and have encountered no USB problems whatsoever (Hardy Beta). Closing bug since nobody else had the same issue.

Revision history for this message
Jimmy Angelakos (vyruss) wrote :

Please close this bug ?

Changed in linux-source-2.6.15:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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