Mount a USB flash drive without the device ID
Novell Cool Solutions: Tip
By Curtis Parker
Digg This -
Posted: 6 Dec 2004
You want to mount a USB flash drive, but you don't know what the device ID is.
- On SUSE Professional 9.1, USB flash drives typically show up as /dev/sda1. So the mount command would be: mount -t vfat /dev/sda1 /mnt/usb (be sure to mkdir the /mnt/usb directory first). But on other older versions of SUSE or other Linux distros, the device ID may be different.
- SUSE Professional 9.0 and most newer distros will auto-mount the flash drive. On SUSE Professional 9.1, it will be mounted as "/media/usb-storage-*". The * will be replace by the device serial number.
- To find out what it is for sure, insert the flash drive in the USB port and run this command:dmesg
The output of the "dmesg" command may look something like this:
usb 1-1: new full speed USB device using address 2 usb 1-1: Product: AVB Mobile Drive 2.0 usb 1-1: Manufacturer: Power by USB usb 1-1: SerialNumber: A011916075442 Initializing USB Mass Storage driver... scsi0 : SCSI emulation for USB Mass Storage devices Vendor: AVB Model: Mobile Drive 2.0 Rev: Type: Direct-Access ANSI SCSI revision: 02 SCSI device sda: 2015232 512-byte hdwr sectors (1032 MB) sda: assuming Write Enabled sda: assuming drive cache: write through sda: sda1 Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0 Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0, type 0 usb Mass Storage device found at 2 usbcore: registered new driver USB-storage usb Mass Storage support registered
Note the line: sda: sda1. This lets you know that /dev/sda1 is the device name.
- You can insert this line in the /etc/fstab file: /dev/sda1 /mnt/usb vfat noauto,user 0 0
- "noauto" tells Linux not to mount on bootup because you won't always have the flash drive plugged in when you boot up. To mount the flash drive simply type: mount /mnt/usb
- Linux will find the rest of the parameters in the fstab file and complete the mount.
Note: you should unmount the flash drive before you pull it out:umount /mnt/usb
Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com