Mount USB drive in FSTAB

https://pimylifeup.com/raspberry-pi-mount-usb-drive/

explains it all


in short:

in terminal:

df -h

shows al connected drives.

look for the drive you want to auto mount.

In our case it is /dev/dsb1

sudo blkid /dev/sdb1

make note of the UUID and the TYPE

If the type is ExFat you need to install 2 packages:

sudo apt install exfat-fuse exfat-utils

If the type is NTFS you need to install one package:

sudo apt install ntfs-3g


Now make a directory where to mount the drive:


In our case I make a directory in your home mdirectory:

mkdir /media/usb1


If you make it outside your home directory e.g. in /mnt/usb1 give your user ownership by using this:

sudo chown -R [USER]:[USER] /media/usb1


Now edit fstab

sudo nano /etc/fstab

at the bottom of the file add this line:

UUID=[UUID] /mnt/usb1 [TYPE] defaults,auto,users,rw,nofail,noatime 0 0

or if permissions don't work properly

UUID=[UUID] /mnt/usb1 [TYPE] defaults,noatime 0 0

where [UUID] is the string you got earlier and [TYPE] is ext4 or ExFat or NTFS or whatever file system you have got. and /mnt/usb1 is the mountpoint you created earlier.

Now enter

systemctl daemon-reload

to reload the fstab file and 

sudo mount -a

and the drive should be mounted.