Linux Blog

Auto mounting a partition

Filed under: General Linux,Linux Software — at 10:03 pm on Monday, March 26, 2012

It’s been a while. A while since I’ve had to actually had to manually edit the /etc/fstab to automount a partition. So long, that I searched my blog trying to find out how to do it. To my surprise, I’d never actually written one. If I had, I couldn’t find it. Here’s to you, memory:

According to /etc/fstab this is how it’s done

# <file system> <mount point> <type> <options> <dump> <pass>

For those of us that are human, that can mean very little. What you can do, in hopefully slightly more understandable terms is add a line that looks like this:

/dev/sd[a|b|c][x] /mnt/[location] [filesystem] defaults 0 0

What that looks like in my case is:

/dev/sda5 /mnt/sda5 ext4 defaults 0 0

Save, exit and reboot. Hope for the best :)

Disclaimer – I did manage to find the man page for fstab while searching!