# mounting usb stick problem, no sdb1

## luca

Hi all

For a while I'm trying to mount my usb stick, which only works fine when it is already plugged in at boot time. If this is not the case, no sdb1 (sda1 is already in use for something else) is created after plugging it into one of the other usb-slots...

Does anyone know what I've missed during configuring my kernel (2.6.3)

I've also niticed that I cant select 'SCSI device support', there are ---- at the beginnig of that??!!

thanks in advance

Luca

----------

## nevynxxx

If it works when it's plugged in at boot, it's not a kernel problem, unless modules arn't loading, but get to that later.

Are you using udev or devfs? have you installed hotplug? is it working?

try doing 'tail -f -n25 /var/log/messages' as root and then plugging in the stick. or just looking at tty12 and plugging in the stick, i.e. what is syslog saying?

whats on /dev/sda? that the stick is being sdb?

If your using udev, ls /dev before and ~30secs after plugging in the stuck.

That should give us somewhere to start, a link to your /usr/src/linux/.config can't hurt either, along with kernel version.

----------

## luca

this is the message I get when I connect the usb-stick:

Apr 20 17:03:48 bhw024 usb 1-4: new high speed USB device using address 4

Apr 20 17:03:48 bhw024 scsi2 : SCSI emulation for USB Mass Storage devices

Apr 20 17:03:48 bhw024 Vendor: M-Sys     Model: DiskOnKey         Rev: 4.70

Apr 20 17:03:48 bhw024 Type:   Direct-Access                      ANSI SCSI revision: 02

Apr 20 17:03:48 bhw024 Attached scsi removable disk sdb at scsi2, channel 0, id 0, lun 0

Apr 20 17:03:48 bhw024 Attached scsi generic sg1 at scsi2, channel 0, id 0, lun 0,  type 0

Apr 20 17:03:48 bhw024 USB Mass Storage device found at 4

Apr 20 17:03:49 bhw024 scsi.agent[4158]: disk at /devices/pci0000:00/0000:00:1d.7/usb1/1-4/1-4:1.0/host2/2:0:0:0

after this the sdb (not sdb1) is created...

there is also nothing created in /dev/scsi/host1/bus0/target0/

My .config file is at http://www.phys.uu.nl/~calje/gentoo/.config

and my kernel version is 2.6.5 (just upgraded)

I use devfs

here are all modules that I've loaded:

bhw024 init.d # lsmod

Module                  Size  Used by

ohci_hcd               19204  0

uhci_hcd               32144  0

intel_agp              18204  1

agpgart                33576  1 intel_agp

nfsd                   97480  8

exportfs                6528  1 nfsd

rd                      6592  0

nfs                    98608  0

lockd                  61896  3 nfsd,nfs

sunrpc                136520  3 nfsd,nfs,lockd

ide_scsi               17028  0

usb_storage            46528  1

ehci_hcd               28548  0

nvidia               1701676  16

tg3                    75012  0

sg                     34080  0

sd_mod                 18432  2

scsi_mod               79936  4 ide_scsi,usb_storage,sg,sd_mod

No idea how to look at tty12 or what syslog is saying

Hope this will help to solve the problem

Thanks

Luca

----------

## nevynxxx

 *luca wrote:*   

> 
> 
> No idea how to look at tty12 or what syslog is saying
> 
> Hope this will help to solve the problem
> ...

 

you showed what syslog is saying at the top of the post  :Smile:  tty12 is where you get when you hold ctrl and press F12, syslog-ng defaults to copying syslog output there.

now, does you usb thing have a "security" switch, your getting what mine does when the switch is in the wrong position i think. It's seeing the device, and seeing that it should be on the scsi bus, but not seeing the partition, that is quite strange.

you could try mounting /dev/sg1, it seems to be putting something there, though god only knows why? Other than that I'm stumped.

----------

## luca

there is no security switch on my usb-stick

And mounting sg1 didn't work, get a message that it is not a block device

But what about hotplugging, there is something in my kernel and in my /etc/init.d, are these doing the same thing and should I choose only one of them??

And what about the ohci_hcd, uhci_hcd and ehci_hcd is there no conflict between them???

Luca

----------

## nevynxxx

You need the stuff in the kernel, thats the drivers, you also need the stuff in /etc/init.d, thats the software that does stuff with the drivers. Is /etc/init.d/hotplug started?

try /etc/init.d/hotplug start

and then try again. If that works, do rc-update add hotplug default (you should probably do this anyway) to start hotplug on boot.

----------

## luca

Here is something else, when I start /etc/init.d/usbd 

bhw024 init.d # ./usbd start

 * Starting usb daemon...

usbd v0.1 (c) 1999 by Thomas Sailer                                       [ ok ]

Device   1 Vendor 0000 Product ID 0000 Class bfffb750 Speed 0 kbps

Device   2 Vendor 0d49 Product ID 7000 Class bfffb750 Speed 0 kbps

FATAL: Module usb_scsi not found.

FATAL: Module usb_scsi not found.

FATAL: Module usb_scsi not found.

Device   1 Vendor 0000 Product ID 0000 Class bfffb750 Speed 0 kbps

Device   2 Vendor 0d49 Product ID 7000 Class bfffb750 Speed 0 kbps

When plug my usb-stich in, this deamon show an other 

FATAL: Module usb_scsi not found

how do I get this module

adding hotplug was not a succes, somehow nothing showed up during boot an no X too

Luca

----------

## nevynxxx

Hmm...I seem to be at my limit now, all I can suggest is doing make menuconfig again, and looking for more usb/scsi modules.

----------

## peje

Have you ever tried to mount it manually as root 

#mount -t vfat /dev/sdb1 /mnt/blabla

it gives me an error like couldn't mount /dev/sd1 does not exist

but after this manual mount the device /dev/hdb1 or /dev/hda1 is created and you can mount it in your normal way

not the solution but an workaround

cu

----------

## luca

he thats funny

Here is what I did (think it's a little bit different than above suggested)

mount -t vfat /dev/sdb /mnt/usbstick

after this (which returns an error) sdb1 is created   :Very Happy: 

so now I can mount it,  mount -t vfat /dev/sdb1 /mnt/usbstick

This is nice, but not the end (for me)!!!!!!

thanks Luca

----------

## Nate_S

It sounds like the module may not be getting loaded right the first time?  you could try

rmmod usb-storage

modprobe usb-storage

mount -t vfat /dev/sdb1 /mnt/usb

or something like that

Another thought is your stick might be one of the usb devices that needs the 'probe multiple LUNs' selected in the kernel, so see if that makes any difference.  

Good luck,

Nate

----------

## luca

Those LUNs were already enabled (I also disabled them, without succes)...

Also the rmmod usb-storage and modprobe....didn't work

But below is some output from dmesg after I plugged my stick in:

Apr 22 10:15:40 bhw024 usb 1-4: new high speed USB device using address 4

Apr 22 10:15:40 bhw024 usb-storage: USB Mass Storage device detected

Apr 22 10:15:40 bhw024 usb-storage: altsetting is 0, id_index is 107

Apr 22 10:15:40 bhw024 usb-storage: -- associate_dev

Apr 22 10:15:40 bhw024 usb-storage: Transport: Bulk

Apr 22 10:15:40 bhw024 usb-storage: Protocol: Transparent SCSI

Apr 22 10:15:40 bhw024 usb-storage: Endpoints: In: 0xdd8ae9c0 Out: 0xdd8ae9d4 Int: 0x00000000 (Period 0)

Apr 22 10:15:40 bhw024 usb-storage: usb_stor_control_msg: rq=fe rqtype=a1 value=0000 index=00 len=1

Apr 22 10:15:40 bhw024 usb-storage: GetMaxLUN command result is 1, data is 0

Apr 22 10:15:40 bhw024 usb-storage: *** thread sleeping.

Apr 22 10:15:40 bhw024 scsi2 : SCSI emulation for USB Mass Storage devices

Apr 22 10:15:40 bhw024 usb-storage: queuecommand called

Apr 22 10:15:40 bhw024 usb-storage: *** thread awakened.

Apr 22 10:15:40 bhw024 usb-storage: Command INQUIRY (6 bytes)

Apr 22 10:15:40 bhw024 usb-storage:  12 00 00 00 24 00

Apr 22 10:15:40 bhw024 usb-storage: Bulk Command S 0x43425355 T 0x64a L 36 F 128 Trg 0 LUN 0 CL 6

Apr 22 10:15:40 bhw024 usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes

Apr 22 10:15:40 bhw024 usb-storage: Status code 0; transferred 31/31

Apr 22 10:15:40 bhw024 usb-storage: -- transfer complete

Apr 22 10:15:40 bhw024 usb-storage: Bulk command transfer result=0

Apr 22 10:15:40 bhw024 usb-storage: usb_stor_bulk_transfer_buf: xfer 36 bytes

Apr 22 10:15:40 bhw024 usb-storage: Status code 0; transferred 36/36

Apr 22 10:15:40 bhw024 usb-storage: -- transfer complete

Apr 22 10:15:40 bhw024 usb-storage: Bulk data transfer result 0x0

Apr 22 10:15:40 bhw024 usb-storage: Attempting to get CSW...

Apr 22 10:15:40 bhw024 usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes

Apr 22 10:15:40 bhw024 usb-storage: Status code 0; transferred 13/13

Apr 22 10:15:40 bhw024 usb-storage: -- transfer complete

Apr 22 10:15:40 bhw024 usb-storage: Bulk status result = 0

Apr 22 10:15:40 bhw024 usb-storage: Bulk Status S 0x53425355 T 0x64a R 0 Stat 0x0

Apr 22 10:15:40 bhw024 usb-storage: Fixing INQUIRY data to show SCSI rev 2 - was 0

Apr 22 10:15:40 bhw024 usb-storage: scsi cmd done, result=0x0

Apr 22 10:15:40 bhw024 usb-storage: *** thread sleeping.

Apr 22 10:15:40 bhw024 usb-storage: queuecommand called

..........

Apr 22 10:15:40 bhw024 usb-storage: scsi cmd done, result=0x40000

Apr 22 10:15:40 bhw024 usb-storage: *** thread sleeping.

Apr 22 10:15:40 bhw024 usb-storage: queuecommand called

Apr 22 10:15:40 bhw024 usb-storage: *** thread awakened.

Apr 22 10:15:40 bhw024 usb-storage: Bad target number (3:0)

Apr 22 10:15:40 bhw024 usb-storage: scsi cmd done, result=0x40000

Apr 22 10:15:40 bhw024 usb-storage: *** thread sleeping.

Apr 22 10:15:40 bhw024 usb-storage: queuecommand called

Apr 22 10:15:40 bhw024 usb-storage: *** thread awakened.

Apr 22 10:15:40 bhw024 usb-storage: Bad target number (4:0)

Apr 22 10:15:40 bhw024 usb-storage: scsi cmd done, result=0x40000

Apr 22 10:15:40 bhw024 usb-storage: *** thread sleeping.

Apr 22 10:15:40 bhw024 usb-storage: queuecommand called

Apr 22 10:15:40 bhw024 usb-storage: *** thread awakened.

Apr 22 10:15:40 bhw024 usb-storage: Bad target number (5:0)

Apr 22 10:15:40 bhw024 usb-storage: scsi cmd done, result=0x40000

Apr 22 10:15:40 bhw024 usb-storage: *** thread sleeping.

Apr 22 10:15:40 bhw024 usb-storage: queuecommand called

Apr 22 10:15:40 bhw024 usb-storage: *** thread awakened.

Apr 22 10:15:40 bhw024 usb-storage: Bad target number (6:0)

Apr 22 10:15:40 bhw024 usb-storage: scsi cmd done, result=0x40000

Apr 22 10:15:40 bhw024 usb-storage: *** thread sleeping.

Apr 22 10:15:40 bhw024 usb-storage: queuecommand called

Apr 22 10:15:40 bhw024 usb-storage: *** thread awakened.

Apr 22 10:15:40 bhw024 usb-storage: Bad target number (7:0)

Apr 22 10:15:40 bhw024 usb-storage: scsi cmd done, result=0x40000

Apr 22 10:15:40 bhw024 usb-storage: *** thread sleeping.

Apr 22 10:15:40 bhw024 USB Mass Storage device found at 4

Apr 22 10:15:41 bhw024 scsi.agent[4840]: disk at /devices/pci0000:00/0000:00:1d.7/

that doesn't look good to me, any suggestions

luca

----------

## luca

Hi All

I've written a small script that does the trick for me. Now I can mount my usb-stick easily without any problems. You can download it here: http://www.phys.uu.nl/~calje/gentoo

Good luck

Luca

----------

