# USB support in Linux

**URL:** <https://community.sparkfun.com/t/usb-support-in-linux/7948>\
**Category:** MicroMod\
**Tags:** arm-lpc\
**Created:** [July 20, 2008, 1:15pm UTC](https://community.sparkfun.com/t/usb-support-in-linux/7948 "2008-07-20T13:15:13Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![limp](https://avatars.discourse-cdn.com/v4/letter/l/f6c823/32.png) [@limp](https://community.sparkfun.com/u/limp)\
**Post date:** [July 20, 2008, 1:15pm UTC](https://community.sparkfun.com/t/usb-support-in-linux/7948/1 "2008-07-20T13:15:13Z")

</div>

Hi to all,

I am using a CS-9302 board and I want to use a USB stick whith it. (specifically a SunDisk Cruzer 512 Mb). However, it seems that my kernel (2.6.20.4) doesn’t have USB support because when I am trying to mount it I get the following message:

```auto
mount: Mounting /dev/sda1 on mnt failed: No such device or address

```

from the kernel boot process I noticed the following messages which are regarding to USB drivers:

```auto
ep93xx-usb ep93xx-usb: EP93xx OHCI

ep93xx-usb ep93xx-usb: new USB bus registered, assigned bus number 1

ep93xx-usb ep93xx-usb: irq 56, io mem 0x80020000

usb usb1: configuration #1 chosen from 1 choice

hub 1-0:1.0: USB hub found

hub 1-0:1.0: 3 ports detected

usbcore: registered new interface driver hiddev

usbcore: registered new interface driver usbhid

drivers/usb/input/hid-core.c: v2.6:USB HID core driver

drivers/usb/net/rtl8150.c: rtl8150 based usb-ethernet driver v0.6.2 (2004/08/27)

usbcore: registered new interface driver rtl8150

usbcore: registered new interface driver usbserial

drivers/usb/serial/usb-serial.c: USB Serial Driver core

drivers/usb/serial/usb-serial.c: USB Serial support registered for pl2303

usbcore: registered new interface driver pl2303

drivers/usb/serial/pl2303.c: Prolific PL2303 USB to serial adaptor driver

```

What should I do to have USB support? Could I do some changes into kernel configuration settings to fix that?

Thank you in advance for your time.

---

<div class="post-metadata">

**Author:** ![denial](https://avatars.discourse-cdn.com/v4/letter/d/ce73a5/32.png) [@denial](https://community.sparkfun.com/u/denial)\
**Post date:** [July 20, 2008, 8:58pm UTC](https://community.sparkfun.com/t/usb-support-in-linux/7948/2 "2008-07-20T20:58:51Z")

</div>

Did you load the modules usb-storage and sd\_mod?

---

<div class="post-metadata">

**Author:** ![limp](https://avatars.discourse-cdn.com/v4/letter/l/f6c823/32.png) [@limp](https://community.sparkfun.com/u/limp)\
**Post date:** [July 21, 2008, 7:40am UTC](https://community.sparkfun.com/t/usb-support-in-linux/7948/3 "2008-07-21T07:40:25Z")

</div>

First of all thank you for your reply!

In menuconfig I am choosing all “USB Mass Storage support” devices to be built-in the kernel so I assumed that there will be no need to load any module regarding usb suppport.

Could you please help me out a little bit on how to load these modules on the kernel? Where are located anyway in the source?

In BusyBox I don’t have support of the insmod command in order to load the module. Could I follow a different procedure in order to load them?

Again, thanks a lot!

---

<div class="post-metadata">

**Author:** ![denial](https://avatars.discourse-cdn.com/v4/letter/d/ce73a5/32.png) [@denial](https://community.sparkfun.com/u/denial)\
**Post date:** [July 21, 2008, 8:26am UTC](https://community.sparkfun.com/t/usb-support-in-linux/7948/4 "2008-07-21T08:26:50Z")

</div>

You also need the SCSI subsystem including the SCSI disk driver (sd\_mod).

Did you include those as well?

What does dmesg say after you’ve plugged in that stick?

---

<div class="post-metadata">

**Author:** ![limp](https://avatars.discourse-cdn.com/v4/letter/l/f6c823/32.png) [@limp](https://community.sparkfun.com/u/limp)\
**Post date:** [July 21, 2008, 9:59am UTC](https://community.sparkfun.com/t/usb-support-in-linux/7948/5 "2008-07-21T09:59:13Z")

</div>

> You also need the SCSI subsystem including the SCSI disk driver (sd\_mod).
> 
> Did you include those as well?

I am choosing “SCSI device support”, “SCSI targert support” and “SCSI generic support” to be built-in the kernel from menuconfig.

I can’t find anyware in the source where the modules “sd\_mod” and “usb-storage” that you mentioned are. How can I built this modules in the kernel Image file that I am creating and finally load on the board?

> What does dmesg say after you’ve plugged in that stick?

I am getting the following message:

```auto
~ # usb 1-3: new full speed USB device using ep93xx-usb and address 2
usb 1-3: not running at top speed; connect to a high speed hub
usb 1-3: Product: U3 Cruzer Micro
usb 1-3: Manufacturer: SanDisk Corporation
usb 1-3: SerialNumber: 0000051019072283
usb 1-3: configuration #1 chosen from 1 choice
scsi0 : SCSI emulation for USB Mass Storage devices

~ # scsi 0:0:0:0: Direct-Access SanDisk U3 Cruzer Micro 2.15 PQ: 0 ANSI: 2

```

Thank you!

---

<div class="post-metadata">

**Author:** ![denial](https://avatars.discourse-cdn.com/v4/letter/d/ce73a5/32.png) [@denial](https://community.sparkfun.com/u/denial)\
**Post date:** [July 21, 2008, 11:49am UTC](https://community.sparkfun.com/t/usb-support-in-linux/7948/6 "2008-07-21T11:49:06Z")

</div>

> limp:  
> I am choosing “SCSI device support”, “SCSI targert support” and “SCSI generic support” to be built-in the kernel from menuconfig.

You don’t need “SCSI target support” and “SCSI generic support” for this to work.

You need “SCSI disk support”

> I can’t find anyware in the source where the modules “sd\_mod” and “usb-storage” that you mentioned are.

sd\_mod is “SCSI disk support”

usb-storage is “USB Mass Storage support”

---

<div class="post-metadata">

**Author:** ![limp](https://avatars.discourse-cdn.com/v4/letter/l/f6c823/32.png) [@limp](https://community.sparkfun.com/u/limp)\
**Post date:** [July 21, 2008, 12:03pm UTC](https://community.sparkfun.com/t/usb-support-in-linux/7948/7 "2008-07-21T12:03:04Z")

</div>

I will try to re-build the kernel with “SCSI disk support” and “USB Mass Storage support” selected to be built-in and I will let you know for the results.

I really apreciate your help!

---

<div class="post-metadata">

**Author:** ![limp](https://avatars.discourse-cdn.com/v4/letter/l/f6c823/32.png) [@limp](https://community.sparkfun.com/u/limp)\
**Post date:** [July 21, 2008, 12:48pm UTC](https://community.sparkfun.com/t/usb-support-in-linux/7948/8 "2008-07-21T12:48:57Z")

</div>

I have dove the changes in menuconfig and I re-built the kernel.

The compilation has been compilted successfully, however, I can’t find the kernel Images.

Here are the messages from the end of the build procedure indicating that arch/arm/boot/zImage file has been created successfully:

```auto
  OBJCOPY arch/arm/boot/Image
  Kernel: arch/arm/boot/Image is ready
  GZIP arch/arm/boot/compressed/piggy.gz
  AS arch/arm/boot/compressed/piggy.o
  LD arch/arm/boot/compressed/vmlinux
  OBJCOPY arch/arm/boot/zImage
  Kernel: arch/arm/boot/zImage is ready
  Building modules, stage 2.
  MODPOST 15 modules

```

Also, Linux can see the zImage file with “ls” command:

```auto
limp@limp-laptop:~/limp_project/My_Kernel/linux-2.6.20.4$ ls -l arch/arm/boot/zImage
-rwxr-xr-x 1 limp limp 1794320 2008-07-21 13:32 arch/arm/boot/zImage

```

BUT, when I am going to linux-2.6.20.4/arch/arm/boot/ folder, zImage is not there!!!

---

<div class="post-metadata">

**Author:** ![limp](https://avatars.discourse-cdn.com/v4/letter/l/f6c823/32.png) [@limp](https://community.sparkfun.com/u/limp)\
**Post date:** [July 22, 2008, 10:57am UTC](https://community.sparkfun.com/t/usb-support-in-linux/7948/9 "2008-07-22T10:57:47Z")

</div>

> BUT, when I am going to linux-2.6.20.4/arch/arm/boot/ folder, zImage is not there!!!

OK, I got finally the zImage file after lots of tries (I don’t know why I had the above problem) and I load it to the board.

Now, when I am plugin in my USB I am getting the below message:

```auto
~ # usb 1-3: new full speed USB device using ep93xx-usb and address 2
usb 1-3: not running at top speed; connect to a high speed hub
usb 1-3: configuration #1 chosen from 1 choice
scsi0 : SCSI emulation for USB Mass Storage devices
scsi 0:0:0:0: Direct-Access SanDisk U3 Cruzer Micro 2.15 PQ: 0 ANSI: 2
SCSI device sda: 990865 512-byte hdwr sectors (507 MB)
sda: Write Protect is off
sda: assuming drive cache: write through
SCSI device sda: 990865 512-byte hdwr sectors (507 MB)
sda: Write Protect is off
sda: assuming drive cache: write through
 sda:<7>usb-storage: queuecommand called
 sda1
sd 0:0:0:0: Attached scsi removable disk sda

```

and my dmesg is the following:

```auto
R 188 Stat 0x0              
usb-storage: scsi cmd done, result=0x0                                      
usb-storage: *** thread sleeping.                                 
sda: Write Protect is off                         
sda: Mode Sense: 03 00 00 00                            
sda: assuming drive cache: write through                                        
usb-storage: queuecommand called                                
usb-storage: *** thread awakened.                                 
usb-storage: Command TEST_UNIT_READY (6 bytes)                                              
usb-storage: 00 00 00 00 00 00                               
usb-storage: Bulk Command S 0x43425355 T 0x5 L 0 F 0 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: Attempting to get CSW...                                     
usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes                                                      
usb-storage: Status code 0; tr                            
usb-storage: -- transfer complete                                 
usb-storage: Bulk status result = 0                                   
usb-storage: Bulk Status S 0x53425355 T 0x5 R 0 Stat 0x0                                                        
usb-storage: scsi cmd done, result=0x0                                      
usb-storage: *** thread sleeping.                                 
usb-storage: queuecommand called                                
usb-storage: *** thread awakened.                                 
usb-storage: Command ALLOW_MEDIUM_REMOVAL (6 bytes)                                                   
usb-storage: 1e 00 00 00 01 00                               
usb-storage: Bulk Command S 0x43425355 T 0x6 L 0 F 0 Trg 0 LUN 0 CL 6                                                                     
usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes                                                      
usb-storage: Status code 0; transferred 31                                        
usb-storage: -- transfer complete                                 
usb-storage: Bulk command transfer result=0                                           
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 0x6 R 0 Stat 0x1                                                        
usb-storage: -- transport indicates command failure                                                   
usb-storage: Issuing auto-REQUEST_SENSE                                       
usb-storage: Bulk Command S 0x43425355 T 0x7 L 18 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_buf: xfer 18 bytes                                                      
usb-storage: Status code 0; transferred 18/18                                             
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: -- transf                    
usb-storage: Bulk status result = 0                                   
usb-storage: Bulk Status S 0x53425355 T 0x7 R 0 Stat 0x0                                                        
usb-storage: -- Result from auto-sense is 0                                           
usb-storage: -- code: 0x70, key: 0x5, ASC: 0x24, ASCQ: 0x0                                                          
usb-storage: (Unknown Key): (unknown ASC/ASCQ)                                              
usb-storage: scsi cmd done, result=0x2                                      
usb-storage: *** thread sleeping.                                 
usb-storage: queuecommand called                                
usb-storage: *** thread awakened.                                 
usb-storage: Command TEST_UNIT_READY (6 bytes)                                              
usb-storage: 00 00 00 00 00 00                               
usb-storage: Bulk Command S 0x43425355 T 0x8 L 0 F 0 Trg                                                      
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: 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 0x8 R 0 Stat 0x0                                                        
usb-storage: scsi cmd done, result=0x0                                      
usb-storage: *** thread sleeping.                                 
usb-storage: queuecommand called                                
usb-storage: *** thread awakened.                                 
usb-storage: Command READ_CAPACITY (10 bytes)                                             
usb-storage: 25 00 00 00 00 00 00 00 00 00                                           
usb-storage: Bulk Command S 0x43425355 T 0x9 L 8 F 128 Trg 0 LUN 0 CL 10                                                                        
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 8 bytes, 1 entries                                                                   
usb-storage: Status code 0; transferred                                        
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 0x9 R 0 Stat 0x0                                                        
usb-storage: scsi cmd done, result=0x0                                      
usb-storage: *** thread sleeping.                                 
SCSI device sda: 990865 512-byte hdwr sectors (507 MB)                                                      
usb-storage: queuecommand called                                
usb-storage: *** thread awakened.                                 
usb-storage: Command MODE_SENSE (6 bytes)                                         
usb-storage: 1a 00 3f 00 c0 00                               
usb-storage: Bulk Command S 0x43425355 T 0xa L 192 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 192 bytes, 1 entries                                                                     
usb-storage: Status code -121; transferred 4/192                                                
usb-storage: -- short read transfer                                   
usb-storage: Bulk data transfer result 0x1                                          
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 0xa R 188 Stat 0x0                                                          
usb-storage: scsi cmd done, result=0x0                                      
usb-storage: *** thread sleeping.                                 
sda: Write Protect is off                         
sda: Mode Sense: 03 00 00 00                            
sda: assuming drive cache: write through                                        
 sda:<7>usb-storage: queuecommand call                                     
usb-storage: *** thread awakened.                                 
usb-storage: Command READ_10 (10 bytes)                                       
usb-storage: 28 00 00 00 00 00 00 00 08 00                                           
usb-storage: Bulk Command S 0x43425355 T 0xb L 4096 F 128 Trg 0 LUN 0 CL 10                                                                           
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 4096 bytes, 1 entries                                                                      
usb-storage: Status code 0; transferred 4096/4096                                                 
usb-storage: -- transfe                      
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 0xb R 0 Stat 0x0                                                        
usb-storage: scsi cmd done, result=0x0                                      
usb-storage: *** thread sleeping.                                 
 sda1     
sd 0:0:0:0: Attached scsi removable disk sda                                            
usb-storage: queuecommand called                                
usb-storage: *** thread awakened.                                 
usb-storage: Bad ta                 
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

```

When I am trying to mount it I get the following message:

```auto
~ # mount /dev/sda1 mnt
UDF-fs: No partition found (1)
mount: Mounting /dev/sda1 on mnt failed: Invalid argument

```

I have also tried with sda instead of sda1 without success.

Any help?

---

<div class="post-metadata">

**Author:** ![lou](https://avatars.discourse-cdn.com/v4/letter/l/ea666f/32.png) [@lou](https://community.sparkfun.com/u/lou)\
**Post date:** [July 22, 2008, 2:39pm UTC](https://community.sparkfun.com/t/usb-support-in-linux/7948/10 "2008-07-22T14:39:56Z")

</div>

> limp:  
> When I am trying to mount it I get the following message:
> 
> ```auto
> ~ # mount /dev/sda1 mnt
> 
> ```

UDF-fs: No partition found (1)  
mount: Mounting /dev/sda1 on mnt failed: Invalid argument

> ```auto
> 
> ```

Has the drive been partitioned?

Is “mnt” a directory under the directory that you’re invoking mount from?

> limp:  
> I have also tried with sda instead of sda1 without success.
> 
> Any help?

Has the unpartitioned drive been formatted with a filesystem which the kernel you’ve built supports?

---

<div class="post-metadata">

**Author:** ![denial](https://avatars.discourse-cdn.com/v4/letter/d/ce73a5/32.png) [@denial](https://community.sparkfun.com/u/denial)\
**Post date:** [July 22, 2008, 2:53pm UTC](https://community.sparkfun.com/t/usb-support-in-linux/7948/11 "2008-07-22T14:53:00Z")

</div>

> limp:
> 
> ```auto
> R 188 Stat 0x0              
> 
> ```

usb-storage: scsi cmd done, result=0x0  
usb-storage: \*\*\* thread sleeping.  
sda: Write Protect is off  
sda: Mode Sense: 03 00 00 00  
sda: assuming drive cache: write through  
usb-storage: queuecommand called  
usb-storage: \*\*\* thread awakened.  
usb-storage: Command TEST\_UNIT\_READY (6 bytes)  
usb-storage: 00 00 00 00 00 00  
usb-storage: Bulk Command S 0x43425355 T 0x5 L 0 F 0 Trg 0 LUN 0 CL 6

> ```auto
> 
> ```

Wow, you’ve compiled in A LOT of debug messages…

> When I am trying to mount it I get the following message:
> 
> ```auto
> UDF-fs: No partition found (1)
> 
> ```

For some reason it is trying to use the UDF file system. Try to mount with -t vfat or -t ntfs or whatever you use on that stick.

> I have also tried with sda instead of sda1 without success.

/dev/sda1 is correct. The message that says which partitions are available is in that big dmesg output.

---

<div class="post-metadata">

**Author:** ![limp](https://avatars.discourse-cdn.com/v4/letter/l/f6c823/32.png) [@limp](https://community.sparkfun.com/u/limp)\
**Post date:** [July 22, 2008, 9:11pm UTC](https://community.sparkfun.com/t/usb-support-in-linux/7948/12 "2008-07-22T21:11:47Z")

</div>

Problem solved!

> lou:  
> Has the unpartitioned drive been formatted with a filesystem which the kernel you’ve built supports?

My USB stick has FAT filesystem but my kernel didn’t have support for FAT filesystems. When I added this, everything worked fine and now I am able to mount and use my USB stick!

I want to thank you all for your help. It was really appreciated!
