For this post, we have an external hard drive connected to our Raspberry Pi which is at /dev/sda. We can verify this by looking at the output of the command lsblk:

$ lsblk

NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda           8:0    0  5.5T  0 disk
└─sda1        8:1    0  5.5T  0 part
mmcblk0     179:0    0 29.8G  0 disk
├─mmcblk0p1 179:1    0  2.2G  0 part
├─mmcblk0p2 179:2    0    1K  0 part
├─mmcblk0p5 179:5    0   32M  0 part
├─mmcblk0p6 179:6    0  256M  0 part /boot
└─mmcblk0p7 179:7    0 27.3G  0 part /

Lets create a mount point, which is the directory we’ll be able to access our external hard drive from. We’ve chosen the directory $ /mnt/mothership, which we’ll create by running:

$ sudo mkdir /mnt/mothership

We’ll change the ownership from root, since we ran with sudo, to ourselves by running

$ sudo chown -R p: /mnt/mothership

Lets test out manually mounting the hard drive

$ sudo mount /dev/sda1 /mnt/mothership -o uid=pi,gid=pi

To verify it worked, lets list the contents of the directory

$ ls /mnt/mothership

We should see the output of our disk.

Now lets unmount, so we can setup the automatic mounting at boot.

$ umount /mnt/mothership

To automate the mounting on boot we’ll modify a file $ sudo vim /etc/fstab adding the following as the last row in the file

/dev/sda1 /mnt/mothership ntfs-3g auto,nofail,noatime,users,rw,uid=pi,gid=pi 0 0

Additionally we’ll install a package:

$ sudo apt-get install ntfs-3g

Which allows our NTFS disk drive to be read and written to from the Pi.

To have your fstab file to run without rebooting run $ sudo mount -a

Now your disk should mount to /mnt/mothership automatically on boot!