USB storage devices
This document describes how to use the popular USB memory sticks with Linux. However, it is also valid for other devices such as digital cameras that act as if they were just a USB storage.
Otherwise see Manual mounting below.
- 1 Auto-mounting of USB devices
- 2 Manual mounting
Auto-mounting of USB devices
Getting a kernel that supports usb_storage
If you do not use a custom-made kernel, you are ready to go, for all Arch Linux stock kernels are properly configured. If you do use a custom-made kernel, ensure it is compiled with SCSI-Support, SCSI-Disk-Support and usb_storage. If you use the latest udev, you may just plug your device in and the system will automatically load all necessary kernel modules. Older releases of udev would need hotplug installed too. Otherwise, you can do the same thing manually:
# modprobe usb-storage # modprobe sd_mod (only for non SCSI kernels)
Mounting USB memory
In order to mount the device you need to know the path to the device node, there are at least two ways of finding out:
- if the partition you want to mount has a label search in Template:Filename, if not look in Template:Filename for devices starting with usb, the usable partitions will end with -part#
- running fdisk -l as root lists all available partition tables
- search in the output of Template:Codeline for the kernel device name, you can use Template:Codeline to help you find what you are looking for: Template:Codeline
You also need to create the directory in which you are going to mount the device:
# mkdir /mnt/usbstick
Finally you can mount the device as root with this command (don't forget to replace device_node by the path you found):
# mount device_node /mnt/usbstick
Mounting the USB stick as normal user with mount
If you want non-root users to be able to write to the USB stick, you can issue the following command:
sudo mount -o rw,noauto,async,user,umask=1000 /dev/sda1 /mnt/usbstick
Mounting the USB stick as normal user with Fstab
If you want non-root users to be able to mount a USB memory stick via fstab, add the following line to your Template:Filename file:
/dev/sda1 /mnt/usbstick vfat rw,noauto,async,user 0 0
Now, any user can mount it with:
$ mount /mnt/usbstick
And unmount it with:
$ umount /mnt/usbstick
Mounting the USB stick as normal user using Fstab with flush option
The flush option for mounting vfat has been added since kernel 2.6.19 as a replacement to async. It basically makes data to flush more often, thus making copy dialogs or progress bars to stays up until things are on the disk.  If you would like to utilize the flush option, add the following line to your Template:Filename file:
/dev/sda1 /mnt/usbstick vfat rw,noauto,flush,user 0 0
Mounting the USB stick using UUID
- Every drive creates a UUID (Universally Unique Identifier), these identifiers can be used to track individual drive no matter their device node (ie Template:Filename).
To find the current UUIDs execute:
At this point you should see a list of your system drives and a long strings of characters. These long strings are the uuids.
- Now connect your USB device and wait for a few seconds . . .
- Reexecute blkid
Notice a new device and UUID? That's your USB storage
- The storage likely has a label. If not use the device node path. Execute as superuser:
# blkid | grep YOURLABEL >> /etc/fstab
- Now create an easy to remember directory listing for the device:
# mkdir /media/patriot
- And now edit the last line in Template:Filename from someting like:
/dev/sdd: LABEL="patriot" UUID="E8F1-5438" TYPE="vfat"
UUID=E8F1-5438 /media/patriot vfat user,noauto,noexec 0 0