# Usbstick not getting an entry in /dev

## volkmar

Please somebody help me getting mounted my usbstick. I have worked through the docs[1][2][3] and finally I found out that there is not suitable entry in /dev. 

My usb config in the kernel is as show in grep -i usb /usr/src/linux-2.6.18-gentoo-r5/.config.

Kernel scsi configs are shown in grep -i scsi /usr/src/linux-2.6.18-gentoo-r5/.config.

Output of lshw is in lshw.

When I compare the output of ls -al /dev before and after plugging my two usbsticks I am getting a 

```
#diff dev_no_usbstick dev_with_usbstick

3c3

< drwxr-xr-x 15 root root      13220 2006-12-25 16:38 .

---

> drwxr-xr-x 15 root root      13380 2006-12-25 16:39 .

304a305,306

> crw-rw----  1 root root   21,    0 2006-12-25 16:39 sg0

> crw-rw----  1 root root   21,    1 2006-12-25 16:39 sg1

637c639

< drwxr-xr-x  4 root root        120 2006-12-25 16:38 .udev

---

> drwxr-xr-x  4 root root        120 2006-12-25 16:39 .udev

638a641,646

> crw-rw----  1 root root  442,   14 2006-12-25 16:39 usbdev1.15_ep00

> crw-rw----  1 root root  442,   14 2006-12-25 16:39 usbdev1.15_ep02

> crw-rw----  1 root root  442,   14 2006-12-25 16:39 usbdev1.15_ep81

> crw-rw----  1 root root  442,   15 2006-12-25 16:39 usbdev1.16_ep00

> crw-rw----  1 root root  442,   15 2006-12-25 16:39 usbdev1.16_ep02

> crw-rw----  1 root root  442,   15 2006-12-25 16:39 usbdev1.16_ep81
```

Guess these are not the entries I should use for mounting on /mnt/usbstick. I am almost sure there is something missing in my kernel configs, but no idea how to find out.

Oh, and of course  I didn't forget the output from #dmesg | -i usb from the one usbstick and from the other usbstick.

Maybe someone who is reading these lines can give me a hint how to solve this ...

[1] http://gentoo-wiki.com/HOWTO_USB_Mass_Storage_Device

[2] http://www.voehringer.net/wiki/index.php/Howto:_USB-Stick_mounten_mit_Gentoo

[3] http://www.google.de/search?num=100&hl=de&as_qdr=all&q=usbstick+mount+gentoo&btnG=Suche&meta=

----------

## NeddySeagoon

volkmar,

USB sticks appear as SCSI disk drives.

You need USB Storage Support and SCSI disk support available to your kernel. Then you will get a new /dev/sd[a..z] entry and perhaps a partition too. To mount the USB stick, your kernel needs vfat support. Modules or built in both work.

You should see entries appear at the end of dmesg when you connect your USB stick.

USB sticks come in two sorts, those with a partition table, so they look like a hard drive - you mount the partition and those without a partition table, so they look loke a floppy or a CD. You mount the device.

----------

## volkmar

 *NeddySeagoon wrote:*   

> You need USB Storage Support and SCSI disk support available to your kernel. Then you will get a new /dev/sd[a..z] entry and perhaps a partition too. To mount the USB stick, your kernel needs vfat support. Modules or built in both work.

 I am having

```
CONFIG_USB_STORAGE=m

CONFIG_BLK_DEV_SD=m

CONFIG_VFAT_FS=y
```

 *NeddySeagoon wrote:*   

> You should see entries appear at the end of dmesg when you connect your USB stick.

 That's what I would have expected and indeed, I am getting these lines at the end of dmesg: 

```
dmesg

usb-storage: *** thread awakened.

usb-storage: -- exiting

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

usb 1-1: configuration #1 chosen from 1 choice

usb-storage: USB Mass Storage device detected

usb-storage: -- associate_dev

usb-storage: Vendor: 0xffff, Product: 0x1300, Revision: 0x0002

usb-storage: Interface Subclass: 0x06, Protocol: 0x50

usb-storage: Transport: Bulk

usb-storage: Protocol: Transparent SCSI

scsi22 : SCSI emulation for USB Mass Storage devices

usb-storage: *** thread sleeping.

usb-storage: device found at 26

usb-storage: waiting for device to settle before scanning

usb-storage: usb_stor_control_msg: rq=fe rqtype=a1 value=0000 index=00 len=1

usb-storage: GetMaxLUN command result is 1, data is 0

usb-storage: queuecommand called

usb-storage: *** thread awakened.

usb-storage: Command INQUIRY (6 bytes)

usb-storage:  12 00 00 00 24 00

usb-storage: Bulk Command S 0x43425355 T 0x1 L 36 F 128 Trg 0 LUN 0 CL 6

usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes

usb-storage: Status code 0; transferred 31/31

usb-storage: -- transfer complete

usb-storage: Bulk command transfer result=0

usb-storage: usb_stor_bulk_transfer_sglist: xfer 36 bytes, 1 entries

usb-storage: Status code 0; transferred 36/36

usb-storage: -- transfer complete

usb-storage: Bulk data transfer result 0x0

usb-storage: Attempting to get CSW...

usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes

usb-storage: Status code 0; transferred 13/13

usb-storage: -- transfer complete

usb-storage: Bulk status result = 0

usb-storage: Bulk Status S 0x53425355 T 0x1 R 0 Stat 0x0

usb-storage: scsi cmd done, result=0x0

usb-storage: *** thread sleeping.

  Vendor:           Model: USB DISK Pro      Rev: 3.09

  Type:   Direct-Access                      ANSI SCSI revision: 00

scsi 22:0:0:0: Attached scsi generic sg0 type 0

usb-storage: queuecommand called

usb-storage: *** thread awakened.

usb-storage: Bad LUN (0:1)

usb-storage: scsi cmd done, result=0x40000

usb-storage: *** thread sleeping.

usb-storage: queuecommand called

usb-storage: *** thread awakened.

usb-storage: Bad target number (1:0)

usb-storage: scsi cmd done, result=0x40000

usb-storage: *** thread sleeping.

usb-storage: queuecommand called

usb-storage: *** thread awakened.

usb-storage: Bad target number (2:0)

usb-storage: scsi cmd done, result=0x40000

usb-storage: *** thread sleeping.

usb-storage: queuecommand called

usb-storage: *** thread awakened.

usb-storage: Bad target number (3:0)

usb-storage: scsi cmd done, result=0x40000

usb-storage: *** thread sleeping.

usb-storage: queuecommand called

usb-storage: *** thread awakened.

usb-storage: Bad target number (4:0)

usb-storage: scsi cmd done, result=0x40000

usb-storage: *** thread sleeping.

usb-storage: queuecommand called

usb-storage: *** thread awakened.

usb-storage: Bad target number (5:0)

usb-storage: scsi cmd done, result=0x40000

usb-storage: *** thread sleeping.

usb-storage: queuecommand called

usb-storage: *** thread awakened.

usb-storage: Bad target number (6:0)

usb-storage: scsi cmd done, result=0x40000

usb-storage: *** thread sleeping.

usb-storage: queuecommand called

usb-storage: *** thread awakened.

usb-storage: Bad target number (7:0)

usb-storage: scsi cmd done, result=0x40000

usb-storage: *** thread sleeping.

usb-storage: device scan complete
```

But where is my new new /dev/sd[a..z] entry?

----------

## NeddySeagoon

volkmar,

It looks like you have a debugging option on in your kernel somewhere - its spamming dmesg and possibly interfering with normal operation. Find it and turn it off.

You should only have 

```
[ 9295.654041] usb 3-2.1: new high speed USB device using ehci_hcd and address 6

[ 9295.750083] usb 3-2.1: configuration #1 chosen from 1 choice

[ 9295.750319] scsi3 : SCSI emulation for USB Mass Storage devices

[ 9295.750427] usb-storage: device found at 6

[ 9295.750429] usb-storage: waiting for device to settle before scanning

[ 9300.727113] scsi 3:0:0:0: Direct-Access              USB DISK Pro     PMAP PQ: 0 ANSI: 0 CCS

[ 9302.563674] SCSI device sdc: 2012160 512-byte hdwr sectors (1030 MB)

[ 9302.564295] sdc: Write Protect is off

[ 9302.564298] sdc: Mode Sense: 23 00 00 00

[ 9302.564300] sdc: assuming drive cache: write through

[ 9302.566417] SCSI device sdc: 2012160 512-byte hdwr sectors (1030 MB)

[ 9302.567040] sdc: Write Protect is off

[ 9302.567043] sdc: Mode Sense: 23 00 00 00

[ 9302.567044] sdc: assuming drive cache: write through

[ 9302.567047]  sdc: sdc1

[ 9302.567837] sd 3:0:0:0: Attached scsi removable disk sdc

[ 9302.568374] usb-storage: device scan complete
```

in dmesg

----------

## volkmar

Removed all kernel debugging options and on plugging usbstick dmesg returns:

```
# dmesg

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

usb 1-2: configuration #1 chosen from 1 choice

scsi0 : SCSI emulation for USB Mass Storage devices

usb-storage: device found at 2

usb-storage: waiting for device to settle before scanning
```

It does not return any device node. Codepage cp437 is available 

```
CONFIG_FAT_DEFAULT_CODEPAGE=437

CONFIG_NLS_CODEPAGE_437=y

```

So, what else does creation of the device node depend on? Is there any way to debug why the device isn't created?

----------

## NeddySeagoon

volkmar,

Does lsmod show sd_mod loaded?

Thats the SCSI disk driver. If thats not loaded, the device will not be seen by the system

----------

## volkmar

Thanks for the hint  :Smile: 

I was having 

```
CONFIG_BLK_DEV_SD=m
```

 and the driver indeed didn't get loaded.

But it had worked longtime before, until any change recently. So, what's the best way now for getting the driver loaded on demand. I think hotplug did this in the past. Or is it better to build it into the kernel?

Thanks again for your attention!

----------

## NeddySeagoon

volkmar,

Add the module name to the file

```
/etc/modules.autoload.d/kernel-2.6
```

it will be loaded at boot time then

----------

## volkmar

That's what I did. Many thanks again for your help!

----------

