# No /dev for USB

## oneandoneis2

I had some problems getting USB working, but now it seems to be fine. 

Except when I plug in my memory stick, altho it shows up fine in lsusb & the kernel logs etc, it doesn't get assigned a /dev entry. So I can't mount it.

I tried manually created /dev/sda entries, but they've made no difference. It recognises that there's a flash disk plugged into usb, but that's all.

How do I get it accepted as a device? 

```
Dec 12 11:04:45 gentoo ehci_hcd 0000:00:02.2: GetStatus port 4 status 001803 POWER sig=j  CSC CONNECT

Dec 12 11:04:45 gentoo hub 1-0:1.0: port 4, status 0501, change 0001, 480 Mb/s

Dec 12 11:04:45 gentoo hub 1-0:1.0: debounce: port 4: total 100ms stable 100ms status 0x501

Dec 12 11:04:45 gentoo hub 1-0:1.0: port 4 not reset yet, waiting 50ms

Dec 12 11:04:45 gentoo ehci_hcd 0000:00:02.2: port 4 full speed --> companion

Dec 12 11:04:45 gentoo ehci_hcd 0000:00:02.2: GetStatus port 4 status 003001 POWER OWNER sig=se0  CONNECT

Dec 12 11:04:45 gentoo ohci_hcd 0000:00:02.1: GetStatus roothub.portstatus [1] = 0x00010101 CSC PPS CCS

Dec 12 11:04:45 gentoo hub 3-0:1.0: port 2, status 0101, change 0001, 12 Mb/s

Dec 12 11:04:45 gentoo hub 3-0:1.0: debounce: port 2: total 100ms stable 100ms status 0x101

Dec 12 11:04:45 gentoo ohci_hcd 0000:00:02.1: GetStatus roothub.portstatus [1] = 0x00100103 PRSC PPS PES CCS

Dec 12 11:04:45 gentoo usb 3-2: new full speed USB device using address 7

Dec 12 11:04:45 gentoo usb 3-2: new device strings: Mfr=1, Product=2, SerialNumber=3

Dec 12 11:04:45 gentoo usb 3-2: default language 0x0409

Dec 12 11:04:45 gentoo usb 3-2: Product: Flash Disk      

Dec 12 11:04:45 gentoo usb 3-2: Manufacturer: USB     

Dec 12 11:04:45 gentoo usb 3-2: SerialNumber: 284B394150E0B3F7

Dec 12 11:04:45 gentoo usb 3-2: hotplug

Dec 12 11:04:45 gentoo usb 3-2: adding 3-2:1.0 (config #1, interface 0)

Dec 12 11:04:45 gentoo usb 3-2:1.0: hotplug
```

----------

## Cintra

Doesn't it show up as /dev/sda1?

mvh

----------

## blaster999

Hello oneandoneis2,

Is there a device like /dev/ub/* or /dev/ub*? The newer kernels have a new driver for usb mass storage devices. Unfortunately, it doesn't always work, so you can disable it (Device Drivers -> Block Devices -> Low Performance USB Block driver) and use the old /dev/sd* device naming.

Regards,

Gleb

----------

## oneandoneis2

 *Quote:*   

> Doesn't it show up as /dev/sda1? 

 

Nope. Even after using mknod to manually create /dev/sda entries

 *Quote:*   

> Is there a device like /dev/ub/* or /dev/ub*?

 

Nope.

 *Quote:*   

> The newer kernels have a new driver for usb mass storage devices. 

 

I've tried with & without that enabled. It doesn't work either way.

I'm thinking it may be something wrong in my SCSI settings, since no mention is made of SCSI in the Gentoo messages, but when I plug it in to my Slack distro, I get 

```
Dec 12 11:39:04 Eeyore kernel: hub.c: new USB device 00:02.1-2, assigned 

address 4

Dec 12 11:39:07 Eeyore kernel: Initializing USB Mass Storage driver...

Dec 12 11:39:07 Eeyore kernel: usb.c: registered new driver usb-storage

Dec 12 11:39:07 Eeyore kernel: scsi1 : SCSI emulation for USB Mass Storage devices   <------

Dec 12 11:39:08 Eeyore kernel: sda: Unit Not Ready, sense:

Dec 12 11:39:08 Eeyore kernel:  sda: sda1

Dec 12 11:39:08 Eeyore kernel: USB Mass Storage support registered.
```

----------

## blaster999

Do you have Mass Storage support in your kernel?

----------

## oneandoneis2

 *Quote:*   

> Do you have Mass Storage support in your kernel?

 

Yep - USB Mass Storage support is enabled, along with all the non-experimental Flash Reader support options under that option.

```
<*>   USB Mass Storage support

[*]     USB Mass Storage verbose debug

[ ]     USB Mass Storage Write-Protected Media Detection (EXPERIMENTAL)

[*]     Datafab Compact Flash Reader support (EXPERIMENTAL)

[*]     Freecom USB/ATAPI Bridge support

[*]     ISD-200 USB/ATA Bridge support

[*]     Microtech/ZiO! CompactFlash/SmartMedia support

[ ]     HP CD-Writer 82xx support (EXPERIMENTAL)  

[ ]     SanDisk SDDR-09 (and other SmartMedia) support (EXPERIMENTAL) 

[ ]     SanDisk SDDR-55 SmartMedia support (EXPERIMENTAL)  

[ ]     Lexar Jumpshot Compact Flash Reader (EXPERIMENTAL)    
```

----------

## oneandoneis2

P.S. and i just tried it with all the experimental ones switched on too. Nada.

----------

## blaster999

Maybe a stupid question: do you have hotplug and coldplug running?

----------

## oneandoneis2

Hotplug, yes, definitely. It's enabled in the kernel, and hotplug messages are appearing when I plug in the device.

But I'm not familiar with coldplug - where do I look to check?

----------

## blaster999

Until recently, the hotplug script did two things: loaded necessary modules for already present devices, and managed hotpluggable devices. Now it has been split into two: hotplug - to manage hotpluggable devices, and coldplug - to load modules. Both can be obtained through portage:

emerge coldplug hotplug

rc-update add coldplug default

rc-update add hotplug default

/etc/init.d/coldplug start

/etc/init.d/hotplug start

----------

## oneandoneis2

Ah. I didn't know that.

Emerged coldplug and it's certainly made some progress. It assigned a /dev/ub address to it.

But it still refused to let me mount it.

Removed the "Low performance USB block driver" from the kernel and tried it that way. I get a huge load of messages now when I plug in the flash, but the relevant ones seem to be:

```
Dec 12 13:06:25 gentoo SCSI device sda: 512000 512-byte hdwr sectors (262 MB)

Dec 12 13:06:25 gentoo sda: assuming Write Enabled

Dec 12 13:06:25 gentoo sda: assuming drive cache: write through

Dec 12 13:06:25 gentoo Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0

Dec 12 13:06:25 gentoo Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0,  type 0

Dec 12 13:07:41 gentoo end_request: I/O error, dev sda, sector 32

Dec 12 13:07:41 gentoo FAT: unable to read boot sector
```

I still can't mount it!

```
gentoo root # mount -t vfat /dev/sda /mnt/usb/

mount: /dev/sda: can't read superblock

gentoo root # mount -t vfat /dev/sda1 /mnt/usb/

mount: /dev/sda1: can't read superblock

gentoo root # mount -t vfat /dev/sg0 /mnt/usb/

mount: /dev/sg0 is not a block device
```

*sob*

It mounts fine from my other distro. I've got all the DOS FAT stuff enabled in the kernel. 

Screw it, I thought, it's a FAT error. A cfdisk and mke2fs later, and at last, IT MOUNTED!

YAY!

Thank you very much! Couldn't have done it without you!  :Very Happy: 

----------

## smoyer1

In your logs above, sda is the detected device, but you don't want to mount the raw device.  Find the partition with the filesystem on it and mount that like:

```
mount /dev/sda1 /mnt/flash
```

----------

## flickerfly

 *oneandoneis2 wrote:*   

> Removed the "Low performance USB block driver" from the kernel and tried it that way.

 

This seems to have been the key. I assume you are working with a 2.6 kernel. Where might I find that in the config or what is the module name that I might remove it?

I'm having similar issues.

Thanks!

----------

## Headrush

 *flickerfly wrote:*   

>  *oneandoneis2 wrote:*   Removed the "Low performance USB block driver" from the kernel and tried it that way. 
> 
> This seems to have been the key. I assume you are working with a 2.6 kernel. Where might I find that in the config or what is the module name that I might remove it?
> 
> I'm having similar issues.
> ...

 

I had trouble with the "Low performance USB block driver" until I updated to the beta series of KDE (3.4).

Now with that driver and HAL support in KDE, as soon as I plug in my USB key appears on desktop and can be used without ever touching /etc/fstab. (Tried with 2 different USB keys and both work flawlessly.) No messing with udev rules or anything either.

----------

## flickerfly

I don't use KDE, how can I get more information about having this work similarly with fluxbox (the connection thing, not appearing on the desktop)?

----------

## chronophobic

I know that it's not very constructive, but when I saw this post I got my roomie's usb stick and tried it and it worked perfectly from the first try. My kernel is compiled with the reccomended options in this document:

http://gentoo-wiki.com/HOWTO_USB_Mass_Storage_Device

Perhaps take a look @ the article and see if you find anything relevant. 

Also, addressing a post above, I am mounting /dev/sdb (unlike when I mount my external hdd when I must mount /dev/sda1). In a word, if dmesg is not saying sda1 then it's not sda1 but rather just sda. Oh, and although I'm running kde I edited fstab before I ran mount.

Edit:

After taking a second look at the dmesg output you posted... Obviously it has some issue reading the boot sector. I might be a noob, but am I the only one finding that message strange? I assume that the 256meg usb stick isn't bootable, so I guess you should make sure it knows that (but I've got no constructive ideas of how to do it or what might be causing it)...

Edit2: Oh... you wrote you resolved it... Nvm  :Smile: 

----------

## flickerfly

We'll if the ub mod is loaded, it turns out that you have to mount /dev/uba1 instead of /dev/sda1. This explains my problems. I hadn't realized some changes in the kernel. Other than that it is working just fine. I still don't have it working automatically like headrush though.

Looking around further has lead me to believe that the ub module actually causes slower performance. I'll worry about that later. I normally work with small things anyway.

Anyone know what the purpose of a "Low Performance USB Block Driver" is intended for? Are we still trying to wipe out SCSI emulation or something?

----------

## Minot

I'm having similar trouble mounting my USB pen drive.  I can see the device using fdisk.  Do you have to partition the USB device before I can mount it?  It refuses to acknowldege 

```
mount -t vfat /dev/sda1 /mnt/usb
```

It is identified just fine in dmesg and I have all of the same items compiled in the Kernel as the above recommended Wiki article.  The usb drive works great in WIndows, but it refuses to mount on my Linux system.  Any ideas?

-MINOT-

----------

## flickerfly

Sounds like a missing module. You have to have the keys file system, your usb stuff, and either usb-storage (or ub, which you aren't since your device is sda1). There is also need of some scsi elements. I suspect that if you are that far that it has to do with your file system. Do you have vfat support in the kernel (modularized?)? Do you need to modprobe it?

Error messages may be helpful. Also the dmesg output appended upon plugging the device in could be handy.

You should not have to specify the file system at mount. I haven't seen a working case where that was needed yet.

----------

## Minot

I have all of the SCSI components listedin the USB-HowTo on Gentoo Wiki compiled in the kernel.  I have most of the other parts modularized.  I am autoloading through /etc/modules.autoload.d/kernel-2.6 usb-storage, vfat and all of the other USB modules.

Here is the relevant dmseg output:

```
usb 1-5: USB disconnect, address 3

usb 1-3: new high speed USB device using ehci_hcd and address 4

scsi1 : SCSI emulation for USB Mass Storage devices

usb-storage: device found at 4

usb-storage: waiting for device to settle before scanning

  Vendor: SanDisk   Model: Cruzer Micro      Rev: 0.2

  Type:   Direct-Access                      ANSI SCSI revision: 02

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

sda: assuming Write Enabled

sda: assuming drive cache: write through

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

sda: assuming Write Enabled

sda: assuming drive cache: write through

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

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

usb-storage: device scan complete
```

I've tried mounting at /dev/sda and dev/sda1.  I can fdisk the device and see the contents, but it doesn't appear to be what the system would expect.  Here is the output:

```
Disk /dev/sda: 262 MB, 262144000 bytes

32 heads, 33 sectors/track, 484 cylinders

Units = cylinders of 1056 * 512 = 540672 bytes

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1         485      255984    6  FAT16

Partition 1 has different physical/logical beginnings (non-Linux?):

     phys=(0, 1, 1) logical=(0, 0, 33)

Partition 1 has different physical/logical endings:

     phys=(254, 31, 33) logical=(484, 27, 5)
```

  When I try to mount, I get the following output:

```
bash-2.05b# mount /dev/sda /mnt/usb

mount: you must specify the filesystem type
```

So i tried to identify the filesystem type as vfat:

```
bash-2.05b# mount -t vfat /dev/sda /mnt/usb

mount: wrong fs type, bad option, bad superblock on /dev/sda,

       or too many mounted file systems
```

Also, so you know I've insterted and removed my USB a couple of times with reboots in there as well.  I've tried /dev/sda, /dev/sda1, /dev/sdb, and /dev/sdb1 without any luck.  It may not appear that I've tried them so I wanted to mention this.

You mentioned the "keys filesystem".  What is that?  It is the one thing I'm not familar with in your post, Flickerfly.  And thanks to anyone who can and is willing to guide me in the right direction.

-MINOT-

----------

## flickerfly

 *Minot wrote:*   

> You mentioned the "keys filesystem".  What is that?  It is the one thing I'm not familar with in your post, Flickerfly.  And thanks to anyone who can and is willing to guide me in the right direction.

 

The key, stick, card (I wish we had a standard name)... Anyway, the only thing I can think of that is not mentioned here, is confirmation of the loading. I assume you know 'lsmod' and have used it to check the loading of the modules.

You could look over your /dev/ file system. There should be a /dev/sda1 that is, of course, the first partition on the /dev/sda device and what you want to mount.

You might pull the data off an XP and reformat it. I have heard a few have found that to be useful. The following statements from you fdisk output might mean that, but I don't really know.

 *Quote:*   

> Partition 1 has different physical/logical beginnings (non-Linux?):
> 
>      phys=(0, 1, 1) logical=(0, 0, 33)
> 
> Partition 1 has different physical/logical endings:
> ...

 

----------

