Auto-Mounting a Partition in Linux (Mint)

last updated Jan 6, 2017

/etc/fstab is a configuration file used to automatically mount devices in particular locations in Linux. Though there are a number of obscure uses for the file, users will most often find it helpful in mounting partitions which have been created after the operating system was first installed.

In my case, I installed a large HDD alongside the SSD that houses my operating system, but found myself manually mounting the HDD’s storage partition every time I restarted my computer.

To get started, open /etc/fstab in your favorite text editor:

sudo nano /etc/fstab

You should be presented with a short, space-delimited text file. At the top of this file, you’ll notice a helpful template for adding new entries:

<file system> <mount point> <type> <options> <dump> <pass>
  • <file system> An identifier for the device. In most situations, something like “/dev/sda2” will work fine.
  • <mount point> The absolute location on your file system where you want to mount the device. “/mnt/abcdefg”, for example. (It is usually considered bad form to make this a directory inside your home directory, as /etc/fstab applies to the entire system, not just your account.)
  • <type> The type of file system present on the device. “ext4” or “ext3” are the most likely candidates, but you can check with your partition tables if you are unsure.
  • <options>, <dump>, and <pass> Advanced options; consult a more detailed manual. May be left blank if they aren’t being used.

From here, simply save the file and restart your computer to test your handiwork.