# USB Mass Storage, Firewire, and SCSI Emulation

## mellofone

Thus begins the nightmare  :Smile: 

I have been trying to get some external firewire storgage working with my gentoo (2.4.19-r9) box. I already have a CDR working perfectly with SCSI emulation, so I thought this would be a breeze. I have tried everything I can find with SCSI emulation to make the drive work, and no matter what I tried, the /dev/sd? just never seemed to appear. I gave up and thought it was something with my generic D-Link firewire adapter.

Today, I bought an Archos USB 2.0 MP3 player and an NEC USB 2 adapter. I installed the works, compiled USB2 into the kernel, and rebooted.

SAME RESULTS! The USB adapter card is found:

```
hub.c: USB new device connect on bus1/1, assigned device number 2

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

But again, no magical /dev/sd? link is there.

The firewire card did the exact same thing:

```
ohci1394: $Rev: 530 $ Ben Collins <bcollins@debian.org>

PCI: Found IRQ 9 for device 00:0d.0

PCI: Sharing IRQ 9 with 00:09.0

ohci1394_0: OHCI-1394 1.0 (PCI): IRQ=[9]  MMIO=[e7108000-e7108800]  Max Packet=[2048]

scsi2 : IEEE-1394 SBP-2 protocol driver (host: ohci1394)

$Rev: 530 $ James Goodwin <jamesg@filanet.com>

SBP-2 module load options:

- Max speed supported: S400

- Max sectors per I/O supported: 255

- Max outstanding commands supported: 8

- Max outstanding commands per lun supported: 1

- Serialized I/O (debug): no

- Exclusive login: yes

resize_dma_pool: unknown device type -1
```

Since it is doing this with BOTH cards, one which I KNOW is not generic, I am assuming that I am missing something easy somewhere. Any ideas what I can check?

----------

## biroed

Maybe this in your devfsd.conf:

```
#Create sda4 for usb-zip 

LOOKUP     ^sda4     CFUNCTION GLOBAL mksymlink scsi/host1/bus0/target0/lun0/part4 sda4 

REGISTER    ^scsi/host1/bus0/target0/lun0/part4 CFUNCTION GLOBAL mksymlink $devname sda4 

UNREGISTER  ^scsi/host1/bus0/target0/lun0/part4 CFUNCTION GLOBAL unlink sda4 

```

make sure you use the right host!! (cdrecord -scanbus) for the storage.

----------

## mellofone

It never shows up in the /dev/scsi/* section, so I have no idea what to link it to...

----------

## bertrand

What modules are loaded?

I know that if I don't have sd_mod loaded, the entries will not show up in /dev after running the rescan-scsi-bus.sh script.

Do a google search on the file name if don't really have the script.

----------

## mellofone

I have tried using sd_mod both compiled into the kernel as well as using it as a module. Same result, nothing.

I also downloaded and tried using the rescan-scsi-bus.sh script, and it detects nothing other then my CD-ROM and CD-RW drive.

One last thing I did try last night was having the USB device plugged in at bootup. It works like a charm! However, if I reboot without it plugged in, the /dev/sda will not show up.

The firewire drive, however, still does not work, even if it is plugged in at boot or not.

----------

## bertrand

I just plugged my firewire drive and the sd_mod was loaded. I didn't get any entries for /dev/sd* before running the script.

Do you have the hotplug package install? I don't know if this really matter, but it's what I have.

My usb dig cam work the same as my firewire drive, I don't get any entries until I run the script.

What logs do you get from the kernel? Is you drive showing up in the log?

----------

## mellofone

After quite a bit of trial and error, I seemed to have gotten it all working perfectly. For some reason, as long as I have a device plugged into the USB2 device at boot, it works perfectly; even the firewire drive.

However, if I do not boot with the USB2 device plugged in, and then run the rescan-scsi-bus.sh, it locks up the terminal, and I cannot kill it, even from another terminal.

So it MOSTLY works, but it's a bit wonky. I can live with it this way, I just have to make sure the USB2 device is plugged in at boot...

----------

## Chris Finch

I had issues with usb under 2.4.20 but now with a vanilla 2.4.21 it all workls very nicely. On an ASUS P4PE board, I use the modules

sd_mod

usbcore

usb-uhci

usb-storage

ehci-hcd

which I autoload at boot. Together with the modules for scsi-emulation of my ide cd-writer, these detect when I plug my portabe archos hd in, create /dev/sda1 and allow for fast usb 2.0 data transfer. I use the sync option for mounting, just to go sure. Having a usb device plugged at boot is not required.

----------

