Image

Imagelrc wrote in Imagelinux

Mounting USB flash drive on an embedded system

We've got a system that is effectively a homegrown distribution. It'll boot off a floppy, and using tftp to download everything off of a server will boot up a ramdisk only system, running the 2.6.9 kernel.

For reasons I won't go into, standard harddrive support isn't an option. In order to get some local storage on the system, we want to mount a USB drive. I've tried compiling everything that I think I'll need (usb, usb-storage, scsi ...) into a monotlithic kernel.

Pretty much all of the recent documentation I can find is for bringing up USB drives on desktop systems running a full desktop environment and involve poking at the things required to get it to happen automagically. I need some documentation that is a bit lower level than that.

I booted the hardware under kubuntu 7 and it sees the drive just fine.



I'm getting the following in dmesg:
Initializing USB Mass Storage driver...
usbcore: registered new driver usb-storage
USB Mass Storage support registered.

Some other snippets (may be out of order as I didn't always do everythign on the logged terminal):

mknod -m 666 /dev/sda b 8 0
mknod -m 666 /dev/sda1 b 8 1
mknod -m 666 /dev/sdb b 8 16
bash-3.00# mknod -m 666 /dev/sdb1 b 8 17

bash-3.00# mount -t vfat /dev/sdb1 /mnt
mount: /dev/sdb1 is not a valid block device
15 mount -t vfat /dev/sdb1 /mnt
17 mknod -m 666 /dev/sdb1 b 8 17
18 mount -t vfat /dev/sdb1 /mnt
bash-3.00# mknod -m 666 /dev/sda b 8 0

bash-3.00# cat /proc/devices
Character devices:
1 mem
4 /dev/vc/0
4 tty
4 ttyS
5 /dev/tty
5 /dev/console
5 /dev/ptmx
7 vcs
10 misc
13 input
21 sg
128 ptm
136 pts
180 usb
240 stream

Block devices:
1 ramdisk
7 loop
8 sd
65 sd
66 sd
67 sd
68 sd
69 sd
70 sd
71 sd
125 ub
128 sd
129 sd
130 sd
131 sd
132 sd
133 sd
134 sd
135 sd
bash-3.00# spurious 8259A interrupt: IRQ7.
ls
console initctl net ptmx sdb tty tty2 tty5 ttyS0 ttyS3 ttyS6
fb mem null pts stream1 tty0 tty3 tty6 ttyS1 ttyS4 ttyS7
fb0 mouse psaux sda stream2 tty1 tty4 tty7 ttyS2 ttyS5
bash-3.00# mknod /dev/sda1 b 8 1
bash-3.00# mkdir /mnt
bash-3.00# mount -t vfat /dev/sda1 /mnt
mount: /dev/sda1 is not a valid block device
bash-3.00# mount -t vfat /dev/sda1 /mbash-3.00# mknod /dev/sdb
bash-3.00# mknod /dev/sdb1 b 8 17bash-3.00# mount -t vfat /dev/sda
mount: /dev/sda is not a valid block device
bash-3.00# mount -t vfat /dev/sdb
mount: /dev/sdb is not a valid block device
bash-3.00# mount -t vfat /dev/sdb1
mount: /dev/sdb1 is not a valid block device
bash-3.00# dmesg