I think that your question needs two a two-fold answer: firstly on mounting of the device in the filesystem, and secondly on linking a destination location.
Before you start
The following explanations require a terminal program (keyboard shortcut: Ctrl+Alt+t) for typing the commands in.
You will also need a superuser privileges. Typically (as the first user after the fresh installation) you get the privileges by typing sudo
ahead of the command. After that (typically, if you are the first user after the fresh installation) you have to provide your own password before the command runs.
Your hard drive (the "mechanical" disk) needs to be connected to your computer already, and formatted properly with a file system (like ntfs or ext4).
Beware! By changing your fstab file, you work on internals which can stop your computer from booting. This is not a permanent damage, but it will need skill and time to repair. Work with it carefully.
If in doubts about any of the above prerequisite, please ask in the comment.
Mounting the disk at boot-time
Mounting disks in boot-time is made in /etc/fstab
file. For this you need to know either the UUID of your "mechanical" disk or at least it's name in the /dev
directory.
Find the UUID and the name (similar to /dev/sdb5
) of your disk:
ls -l /dev/disk/by-uuid
It will be listed here. Now determine the filesystem. It will be listed in the last column of the appropriate line of
sudo fdisk -l | less
Next, decide on the mount path, and create it:
sudo mkdir -p /media/shareddrv
Knowing the disk's UUID, name, and the file-system type, your configuration line for /etc/fstab
looks like this:
UUID=481aba75-c8a7-4b70-bdc4-fab4de7c1410 /media/shareddrv ext4 errors=remount-ro 0 2
where UUID=481aba75-c8a7-4b70-bdc4-fab4de7c1410
can be something like /dev/sdb5
if you had problems establishing what the UUID is. The part /media/shareddrv
is the location that you have decided on, and ext4
is the partition type, and be different depending on your disk. The rest remains preferably as it is here.
You have to add this entire line to your /etc/fstab
. Since there are many ways to do it, one quite convenient is to use sudo nano /etc/fstab
and to type/paste the line at the end of the file.
Now make your changes work for you: the simpliest way is to RESTART your computer (e.g. sudo init 6
or sudo shutdown -h now
). If all works, you will see your "mechanical" disk and its mount-point after you type: df -h
in the terminal.
Linking the disk in user directories
This part can be done user-after-user, semi-manually. For a user "alice", run:
TMPUNAME=alice; sudo -u $TMPUNAME ln -s /media/shareddrv /home/$TMPUNAME/F
And repeat this for each user. At the end you could unset TMPUNAME
but not necessarily.
I hope all works for you. If you find this mini-tutorial helpful, please upvote my answer and mark it as useful. Thank you! Also ask more questions if something isn't clear or does not work!