The file we interested in is /etc/fstab.
Get UUID of desired partition You want to automount. Simply call blkid as root in terminal:
This will list all Your partitions with their UUIDs.
Create folder in which You will mount desired partition. I prefere /media/FOLDER location for mounting other partitions. Replace FOLDER with desired name.
sudo mkdir /media/FOLDER
Open /etc/fstab in Your favourite text editor and see the picture before Step 1, in this article.
First, enter description for the partition. Do it in comment mode. Put # in front of descrition, so the line will be interpretedlike a comment, not code.
You may notice on the picture, the third line from bottom, some columns:
<file system> <mount point> <type> <options> <dump> <pass>
This will help You to correctly enter all necessary informations in the file. Separate columns with TAB key.
<file system>Partition or storage device to be mounted. Here You can add partition like i.e. /dev/sda2 or You can add UUID like on the picture.
<mount point>Directory (mountpoint) where <file system> is mounted to. In our example - /media/FOLDER
<type>The <file system> type, like ext3, ext4, ntfs, btrfs and so on.
<options>Mount options of the filesystem to be used. See all mount options. Don't be afraid, in almost all cases it'll be defaults.
<dump>Used by the dump utility to decide when to make a backup. If "0", dump will ignore the file system. If "1", dump will make a backup.
<pass>Used by fsck to decide which order filesystems are to be chacked. Possible values are 0,1 and 2. Root filesystem should have the highest priority - 1. Other filesystems should have lower priority - 2. If "0", filesystem will not be checked by fsck.
Well, the line should have look like this:
UUID=your_uuid /media/FOLDER ext4 defaults 0 1
Save the file.
Step 4Open terminal and mount all entered partitions.
sudo mount -a
Then, check if everything went good.
cd /media/FOLDER dir
If You see appropriateitems, everything is OK.
From now on, everytime You start Your system, the partition(s) will be automatically mounted.