Mount a USB Drive to a Raspberry PI
I have all these unused, unloved USB drives that I want totally burn out / destroy. So Im putting my website on a USN drive and pointing Apache to this drive. I guess its terminal time.
Find your Drive
ls -l /dev/disk/by-uuid/
Create a Mount Point Directory
sudo mkdir /mnt/usb
PI User Owns this Directory
sudo chown -R pi:pi /mnt/usb
or maybe needed
sudo chmod -R 770 /mnt/usb/
sudo umount /mnt/usb
Auto mount so when you turn your computer off the mount still exist. Open
sudo nano /etc/fstab
Add the following line at the end .
/dev/sda1 /mnt/usb ext4 defaults 0 0
In the examples above I specified “vfat” as the file system of the device as it was formatted as FAT32. If you need to change the file system replace references of “vfat” with “ntfs-3g”, “ext3” or “ext4”.