Template:FAQ/Questions/load USB-memory-stick

From GumstixDocsWiki

Jump to: navigation, search

What must be done to load a USB memory stick?

With this setup:

verdex motherboard <-> breakout-vx or console-vx expansion board <-> USB cable with gender switcher <-> USB memory stick


Once the gumstix boots:

# lsmod
Module                  Size  Used by
ipv6                  248776  10
unix                   22964  8
# modprobe ohci-hcd
usbcore: registered new driver usbfs
usbcore: registered new driver hub
pxa27x-ohci pxa27x-ohci: PXA27x OHCI
pxa27x-ohci pxa27x-ohci: new USB bus registered, assigned bus number 1
pxa27x-ohci pxa27x-ohci: irq 3, io mem 0x4c000000
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 3 ports detected
# usb 1-2: new full speed USB device using pxa27x-ohci and address 2
usb 1-2: configuration #1 chosen from 1 choice
SCSI subsystem initialized
Initializing USB Mass Storage driver...
scsi0 : SCSI emulation for USB Mass Storage devices
usbcore: registered new driver usb-storage
USB Mass Storage support registered.
  Vendor: Memorex   Model: TD Classic 003B   Rev: PMAP
  Type:   Direct-Access                      ANSI SCSI revision: 00
SCSI device sda: 2015232 512-byte hdwr sectors (1032 MB)
sda: Write Protect is off
sda: assuming drive cache: write through
SCSI device sda: 2015232 512-byte hdwr sectors (1032 MB)
sda: Write Protect is off
sda: assuming drive cache: write through
sda: sda1
sd 0:0:0:0: Attached scsi removable disk sda


You can then mount /dev/sda1 or create a udev rule to do this automatically when the device is created. To create the udev rule, navigate to /etc/udev/rules.d. Next create the file 10-local.rules or whatever you want to state it. However this has to be lexicographically lower then the default rules (50-udev-default.rules). Inside this file place the following:

KERNEL=="sda1", ACTION=="remove", RUN+="/bin/umount /mnt/usb"
KERNEL=="sda1", ACTION=="add", RUN+="/bin/mount /mnt/usb" 

If you get an error "No such file or directory" when doing the mount, you might need to explicitly state the filesystem type on the thumbdrive (generally vfat), e.g.

mount -t vfat /dev/sda1 /mnt/usb

You can also add a line for ohci-hcd to /etc/modules if you want it to load automatically at boot.

Personal tools