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.
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)
First thing one need to access storage device is it's identifier assigned by kernel.
Using device node names (/sd*)
This is the simplest way, but assigned name depends on order of insertion. Ways to get node name:
- search in the output of
dmesgfor the kernel device name, you can use
grepto help you find what you are looking for:
dmesg | egrep "sd[a-z]"
- running fdisk -l as root lists all available partition tables
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 is your USB storage
Mounting USB memory
You need to create the directory in which you are going to mount the device:
# mkdir /mnt/usbstick
Mount the device as root with this command (do not forget to replace device_node by the path you found):
# mount device_node /mnt/usbstick
# mount -U UUID /mnt/usbstick
mount does not recognized the format of the device you can try to use the
-t argument, see
man mount for details.
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 gid=users,fmask=113,dmask=002 /dev/sda1 /mnt/usbstick
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 user,noauto,noatime,flush 0 0
UUID=E8F1-5438 /mnt/usbstick vfat user,noauto,noatime,flush 0 0
(see description of user and other options in the main article)
Now, any user can mount it with:
$ mount /mnt/usbstick
And unmount it with:
$ umount /mnt/usbstick