Guide to mount a drive in linux (deb/ubuntu) and set to auto-mount at boot.
Make a folder (will be mount point)
Now you can access the drive at /media/data.
Auto-mount at boot
We want the drive to auto-mount at boot. This usually means editing /etc/fstab.
Firstly, it's always best to use the drives UUID. To find the drive's UUID do
Copy the resultant UUID (for your disk) and then open fstab for editing:
You want to add an entry for the UUID and mount point. Below is an example of an fstab file with an entry added for the mount above:
Note: the entry added is the last line.
We always want to test the fstab before rebooting (an incorrect fstab can render a disk unbootable). To test do:
If nothing is returned (e.g. no errors) then you should be good to go.
Unmounting drive with umount
You can unmount drives using umount. For example, to unmount the data drive above mount at
/media/data you would do: