28 July 2004

Mounting a USB flash drive

USB flash drives -- the ubiquituous thingies that look a lot like keychains around people's necks nowadays -- are mounted much like SCSI disks in Linux. They are usually detected at boot up or when inserted, provided the proper modules are installed. So:
  1. Make sure the USB storage module is installed:
    # modprobe usb-storage
  2. Once that's done, and your USB drive is recognized, try to look up the device either in dmesg or
    # tail /var/log/messages

    It should be something like "/dev/sda1".

  3. Mount it the usual way:
    # mount /dev/sdax /mnt/<your mountpoint>
  4. Or, if you want to avoid having to sudo every time you access the drive, edit your /etc/fstab to contain the following:
    /dev/sda1 /mnt/usb vfat noauto,rw,user 0 0

    Create a mount directory and chown it, then mount and unmount the drive the normal way.