This tutorial explains how to expand your system with another hard drive and add an automatic mounting rule.
Create Partition
First you need to partition your hard drive. The best tool for the job is gparted. If necessary install gparted with
For the use of gparted sudo rights are necessary
As file system choose ext4.
Create a Mount Point
The mount point is a directory from which it is possible to access the content of the hard drive. We recommend a mount point with /media because it’s Ubunutu’s default. For this example /media/MyNewDrive will be our mount point.
Mount Partition
Assuming you want to mount the hard drive automatically each time you boot your computer you need to edit your /etc/fstab. This file contains the necessary information to automate the process of mounting partitions. The syntax of the fstab file is as follows:
Let’s start with the device identifier. Ubuntu recommends to use the UUID of the hard drive you want to mount. The UUID can be displayed with the following command:
The mount point is the folder we created above. The file system type was set when the partition was created before. As
Now we can edit the file. Keep in mind that root rights are necessary to edit file. The line that should be added to /etc/fstab looks like this:
You can check your work by the following command:
Reboot and check if everything worked out properly. If you fucked up something like this will appear.
If that hapens, enter the maintenance mode by pressing enter and edit the /etc/fstab file again.
Alternatively, the previous saved /etc/fstab file can be restored.
To finish up just reboot the computer.