Automount External Drive Raspberry Pi

Automounting external drive on a Raspberry PI

NOTE: As my hard drive is formatted in ntfs we need to install ntfs-3g

sudo apt-get install ntfs-3g 
  1. Identify UUID from the external drive, usually /dev/sda1
sudo blkid
  1. Create a directory where it will be mounted at
sudo mkdir /media/rasp3tb
  1. Add root user as a directory owner
sudo chown -R pi:pi /media/rasp3tb
  1. Edit fstab to auto-mount
sudo nano /etc/fstab
  1. Add the following line at the end of the document
UUID=<REPLACE_WITH_UUID> /media/rasp3tbl ntfs auto,users,rw,uid=1000,gid=100,umask=0002 0 0

Problems

Some problems found with the auto-mount in Raspberry PI2 that should be solved editing the /mount/cmdline.txt and adding a rootdelay of at least 5 seconds

sudo nano /mount/cmdline.txt
rootdelay=5