# No /dev/sda1 after inserting USB memory stick

## drvdijk

Hi. Just new here  :Smile: 

Anyway, I have a problem with my USB memory stick. After inserting it, dmesg outputs the following:

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

scsi0 : SCSI emulation for USB Mass Storage devices

  Vendor: USB       Model: BAR               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

```

In /dev there is a symlink sda to /dev/scsi/host0/bus0/target0/disc and a directory sd, containing a symlink c0b0t0u0 to /dev/scsi/host0/bus0/target0/disc as well. No sda1 though.

So I tried to cat the sda-symlink, resulting a LOT of garbage, but also an symlink sda1  :Very Happy:  It points to /dev/scsi/host0/bus0/target0/lun0/part1 , and I can mount it using mount /dev/sda1 /mnt/usbstick .

dmesg outputted extra info after this by the way: 

```
USB Mass Storage device found at 3

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

```

How can I get the sda1 symlink directly? Did I miss a kernel-option or something? I did install the hotplug-package and rc-update'd it to let it autostart. Also the following kernel-options are activated:

[*] legacy /proc/scsi/ support

<*> SCSI disk support

<*> SCSI generic support

[*] Probe all LUNs on each SCSI device

As well as the USB-support:

<*> Support for Host-side USB

[*] USB device filesystem

<*> EHCI HCD (USB 2.0) support

<*> OHCI HCD support

<*> USB Printer support

<*> USB Mass Storage support

<*> USB Human Interface Device (full HID) support

[*] HID input layer support

That should be enough right?

Thanx in advance!!

----------

## lunatc

I've found with this problem on some of my systems too: the /dev/sdX1 doesn't appear until you try to use it (mounting the device  for example).

I use devfsd.

I've created a little script: /etc/hotplug/usb/usb-storage and gave it exec permissions with chmod +x

```

#/bin/bash

kill -HUP $(pidof devfsd)

```

The script try to "wake-up" devfsd making somehow to refresh the devices.

It's an "ugly hack" but It works for me

----------

## jschellhaass

Do you have vfat compiled (or module) in the kernel.  It looks like it doesn't understand the file system.

File systems > DOS/FAT/NT Filesystems > MSDOS file system support and VFAT file system support.

jeff

----------

## drvdijk

 *lunatc wrote:*   

> I've found with this problem on some of my systems too: the /dev/sdX1 doesn't appear until you try to use it (mounting the device  for example).
> 
> I use devfsd.
> 
> I've created a little script: /etc/hotplug/usb/usb-storage and gave it exec permissions with chmod +x
> ...

 

Interesting... devfsd... I'll look in to it, if (and if, why) restarting it solves the problem.

 *jschellhaass wrote:*   

> Do you have vfat compiled (or module) in the kernel.  It looks like it doesn't understand the file system.
> 
> File systems > DOS/FAT/NT Filesystems > MSDOS file system support and VFAT file system support.
> 
> jeff

 

Yes I did. Compiled into the kernel. It does mount, after trying to access it.

With an 2.4.x kernel the problem does not occur at all..   :Confused: 

----------

## Conditional_Zenith

I'm having a similar problem, except /dev/sda1 doesn't appear even when I try "mount -t vfat /dev/sda1 /mnt/usb"

I have a 2.6.7 kernel, vfat and usb-storage are compiled in.

dmesg gives:

```

usb 1-5: new high speed USB device using address 2

usb 1-5: control timeout on ep0out

ehci_hcd 0000:00:02.2: Unlink after no-IRQ?  Different ACPI or APIC

settings may help.

usb 1-5: control timeout on ep0out

usb 1-5: device not accepting address 2, error -110

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

usb 1-5: control timeout on ep0out

usb 1-5: control timeout on ep0out

usb 1-5: device not accepting address 3, error -110

usb 1-5: new high speed USB device using address 4

usb 1-5: control timeout on ep0out

```

What do I need to do?

----------

## drvdijk

 *lunatc wrote:*   

> I've found with this problem on some of my systems too: the /dev/sdX1 doesn't appear until you try to use it (mounting the device  for example).
> 
> ...

 

I use devfsd as well..  Restarting it (sending the SIGHUP signal so it rereads the config-file and reload any shared objects etc) does not fix my problem. Running it in debug mode (/sbin/devfsd /dev -d) gives:

```
devfsd: Linux device filesystem daemon v1.3.25

Daemon protocol revision: 5

Kernel-side protocol version: 5

Running in debug mode: no actions will be taken...

```

Plugging in the stick:

```
Entry: "scsi/host6/bus0/target0/lun0"(len=28) registered mode: 40755 uid: 0 gid: 0

Entry: "scsi/host6/bus0/target0/lun0/disc"(len=33) registered mode: 60600 uid: 0 gid: 0

Entry: "discs/dics1"(len=11) registered mode: 120555 uid: 0 gid: 0

Entry: "scsi/host6/bus0/target0/lun0/generic"(len=36) registered mode: 20640 uid: 0 gid: 0

```

(This was after plugging it for the 6th time I guess, and that's where the host6 comes from I guess). Unplugging it gives:

```
Entry: "scsi/host6/bus0/target0/lun0/generic"(len=36) unregisterred mode: 20640 uid: 0 gid: 0

Entry: "discs/disc1"(len=11) unregistered mode: 120555 uid: 0 gid: 0

Entry: "scsi/host6/bus0/target0/lun0/disc"(len=33) unregistered mode: 60600 uid: 0 gid: 0

Entry: "scsi/host6/bus0/target0/lun0"(len=28) unregistered mode: 40755 uid: 0 gid: 0

```

This looks good I guess.. 

Taking a look at /var/log/kernel/current, it gives some strange lines:

```
Dec 16 11:25:51 [kernel] usb 1-1: new high speed USB device using address 11

Dec 16 11:25:51 [kernel] scsi8 : SCSI emulation for USB Mass Storage devices

Dec 16 11:25:51 [kernel]   Vendor: USB       Model: BAR               Rev: 2.00

Dec 16 11:25:51 [kernel] sda: Unit Not Ready, sense:

Dec 16 11:25:51 [kernel] sda : READ CAPACITY failed.

Dec 16 11:25:51 [kernel] sda: Unit Not Ready, sense:

Dec 16 11:25:51 [kernel] sda : READ CAPACITY failed.

Dec 16 11:25:51 [kernel] sda: Unit Not Ready, sense:

Dec 16 11:25:51 [kernel] sda : READ CAPACITY failed.

Dec 16 11:25:51 [kernel] Buffer I/O error on device sda, logical block 0

Dec 16 11:25:51 [kernel] USB Mass Storage device found at 11

```

Then doing the cat /dev/sda, control-c-ing and resetting the console (man, what a garbage  :Wink: ), an extra line appears:

```
Dec 16 11:29:53 [kernel] SCSI device sda: 512000 512-byte hdwe sectors (262 MB)
```

And the sda1 appears.

By the way, I found a new way to 'get' the sda1 now: fdisk /dev/sda  :Smile:  You can quit fdisk right away, the point is that 'something' (fdisk here) accesses /dev/sda.

Hmm... idea: plug in the stick, restart devfsd in debug-mode, and then access /dev/sda. This gives:

```
Entry: "scsi/host6/bus0/target0/lun0/part1"(len=35) registered mode: 60600 uid: 0 gid: 0
```

THIS line causes devfsd to add the /dev/sda1 link. But WHY do I have to access it before getting the link?

I have to get back at the 2.4.x kernel.. It does not work there either. I also have to access /dev/sda before the sda1 link is created..

----------

## drvdijk

I guess this is a problem with my stick. Another one works like a charm.. Well, hope this is useful for someone else with the same problem  :Smile: 

----------

## dsd

the problem is that your device doesnt like being probed for info so soon after it has been connected. a much friendlier than restarting devfsd is to run simply "touch /dev/sda" in a hotplug script or something. that will force it to reread the partition table and create sda1.

2.6.10 should fix this problem - it now waits a few seconds after plugin before probing the device for capacity and partitions. hopefully this is long enough..

----------

## tbart

had the same problems lots of you described

control timeouts, try to use different ACPI/APIC settings etc..

i solved it this way: pass

```

pci=noacpi

```

to the kernel. everything works flawlessly for me now (running 2.6.8-gentoo-r3)

does it have any disadvantages to have acpi not allocate pci ressources?

but i am very interested in 2.6.10; great if it is gonna be solving those issues: good work!

BTW: one problem i have with only one of my two installations:

usbstick-icon on the desktop; click-to-mount, pops up konqueror, works, fine. close komqueror, try to umount: device is busy.

used by whom? konqueror i just closed. ?? if kill that konqueror (it is sleeping) i can umount... weird.. and annoying

tbart

----------

## Config

 *dsd wrote:*   

> the problem is that your device doesnt like being probed for info so soon after it has been connected. a much friendlier than restarting devfsd is to run simply "touch /dev/sda" in a hotplug script or something. that will force it to reread the partition table and create sda1.
> 
> 2.6.10 should fix this problem - it now waits a few seconds after plugin before probing the device for capacity and partitions. hopefully this is long enough..

 

Unfortunatelly, it didn't seem to.

I'm running 2.6.10-r1 now, and /dev/sda wouldn't appear until I touch the device (touch /dev/sda) - I can mount it prior touching though.

But, this could be an udev issue - since I'm no longer with devfs

Suggestions?

----------

