# USB stick and udev

## sean345

I have been trying to figure out how to access a usb stick.  I remember when I first installed gentoo, the handbook (at the time) had an extra line in fstab regarding a usb stick.  I added the line, but have not tried using it until now.  I have hotplugging and udev set up.  Here is some relevant output:

 *Quote:*   

> 
> 
> # dmesg | tail -n 15
> 
> NET: Registered protocol family 10
> ...

 

How exactly do I mount and access the usb stick?  After searching the forums I noticed that many said the usb device was /dev/sda1, but that device does not exist for me.

 *Quote:*   

> 
> 
> # ls /dev/sda1
> 
> ls: /dev/sda1: No such file or directory
> ...

 

Thanks,

 - Sean

----------

## scoon

Hey there, 

Did you make usb-storage a module or compile it into your kernel ?

regards, 

scoon

----------

## sean345

I have compiled usb-storage as a module.

Thanks,

 - Sean

----------

## scoon

Hey there, 

I auto-load sbp2 on boot.  Maybe try unloading usb-storage and then load this and then load usb-storage and see what happens. 

regards, 

scoon

----------

## sean345

I do not have a sbp2 module.  Is that what sbp2 is?

Thanks,

 - Sean

----------

## Rainmaker

is your disk at

/dev/uba1

by any chance?

----------

## sean345

No, I have no /dev/uba1 or any /dev/uba*

 - Sean

----------

## Gogiel

/dev/MAKEDEV sda

----------

## Headrush

You must have sd_mod support. Make sure you have it set in your kernel. (module is eaier to debug)

If you already have it, modprobe sd_mod and then try re-inserting your USB key.

----------

## sean345

I am unable to modprobe sd_mod.  What option is this in the kernel config?

Thanks,

 - Sean

----------

## scoon

Hey there, 

It is under Device Drivers and SCSI

regards, 

scoon

----------

## sean345

Thanks that worked.  I have now done this:

 *Quote:*   

> 
> 
> # mkdir /mnt/usbstick
> 
> # mount -t usbfs /dev/sda /mnt/usbstick
> ...

 

Now that I have mounted it to /mnt/usbstick, how do I access the files and use it?

Thanks,

 - Sean

----------

## Headrush

 *sean345 wrote:*   

> Thanks that worked.  I have now done this:
> 
>  *Quote:*   
> 
> # mkdir /mnt/usbstick
> ...

 

Try just mounting the partition number and don't specify the filesystem. eg

```
mount /dev/sda1 /mnt/usbstick
```

You should see the file in /mnt/usbstick now.

----------

## sean345

When I did this it gave me an error and said that I needed to specify the filesystem type.  I fixed it though by using

 *Quote:*   

> mount -t vfat /dev/sda1 /mnt/usbstick
> 
> 

 

I'm not sure what the difference is between vfat and usbfs, but it works now.  Thanks all.

 - Sean

----------

## Headrush

 *sean345 wrote:*   

> I'm not sure what the difference is between vfat and usbfs, but it works now.  Thanks all.

 

usbfs is not a filesystem used on media.

vfat, msdos, ntfs, ext, udf, etc are just different ways of formatting and accessing data on media.

For cross compatability with windows, vfat is your best choice.

----------

