USB is an Acronym for Universal Serial Bus.

This is a Bus with which peripherals such as mice, keyboards, scanners, KeyDrives, Scanners, Printers, and DigitalCameras etc can be to attached to a computer. USB provides power from the host computer. It also allows devices to be "chained". As a result, instead of having a mess of cables into the back of your computer, you could theoretically have your monitor and printer plugged into the computer, your scanner into the printer, your keyboard and camera into the monitor, and your mouse into the keyboard. So far, this scenario is purely theoretical.

One advantage USB has over some Legacy protocols such as PS/2 is the ability to plug devices in while the system is powered on - see also HotPlug.

Linux-related USB Notes

USB Mass-storage

Many USB devices can be mounted under linux so that it becomes part of your filesystem. Examples include many USB cameras, and USB/flash-based MP3 players/memory sticks.

This requires kernel support. The default kernel you get from your vendor will probably have all the required pre-requisites, but if not, or you compile your own, then in in your kernel, you will need:

  • USB Mass-storage support (CONFIG_USB_STORAGE)
  • SCSI support and SCSI disk support (CONFIG_SCSI, CONFIG_BLK_DEV_SD)
  • Microsoft "VFAT" file system support (CONFIG_VFAT_FS)

With LinuxKernel 2.6.9, you can find the relevant settings in "make menuconfig" as:

  • Device Drivers -> USB -> USB Mass Storage support
  • Device Drivers -> SCSI
  • Device Drivers -> SCSI -> SCSI disk support
  • File systems -> DOS/FAT/NT filesystems -> VFAT

You can check things are working by looking at the dmesg output when you attach a device (and have the modules loaded or compiled in). For example:

usb 1-2.2: new full speed USB device using address 10
scsi2 : SCSI emulation for USB Mass Storage devices
  Vendor: JetFlash  Model: Transcend         Rev: 0100
  Type:   Direct-Access                      ANSI SCSI revision: 02
SCSI device sda: 507392 512-byte hdwr sectors (260 MB)
sda: assuming Write Enabled
sda: assuming drive cache: write through
 sda: sda1
Attached scsi removable disk sda at scsi2, channel 0, id 0, lun 0
USB Mass Storage device found at 10

This shows that a fake SCSI disk has been attached (named "sda"), and it has one partition (sda1) that you can mount.

Once you have the required support, you should find somewhere on your filesystem to mount devices. A good place is "/media/usb":

 # mkdir /media/usb

To let normal user accounts mount devices, add something like the following to /etc/fstab:

 /dev/sda1       /media/usb      auto    defaults,user,noauto,noatime 0 0

Your distribution might come with this already set up, as well as appropriate HotPlug scripts to automatically mount devices when they are connected.