

The “nofail” option allows the boot process to proceed if the drive is not plugged in. Then add the following line at the end : UUID=18A9-9943 /media/usb vfat auto,nofail,noatime,users,rw,uid=pi,gid=pi 0 0 If you want your USB drive to be mounted when the system starts you can edit the fstab file : sudo nano /etc/fstab When you restart your Pi your mounts will be lost and you will need to repeat Step 4. If you are paying attention you will notice the command is “umount” NOT “u nmount”! Step 6 – Auto Mount If you used the fstab file to auto-mount it you will need to use : sudo umount /media/usb Only the user that mounted the drive can un-mount it. You don’t need to manually un-mount if you shutdown your Pi but if you need to remove the drive at any other time you should un-mount it first. Now you can read, write and delete files using “/media/usb” as a destination or source without needing to use sudo. Omitting the “-o uid=pi,gid=pi” would mean you could only write to it using “sudo”. This will mount the drive so that the ordinary Pi user can write to it. To manually mount the drive use the following command : sudo mount /dev/sda1 /media/usb -o uid=pi,gid=pi Now we need to make sure the Pi user owns this folder : sudo chown -R pi:pi /media/usb

Keep it short as it saves typing later on. I’m using “usb” but you can give it whatever name you like. Create a suitable folder : sudo mkdir /media/usb Step 3 – Create a Mount PointĪ mount point is a directory that will point to the contents of your flash drive. You would need to repeat this step if you wanted to use a different device as the UUID would be different. The line will usually refer to “/sda” and in this example it is “sda1”. This will give you an output that should list your drive : In order to find the unique reference (UUID) for your drive run the following command in the terminal : ls -l /dev/disk/by-uuid/ If you are using a mouse and keyboard you will need a decent USB hub at this point. The first step is to plug in your USB stick. It works great with the shiney new Kingston Digital 32GB DataTraveler Micro I’ve just bought myself. So here is my procedure for using USB flash drives with the Raspberry Pi where the Pi user has permissions to use it without needing “sudo”. There are lots of guides already out there but I had a few issues using most of them, mainly due to permission problems. My main goal was to clarify the process by which I could mount standard FAT32 drives and allow the default Pi user read/write permissions. I tend to transfer files from my Pi using FTP but occasionally it is useful to get stuff onto a USB drive. Using them with the Pi is a great way of getting some use out of them rather than letting them gather dust in a drawer. By now many people will have a collection of various devices of varying capacities. Whether you call them USB flash disks, memory sticks, keys or drives they are a useful accessory in the world of computers.
