# Problems mounting USB stick.

## horstenpeter

I'm trying to mount my USB stick in my new Gentoo installation. I followed the  HOWTO USB Mass Storage Device and Gentoo  instructions. But when trying to mount it I get 

```

mount: special device /dev/sda1 does not exist

```

The only differences I have to the actions described in the HOWTO is a 2.6.81 kernel and I compiled everything mentioned into the kernel instead of as a module. Any ideas ?

----------

## Helena

 *horstenpeter wrote:*   

> I followed the  HOWTO USB Mass Storage Device and Gentoo  instructions. 

 Where can we find that HOWTO?

----------

## horstenpeter

https://forums.gentoo.org/viewtopic.php?t=53537&highlight=mass+storage+usb

----------

## Helena

 *horstenpeter wrote:*   

> https://forums.gentoo.org/viewtopic.php?t=53537&highlight=mass+storage+usb

 If I quickly browse through this topic I find only references to 2.4 kernels, which are different from 2.6 kernels such as you use.

----------

## horstenpeter

I guess so. The modules mentioned where all there though. But yeah I guess maybe that's causing it. Any instructions for 2.6 somewhere ?

----------

## Helena

what does the following command say?

```
ls /dev/sd*
```

In my case (no mass storage mounted yet, 2.6.8 kernel) it is:

```
AmpersandGentoo ~ # ls /dev/sd*

/dev/sda    /dev/sda2  /dev/sdb    /dev/sdb2  /dev/sdc    /dev/sdc2  /dev/sdd    /dev/sdd2

/dev/sda1   /dev/sda3  /dev/sdb1   /dev/sdb3  /dev/sdc1   /dev/sdc3  /dev/sdd1   /dev/sdd3

/dev/sda10  /dev/sda4  /dev/sdb10  /dev/sdb4  /dev/sdc10  /dev/sdc4  /dev/sdd10  /dev/sdd4

/dev/sda11  /dev/sda5  /dev/sdb11  /dev/sdb5  /dev/sdc11  /dev/sdc5  /dev/sdd11  /dev/sdd5

/dev/sda12  /dev/sda6  /dev/sdb12  /dev/sdb6  /dev/sdc12  /dev/sdc6  /dev/sdd12  /dev/sdd6

/dev/sda13  /dev/sda7  /dev/sdb13  /dev/sdb7  /dev/sdc13  /dev/sdc7  /dev/sdd13  /dev/sdd7

/dev/sda14  /dev/sda8  /dev/sdb14  /dev/sdb8  /dev/sdc14  /dev/sdc8  /dev/sdd14  /dev/sdd8

/dev/sda15  /dev/sda9  /dev/sdb15  /dev/sdb9  /dev/sdc15  /dev/sdc9  /dev/sdd15  /dev/sdd9

```

----------

## Helena

To mount a formatted USB memory stick I have to know or discover the name of the special device it's using and its partition layout. When I attach the USB stick to a port (and the connection is OK, which in my case is indicated by a green light) I will find the following lines at the end of my dmesg:

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

Initializing USB Mass Storage driver...

scsi2 : SCSI emulation for USB Mass Storage devices

  Vendor: Generic   Model: STORAGE DEVICE    Rev: 0026

  Type:   Direct-Access                      ANSI SCSI revision: 02

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

sdc: assuming Write Enabled

sdc: assuming drive cache: write through

 sdc: sdc1

Attached scsi removable disk sdc at scsi2, channel 0, id 0, lun 0

USB Mass Storage device found at 5

usbcore: registered new driver usb-storage

USB Mass Storage support registered.

AmpersandGentoo ~ #     
```

From this I derive that i's /dev/sdc.

----------

## horstenpeter

ls: /dev/sd*: No such file or directory

dmesg doesn't say anything recognisable about USB.

----------

## Helena

Ok well on another system, probably more like yours, I also have no /dev/sd* nodes initially. It' probably caused by using udev or devfs. Don't worry for the moment. On that system however the dmesg messages also appear if I plug in the stick. So either:

- your USBstick is not recognized by Linux

- or, you haven't compiled or loaded the kernel correctly

Do you compile the kernel yourself or are you using genkernel?

----------

## horstenpeter

I do it myself (devfs included). I remember using that USB stick in my old Linux installation, so in theory it should work. (That was Gentoo 1.4. Not sure if I used it after upgrading to 2.6 though.)

----------

## Helena

In the kernel config I have the following (devfs system):

Device drivers/SCSI device support - SCSI disk support (BLK_DEV_SD) enabled, everything else off, including all low-level drivers (I don't need them there)

USB Support - USB device filesystem (USB_DEVICEFS), EHCI HCD (USB 2.0) support (USB_EHCI_HCD), OHCI HCD support (USB_OHCI_HCD), USB Mass Storage support (USB_STORAGE) all set

Under USB I have only listed the relevant options. Your system may use UHCI in stead of OHCI, then of course you'll have to enable that.

HTH.

----------

## TNorthover

I think the thing to do is to find out exactly how much usb is working. Firstly, do you have any other usb devices that are definitely going (mouse or something).

If not, then make sure usb-uhci or usb-ohci is inserted or compiled into the kernel (which depends on your chipset) and try "cat /proc/bus/usb/devices". If things are working, you'll get at least one item, probably lots, mentioning USB controller or something.

If you get this then basic usb support is working. In that case, try plugging in the usb stick and then "modprobe usb_storage scsi_mod sd_mod", and check dmesg for mention of usb. For reference mine looks like this:

```
Initializing USB Mass Storage driver...

usb-storage 3-1.2:1.0: usb_probe_interface

usb-storage 3-1.2:1.0: usb_probe_interface - got id

scsi0 : SCSI emulation for USB Mass Storage devices

  Vendor:           Model: USB MEMORY BAR    Rev: 1000

  Type:   Direct-Access                      ANSI SCSI revision: 02

USB Mass Storage device found at 6

usbcore: registered new driver usb-storage

USB Mass Storage support registered.

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

sda: assuming Write Enabled

sda: assuming drive cache: write through

 sda: sda1

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

hub 3-1:1.0: port 2, status 0100, change 0001, 12 Mb/s

usb 3-1.2: USB disconnect, address 6

usb 3-1.2: usb_disable_device nuking all URBs

usb 3-1.2: unregistering interface 3-1.2:1.0

usb 3-1.2:1.0: hotplug

usb 3-1.2: unregistering device

usb 3-1.2: hotplug

hub 3-1:1.0: debounce: port 2: total 100ms stable 100ms status 0x100

```

What you're looking for is the "USB Mass Storage device found at 6" line (not necessarily 6 of course), and the lines mentioning sda.

If you get similar lines, then the only problem is that the device node isn't being created. I think I had a similar problem, and solved it by switching to udev and making sure sd_mod was compiled (I did both before it would work, certainly the sd_mod step was necessary, but it's possible that the udev step was needed too, I'll check whether it works with devfs and get back to you).

If that is the case, you can try a quick fix to check that it's working by creating the nodes yourself (they'll probably disappear on reboot):

```
mknod /dev/sda b 8 0

mknod /dev/sda1 b 8 1
```

Then try mounting and see what happens.

----------

## horstenpeter

OK I tried the car /proc/bus/usb/devices and nothing was found. In my kernel I have support for UHCI. The chipset on my system is AMD 750. I wasn't really sure which one I need. I checked out a technical sheet and it seems I need OHCI so I'll recompile and see what happens. Thanks so far !

----------

## Helena

 *horstenpeter wrote:*   

> OK I tried the car /proc/bus/usb/devices and nothing was found. In my kernel I have support for UHCI. The chipset on my system is AMD 750. I wasn't really sure which one I need. I checked out a technical sheet and it seems I need OHCI so I'll recompile and see what happens. Thanks so far !

 In the kernel config it does hint in that direction, but looking it up is better. Also, 

```
lspci -v
```

will list the interface type of your USB controller(s), along with a lot of other information.

----------

## horstenpeter

lspci for some reason doesn't work.... The stick was found with the new kernel, here's the dmesg output:

```
scsi0 : SCSI emulation for USB Mass Storage devices

  Vendor: VMAX      Model: 512MB             Rev: 2.00

  Type:   Direct-Access                      ANSI SCSI revision: 02

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

sda: assuming Write Enabled

sda: assuming drive cache: write through

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

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 4
```

I can mount it now as sda, but there's still something wrong, I can't see the files on the stick, instead I see a folder named 001 which contains 4 files named 001 to 004....

anything special I need to specify in the fstab maybe ?

----------

## TNorthover

Well, that output looks perfect, so progress is being made.

Firstly make sure you're mounting /dev/sda1 rather than just /dev/sda (shouldn't be an issue as mounting /dev/sda shouldn't work at all). 

Also, make sure you've got MSDOS FAT and VFAT filesystem support in the kernel, and you're mounting the drive with it (set the type to vfat in fstab or use "mount -t vfat /dev/sda1 /mnt/wherever"). 

After that, I'd probably suspect some kind of language issue since you're not likely to be using the english codepage. Do you know which iso8859-n thing you're using? If so change the setting under vfat in kernel config to that. Also, look in dmesg for some mention of codepage or cp-??? (I suspect the ??? is likely to be 850) and if you see it, change that setting under vfat as well. You may have to add the ISO8859 setting there as well.

You may also have to compile that codepage into the kernel. It's under Filesystems, then Native language Support, and add the CP required (again I suspect 850 since that's the European one).

----------

## horstenpeter

Alright I can mount it now and access it through /mnt/usb ! Thanks a lot for your help everyone !

----------

## TNorthover

Just out of interest, and in case anyone else stumbles across this thread, is there any chance you could you say what that last problem was?

----------

## horstenpeter

I changed the filesystem to vfat (from auto) and added the 1 to the sda. Though I think I had tried that before, this time it worked.

(So no problems with the codepage)

----------

