# usb stick problem after upgrade to 2.6.9

## fb

Hi,

I have upgraded to kernel 2.6.9-r1 last week from kernel

2.6.7-r11. I got a new USB stick this morning (a model 

identical to one I had before and that I have given to my 

wife), this model used to work with the kernel 2.6.7 but 

for some reason with 2.6.9 I cannot mount it or access

it.

I know it comes from the kernel upgrade as I still have my

kernel 2.6.7 around and I booted it to see if the stick was

OK. With kernel 2.6.7 I can mount the stick and use fdisk

on it (fdisk /dev/sda). With the kernel 2.6.9 nothing. Here

is what I get in /var/log/messages when I plug it:

```
Oct 30 17:30:44 vrooom Initializing USB Mass Storage driver...

Oct 30 17:30:44 vrooom usbcore: registered new driver usb-storage

Oct 30 17:30:44 vrooom USB Mass Storage support registered.

Oct 30 17:31:04 vrooom usb 1-5: new high speed USB device using address 6

Oct 30 17:31:04 vrooom uba: device 6 capacity nsec 50 bsize 512

Oct 30 17:31:04 vrooom uba: made changed

Oct 30 17:31:04 vrooom uba: device 6 capacity nsec 50 bsize 512

Oct 30 17:31:04 vrooom uba: device 6 capacity nsec 50 bsize 512

Oct 30 17:31:04 vrooom /dev/ub/a:end_request: I/O error, dev uba, sector 0

Oct 30 17:31:04 vrooom Buffer I/O error on device uba, logical block 0

Oct 30 17:31:04 vrooom end_request: I/O error, dev uba, sector 2

Oct 30 17:31:04 vrooom Buffer I/O error on device uba, logical block 1

Oct 30 17:31:04 vrooom end_request: I/O error, dev uba, sector 4

Oct 30 17:31:04 vrooom Buffer I/O error on device uba, logical block 2

Oct 30 17:31:04 vrooom end_request: I/O error, dev uba, sector 6

Oct 30 17:31:04 vrooom Buffer I/O error on device uba, logical block 3

Oct 30 17:31:04 vrooom end_request: I/O error, dev uba, sector 6

Oct 30 17:31:04 vrooom Buffer I/O error on device uba, logical block 3

Oct 30 17:31:04 vrooom end_request: I/O error, dev uba, sector 4

Oct 30 17:31:04 vrooom Buffer I/O error on device uba, logical block 2

Oct 30 17:31:04 vrooom end_request: I/O error, dev uba, sector 2

Oct 30 17:31:04 vrooom Buffer I/O error on device uba, logical block 1

Oct 30 17:31:04 vrooom end_request: I/O error, dev uba, sector 0

Oct 30 17:31:04 vrooom Buffer I/O error on device uba, logical block 0

Oct 30 17:31:04 vrooom unable to read partition table

Oct 30 17:31:04 vrooom /dev/ub/a:end_request: I/O error, dev uba, sector 2

Oct 30 17:31:04 vrooom Buffer I/O error on device uba, logical block 1

Oct 30 17:31:04 vrooom end_request: I/O error, dev uba, sector 4

Oct 30 17:31:04 vrooom Buffer I/O error on device uba, logical block 2

Oct 30 17:31:04 vrooom end_request: I/O error, dev uba, sector 6

Oct 30 17:31:04 vrooom Buffer I/O error on device uba, logical block 3

Oct 30 17:31:04 vrooom end_request: I/O error, dev uba, sector 0

Oct 30 17:31:04 vrooom Buffer I/O error on device uba, logical block 0

Oct 30 17:31:04 vrooom unable to read partition table

```

I don't really understand what is happening there, for info

I use udev-030 and I still have devfs around in case.

Any help appreciated,

 fb[/code]

----------

## furanku

There had been some changes since 2.6.8.1 in the usb-storage driver, which broke compabilty with some devices, this is also dicussed in another thread

----------

## dsd

the thread linked above isn't really relevant here (no offence intended, furanku!).

this thread will hopefully help instead:

https://forums.gentoo.org/viewtopic.php?p=1707688

----------

## furanku

 *dsd wrote:*   

> no offence intended, furanku!

 

You're welcome! Thanks for the correction  :Wink: 

----------

## fb

Thanks for your help.

The situation has improved somewhat after I followed the

instructions from the thread pointed out by dsd.

I now have the sda device again, however it doesn't

completely solve my problem. While the stick is 

recognized and get assigned to /dev/sda, /dev/sda1

isnot created because the partition table cannot be read.

Using "fdisk /dev/sda" I can read the partition table and

after quitting fdisk I am abble to mount the stick.

having to use fdisk before you can mount the device is not

very practical there is probably something else going on.

Here is the output of dmesg:

```
usb 1-6: new high speed USB device using address 3

scsi0 : SCSI emulation for USB Mass Storage devices

  Vendor: KINGMAX   Model: USB Flash Disk    Rev: 2.00

  Type:   Direct-Access                      ANSI SCSI revision: 02

sda: Unit Not Ready, sense:

Current : sense = 70  6

ASC=28 ASCQ= 0

Raw sense data:0x70 0x00 0x06 0x00 0x00 0x00 0x00 0x0a 0x00 0x00 0x00 0x00 0x28 0x00 0x00 0x00 0x00 0x00

sda : READ CAPACITY failed.

sda : status=1, message=00, host=0, driver=08

Current sd: sense = 70  6

ASC=28 ASCQ= 0

Raw sense data:0x70 0x00 0x06 0x00 0x00 0x00 0x00 0x0a 0x00 0x00 0x00 0x00 0x28 0x00 0x00 0x00 0x00 0x00

sda: assuming Write Enabled

sda: assuming drive cache: write through

sda: Unit Not Ready, sense:

Current : sense = 70  6

ASC=28 ASCQ= 0

Raw sense data:0x70 0x00 0x06 0x00 0x00 0x00 0x00 0x0a 0x00 0x00 0x00 0x00 0x28 0x00 0x00 0x00 0x00 0x00

sda : READ CAPACITY failed.

sda : status=1, message=00, host=0, driver=08

Current sd: sense = 70  6

ASC=28 ASCQ= 0

Raw sense data:0x70 0x00 0x06 0x00 0x00 0x00 0x00 0x0a 0x00 0x00 0x00 0x00 0x28 0x00 0x00 0x00 0x00 0x00

sda: assuming Write Enabled

sda: assuming drive cache: write through

sda: Unit Not Ready, sense:

Current : sense = 70  6

ASC=28 ASCQ= 0

Raw sense data:0x70 0x00 0x06 0x00 0x00 0x00 0x00 0x0a 0x00 0x00 0x00 0x00 0x28 0x00 0x00 0x00 0x00 0x00

sda : READ CAPACITY failed.

sda : status=1, message=00, host=0, driver=08

Current sd: sense = 70  6

ASC=28 ASCQ= 0

Raw sense data:0x70 0x00 0x06 0x00 0x00 0x00 0x00 0x0a 0x00 0x00 0x00 0x00 0x28 0x00 0x00 0x00 0x00 0x00

sda: assuming Write Enabled

sda: assuming drive cache: write through

 /dev/scsi/host0/bus0/target0/lun0:end_request: I/O error, dev sda, sector 0

Buffer I/O error on device sda, logical block 0

Buffer I/O error on device sda, logical block 0

 unable to read partition table

 /dev/scsi/host0/bus0/target0/lun0:<3>Buffer I/O error on device sda, logical block 0

 unable to read partition table

Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0

Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0,  type 0

USB Mass Storage device found at 3

```

After using fdisk the new entry show:

```
SCSI device sda: 512000 512-byte hdwr sectors (262 MB)

sda: assuming Write Enabled

sda: assuming drive cache: write through

SCSI device sda: 512000 512-byte hdwr sectors (262 MB)

sda: assuming Write Enabled

sda: assuming drive cache: write through

 /dev/scsi/host0/bus0/target0/lun0: p1

```

I did a "make mrproper" before reconfiguriing and recompiling

the kernel. I didnot put the low-powered device as per the

indicated thread and I enabled usb-storage but not the bit

checking for write protection.

Any further help appreciated. By the way the stick works on

the other computers I have access to (iMac G4 dual booting

Mac OS X/ gentoo linux [kernel 2.6.7] and powerMac G3 OS X. 

Works on both computers and both OSes), the only problematic

platform being my x86 PC.

Cheers,

 Francois

----------

## dsd

strange. do you have any other USB storage devices you can try in your x86 system? has this memory stick worked first-time on any previous kernels?

----------

## fb

I had an identical model that worked perfectly the first time

on the x86 system, after I had loaded usb-storage which

wasn't at the time in my modules.autoload.d configuration.

That was with a 2.6.7 kernel, I didn't do much with 2.6.8.

However I think I remember that when I tried the that stick

with my 2.6.7 kernel (which is still around as I usually keep

my previous working kernel in case) I had to go through fdisk

as well.

I will give it a go again with the 2.6.7 kernel this evening 

and keep you posted with the relevant logs. It could be

there is also something that changed with udev 030 as I

was also using an earlier version of udev with the previous stick.

----------

## fb

OK. So it seems that I have the same problem with the

2.6.7 kernel on my PC. I will check on my ppc install if

it behaves in this way as well, it is also a 2.6.7 kernel. If

it is udev related it should show there as well. It 

doesn't behave that way however on OS X, which I am

glad   :Smile:   because I am not sure how I would deal with it.

----------

## fb

I see there is a few other people with this problem.

Anyway I tried on my Mac under linux just to make things clear

```
bash-2.05b$ uname -a

Linux it019727 2.6.7-gentoo-r14 #2 Thu Sep 30 11:40:25 NZST 2004 ppc 7450, altivec supported PowerMac4,2 GNU/Linux

```

And it did work and mount on the first try without problem.

Here is the output of dmesg:

```
usb 1-2: new full speed USB device using address 3

scsi0 : SCSI emulation for USB Mass Storage devices

  Vendor: KINGMAX   Model: USB Flash Disk    Rev: 2.00

  Type:   Direct-Access                      ANSI SCSI revision: 02

sda: Unit Not Ready, sense:

Current : sense = 70  6

ASC=28 ASCQ= 0

Raw sense data:0x70 0x00 0x06 0x00 0x00 0x00 0x00 0x0a 0x00 0x00 0x00 0x00 0x28 0x00 0x00 0x00 0x00 0x00

sda : READ CAPACITY failed.

sda : status=1, message=00, host=0, driver=08

Current sd: sense = 70  6

ASC=28 ASCQ= 0

Raw sense data:0x70 0x00 0x06 0x00 0x00 0x00 0x00 0x0a 0x00 0x00 0x00 0x00 0x28 0x00 0x00 0x00 0x00 0x00

sda: assuming Write Enabled

sda: assuming drive cache: write through

sda: Unit Not Ready, sense:

Current : sense = 70  6

ASC=28 ASCQ= 0

Raw sense data:0x70 0x00 0x06 0x00 0x00 0x00 0x00 0x0a 0x00 0x00 0x00 0x00 0x28 0x00 0x00 0x00 0x00 0x00

SCSI device sda: 512000 512-byte hdwr sectors (262 MB)

sda: assuming Write Enabled

sda: assuming drive cache: write through

SCSI device sda: 512000 512-byte hdwr sectors (262 MB)

sda: assuming Write Enabled

sda: assuming drive cache: write through

 /dev/scsi/host0/bus0/target0/lun0: p1

 /dev/scsi/host0/bus0/target0/lun0: p1

devfs_mk_dev: could not append to parent for scsi/host0/bus0/target0/lun0/part1

kobject_register failed for sda1 (-17)

Call trace:

 [c0109b4c] kobject_register+0x60/0x78

 [c0087640] add_partition+0xdc/0x11c

 [c00877e8] register_disk+0x168/0x184

 [c013e2dc] add_disk+0x58/0x74

 [e33149c8] sd_probe+0x254/0x37c [sd_mod]

 [c0135a28] bus_match+0x50/0x9c

 [c0135acc] device_attach+0x58/0xc0

 [c0135d10] bus_add_device+0x78/0xd4

 [c0134460] device_add+0x94/0x174

 [e3331f58] scsi_sysfs_add_sdev+0x48/0x284 [scsi_mod]

 [e3330868] scsi_probe_and_add_lun+0x5bc/0x908 [scsi_mod]

 [e3330ec8] scsi_scan_target+0x74/0x3c8 [scsi_mod]

 [e3331294] scsi_scan_channel+0x78/0x9c [scsi_mod]

 [e333135c] scsi_scan_host_selected+0xa4/0x144 [scsi_mod]

 [e336fb34] storage_probe+0x5e8/0x914 [usb_storage]

Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0

Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0,  type 0

USB Mass Storage device found at 3

```

It still looks like there are funny thing going on but it creates

/dev/sda1 in the end. The scsi subsystem is a bit different on 

the mac may be there are some options that I should enable on

x86? One difference between the 2 systems that may be 

important is that the mac started as a kernel 2.4 system with

devfs before being upgraded to 2.6 with udev while the x86

started directly as a kernel 2.6 system with udev. Could the

ppc benefit from inherited devices?

Cheers,

 Francois

----------

## dsd

yep, that doesnt look too good. but i think you'll find that that bug has been fixed, if you upgrade to 2.6.9

----------

## fb

 *dsd wrote:*   

> yep, that doesnt look too good. but i think you'll find that that bug has been fixed, if you upgrade to 2.6.9

 

Sorry? My usb stick while producing some dirty messages does

work perfectly on linuxppc (Mac) with the kernel 2.6.7...

The main problem I have is on x86 where for some reason

it doesn't work out of the box with both 2.6.7 and 2.6.9.

I have to say that at the moment I will stick with something 

that I know works well on ppc unless you have a very compelling

argument.   :Confused: 

----------

## fb

A bit of an update on my problems. The node /dev/sda1 is

still not created on my x86 system (I have the recent update

of hotplug and udev). I have also tested the stick in question on 

a SuSE 9.1 distro (ftp install) where it works, and on 

Mandrake 10.0 (community ftp) where it doesn't work.

Lastly this morning I plugged my usb memory stick on my x86 

system before the kernel start to load (I plugged it while on

the grub bootscreen). To my surprise, it was fully functionnal

when I logged in! The node /dev/sda1 had been created and I 

could mount it. Unplugging it and replugging resulted in the usual

behavior described in my previous posts with the same messages.

Weird!

----------

## dsd

this is a fairly common issue - the device doesnt advertise that it has any  partitions until it has had time to warm up. you either need to plug it in plenty before the usb-storage module gets loaded, or manually "touch /dev/sda" a couple of seconds after it has been plugged in.

there may be a place in the kernel code where we could add in a short pause for devices like this. but nobody has been able to give me a definate answer as to whether this is specific to each usb disk or varies from system to system.

for example, i am under the impression that even though some usb disks of this type may exhibit the behaviour you describe on some systems, they may work fine straight away on other systems. this means that making some sort of "blacklist" for these devices wouldnt work.

so until somebody comes along who has two disks and 2 systems i can't really do much to the kernel.

----------

## Naib

Well I tried the "touch sda" just after... but no sda1 turned up.

Is there anyway that you can spec a group of infomation like:

uname -a

lsmod (at usb drive mount)

/var/log/messages output at mout

section of .config of running kernel

...

other useful infomation

not too much to minimise infomation overload

that can be grouped by gentoo users using usb memory stick to help?

----------

## fb

Fair enought, I will probably not bother you anymore unless

I make some kind of progress toward a solution or if it start

to suddenly works. I suspect that this particular stick may

have a default that may or may not show up depending of the 

system's particular. I will have access to an identical stick

sometime in December which used to work on that system,

if it works it will be definitely a problem with the stick itself.

Just for completness seeing your comment:

usb-storage is in my /etc/modules.autoload.d/kernel-2.6 so

it is loaded at start up. May be it takes some more time to

activate it.

/dev/sda exist it is created without problem and as I said

I can run fdisk or cfdisk on it without an itch, the problem

is /dev/sda1 which is not immediately created. If you mean 

that it will "update" the device status then it is about as intrusive

as using fdisk, but if I can do that as a user it may be a bit 

better.

----------

## dsd

yes, that is the exact situation i am referring to. you could also use something like udev or hotplug to automate a "sleep 2 ; touch /dev/sda" when the device is plugged in

----------

## fb

Well I was quite surprise but I can touch /dev/sda as a 

normal user and lo! /dev/sda1 appears. I will have to work

on some hotplug script as you suggested now dsd.

I think it is the best course of action for now

Thank you again for your time dsd  :Very Happy:  !

Now to Naib

 *Naib wrote:*   

> Well I tried the "touch sda" just after... but no sda1 turned up.
> 
> Is there anyway that you can spec a group of infomation like:
> 
> uname -a
> ...

 

Well for the sake of completness:

```
uname -a

Linux vrooom 2.6.9-gentoo-r1 #2 Thu Nov 4 21:47:36 NZDT 2004 i686 AMD Athlon(tm) XP 2600+ AuthenticAMD GNU/Linux
```

and before plugging the stick:

```
/sbin/lsmod

Module                  Size  Used by

ppp_deflate             4672  0

zlib_deflate           21080  1 ppp_deflate

bsd_comp                5248  0

ppp_async               8768  1

crc_ccitt               1664  1 ppp_async

ppp_generic            19220  7 ppp_deflate,bsd_comp,ppp_async

slhc                    7232  1 ppp_generic

radeon                125284  4

rtc                     9400  0

usb_storage            43360  0

joydev                  7936  0

snd_ac97_codec         67856  0

snd_cmipci             28452  0

snd_opl3_lib            8576  1 snd_cmipci

snd_hwdep               6916  1 snd_opl3_lib

gameport                3456  1 snd_cmipci

snd_mpu401_uart         5760  1 snd_cmipci

snd_rawmidi            19236  1 snd_mpu401_uart

ati_agp                 6412  0

via_agp                 7424  1

agpgart                27496  3 ati_agp,via_agp

```

And after plugging the stick the list is identical. For my 

dmesg output I refer you to earlier posts in the threads.

Beware there is one post about x86 and one about ppc.

Cheers,

 Francois

----------

## El_Presidente_Pufferfish

If you write that hotplug script, could you share it so I could use it too?

----------

## Smokie

The "touch /dev/sda" trick works fine here with a Sandisk Cruzer, udev and 2.6.9.

I am although interested in a updated hotplug script.

As lot of postings are in this forum related to not existing /dev/sda1, maybe this should be in the gentoo scripts in general.

----------

## sheepdog

What do we do when /dev/sda does not show up at all? *Quote:*   

> brw-rw----  1 root disk 8, 10 Feb 22  2004 /dev/sda10
> 
> brw-rw----  1 root disk 8, 11 Feb 22  2004 /dev/sda11
> 
> brw-rw----  1 root disk 8, 12 Feb 22  2004 /dev/sda12
> ...

  *Quote:*   

> ls -la /dev/sda
> 
> ls: /dev/sda: No such file or directory

 Please see post https://forums.gentoo.org/viewtopic.php?p=1761818#1761818

----------

