Using a USB Memory Key under Linux

I recently got a USB Memory Key. Essentially it's a very small box that can literally be put on a keychain that has a USB plug on one end and some flash memory on the other. Mine has 32MB of flash RAM; they go from about 8MB to 128MB, as far as I can tell.

These keys are touted to "just work" under newer versions of Windows (2000 and XP, specifically). I don't have such machines so didn't try it. This key consistenly crashes my wife's Windows 98 machine, even with the newest drivers, but works fine on a borrowed Gateway laptop also running Windows 98. But now to the good stuff. I have two machines I want to use this on--one at work, one at home. Specs:

  1. I had to make sure the usb modules were loaded and available. To get the thing working, you need quite a few going:
  2. The theory of it is this: when the usbcore/usb-*hci modules notice the key being plugged in, they use usb-storage to simulate a scsi controller and pass the response off to the scsi disk driver, sd_mod. sd_mod assigns it a /dev/sd*1 device, where * is the next available letter in your scsi drive chain. On my office machine, that's a; at home it's b because I have a SCSI zip drive.
  3. Make sure you have a place to mount the key; I use /mnt/usbkey.
  4. Assuming everything worked right, all you have to do is mount the key:

    mount -tvfat -oumask=0000 /dev/sda1 /mnt/usbkey

  5. If it didn't work right, make sure you have all the modules loaded and working, then watch /var/log/messages as you insert and remove the key.
  6. In my experience, kernel 2.4.x is required to make this work. The usb modules under 2.2.x did not support usb-storage adequately.