# USB Mass Storage Mounting problem.

## raananan

Hello,

I read alot of How-To's and posts about mounting a usb storage device. I did everything that was suggested and came empty.

I build the kernel with:

 *Quote:*   

> SCSI: 
> 
>   [*]   legacy /proc/scsi/ support
> 
>   <*>   SCSI disk support
> ...

 

I installed the vfat file system and all the thinds it needs.

My problem is when I plug the usb and run "# dmesg" I get this:

I think the realy important section is in the end but I posted it all  :Smile: 

 *Quote:*   

> Linux version 2.6.5-gentoo-r1 (root@bilby) (gcc version 3.3.2 20031218 (Gentoo Linux 3.3.2-r5, propolice-3.3-7)) #16 Sat May 15 16:09:38 IDT 2004
> 
> BIOS-provided physical RAM map:
> 
>  BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
> ...

 

I realy don't know much about linux so if you are reading this it mean you read it all so first i would like to say THANKS, and second PLEASE HELP.

Thanks.

----------

## guitou

Your USB key seems to be /dev/sda.

Try ls /dev/sda*

There has to be a /dev/sda1 that you should mount to access the key content.

Guitou.

----------

## tuxlover

I don't really understand your question/problem, from your dmesg everything seems ok...

to access your usb thing, you need to mount it:

mount /dev/sda1 / /mnt/usbstick

(you need to create the directory /mnt/usbstick before, of course)

then you can access your usb thing at /mnt/usbstick (the mount point).

----------

## raananan

The problem is that I don't have any /dev/sd* so I can't mount.

----------

## COMKEEN

Try this:

1. Boot your computer

2. Log in as root

3. do 

```
ls /dev/scsi
```

This would give you

```
host0
```

for example (if you have an IDE CD-Burner and have SCSI-Emulation enabled).

4. Now load the necessary modules, i.e.

```

modprobe usb-storage

```

5. Plug in the USB Stick.

6. Do 

```
ls /dev/scsi
```

 again.

7. If you're lucky, you see one more entry:

```
host0 host1
```

8. cd into host1 (or whatever the new directory is called).

9. Optional: Read HOWTOs and Tutorials about SCSI to understand waht targets and luns are...

10. cd into /dev/scsi/host1/bus0/target0/lun0/

11a. What files are in there?

If you find something like 

```
disc generic part1
```

 you can try to mount the partition:

```
mount /dev/scsi/host1/bus0/target0/lun0/part1 /mnt/usbstick -t vfat
```

Of course: This does only work if there is a directory (mountpoint) /mnt/usbstick and your stick is formatted as vfat (if you used it under Windows before. Many USB-Sticks are preformatted with vfat, too). Just give it a try.

11b. If there IS NO file called part1, but only "disc" and "generic", you have to partition the Stick and create a filesystem first. I created an ext2 filesystem on my Stick because it can handle file permissions and so on. If you want to use the Stick as a mobile disk and for different Computers, you may want to format the Stick with vfat so that you can use it on Windows PCs, too.

Partitioning and creating a FS is similar to how to do it with normal (hard-) disks. Read the appropriate chapters in the Gentoo Installation Guide or do a

```
man fdisk
```

```
man mke2fs
```

HTH

----------

## tuxlover

another good idea would be to use gentoo's hotplug script. simply install it and add it to the default runlevel, so it is automatically started:

```
emerge hotplug

rc-update add hotplug default
```

then you need to compile all the necessary stuff as modules instead of into the kernel, like you did it. in /usr/src/linux/.config, this would be

```
CONFIG_USB=m

CONFIG_USB_HID=m

CONFIG_USB_EHCI_HCD=m

CONFIG_USB_UHCI_HCD=m

CONFIG_USB_STORAGE=m

CONFIG_BLK_DEV_SD=m
```

With hotplug installed and all these things compiled as modules, hotplug should take care of loading appropriate modules and creating /dev/sda* when you plug in your usb stick.

----------

