Automount External Drive Raspberry Pi
29 May 2018Automounting 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
- Identify UUID from the external drive, usually
/dev/sda1
sudo blkid
- Create a directory where it will be mounted at
sudo mkdir /media/rasp3tb
- Add root user as a directory owner
sudo chown -R pi:pi /media/rasp3tb
- Edit
fstab
to auto-mount
sudo nano /etc/fstab
- 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