How do I setup static mount via /etc/fstab for Linux?

First, run the following command and find the name of the hard drive you wish to use (for example sda2)

lsblk
lsblk

Once you find it, we will now get the Unique ID (UUID) of the hard drive

lsblk -d -fs /dev/<location (example: sda2)>
lsblk -d -fs /dev/<location (example: sda2)>

‌Copy the UUID, as well as the FSTYPE. We’ll need that later.‌ Next, we will create a new directory in the /mnt folder where you want your Storj files to be stored; you can name this directory whatever you would like.

sudo mkdir /mnt/<directory name>
sudo mkdir /mnt/<directory name>

‌Next, we will add our hard drive to the etc/fstab file

sudo nano /etc/fstab
sudo nano /etc/fstab

‌Add the following line at the end of the file:

UUID=<your HD UUID> /mnt/<directory name> <FSTYPE> defaults 0 2
UUID=<your HD UUID> /mnt/<directory name> <FSTYPE> defaults 0 2

‌To save changes, press Ctrl-X, Y, Enter

Once saved, run the following command:

sudo mount -a
sudo mount -a

‌That’s it!‌ If you’d like to confirm, you can run this command again and your new mount point will be updated in the mount column

lsblk -d -fs /dev/<location (example: sda2)>
lsblk -d -fs /dev/<location (example: sda2)>

‌Congrats, you’ve successfully static mounted your hard drive!

Previous
How do I redirect my logs to a file?