How to detect and mount USB Flash Drive devices
By tazzie:
yes, the usbkey will be detected and handled like a harddisk, and is emulated by SCSI as well. the usual thing you would do is look into /var/log/messages. my suggestion is to do a tail command with the follow flag. next, plug in your USBKey, and observe the messages created by the kernel. you should something to the effect of the following:
code:
Jun 18 10:39:16 localhost kernel: hub.c: new USB device 00:04.3-2.3, assigned address 4
Jun 18 10:39:16 localhost kernel: usb.c: USB device 4 (vend/prod 0xc76/0x5) is not claimed by any active driver.
Jun 18 10:39:19 localhost /etc/hotplug/usb.agent: Setup usb-storage for USB product c76/5/100
Jun 18 10:39:19 localhost kernel: Initializing USB Mass Storage driver...
Jun 18 10:39:19 localhost kernel: usb.c: registered new driver usb-storage
Jun 18 10:39:19 localhost kernel: scsi2 : SCSI emulation for USB Mass Storage devices
Jun 18 10:39:19 localhost kernel: Vendor: Model: TS256MJFLASHA Rev: 1.00
Jun 18 10:39:19 localhost kernel: Type: Direct-Access ANSI SCSI revision: 02
Jun 18 10:39:19 localhost kernel: Attached scsi removable disk sdb at scsi2, channel 0, id 0, lun 0
Jun 18 10:39:19 localhost kernel: SCSI device sdb: 506400 512-byte hdwr sectors (259 MB)
Jun 18 10:39:19 localhost kernel: sdb: Write Protect is off
Jun 18 10:39:20 localhost kernel: sdb: sdb1
Jun 18 10:39:20 localhost kernel: USB Mass Storage support registered.
Jun 18 10:39:20 localhost kernel: Attached scsi CD-ROM sr0 at scsi1, channel 0, id 0, lun 0
Jun 18 10:39:20 localhost kernel: sr0: scsi3-mmc drive: 125x/48x writer cd/rw xa/form2 cdda tray
Jun 18 10:39:21 localhost devlabel: devlabel service started/restarted
look out for something like the bolded text above. mount to that and you should be alright. the usual places to find the device would start at /dev/sda all the way to however many SCSI emulated or SCSI drives you have. it's usually the last one.
now, the instructions are very specifically tuned for RedHat people, since not all kernel messages are dumped to the /var/log/messages file. and for those who have fine-tuned their kernel, they might have removed the USB messages altogether. so i would say the instructions will work for stock installations, and milage varies from there on.
--
By sfhuang:
Once you know which dev the drive is, do the following:
mkdir /mnt/flashdrive
mount -t fat /dev/sdb1 /mnt/flashdrive