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!

Man Pages for commands in this post »



Comment by Ric

March 28, 2012 @ 10:43 am

I’d suggest a better practice is to do a manual

‘mount /mnt/sda5’

as a test before rebooting. If this works then the basic syntax in the fstab is correct, and it’s worth a more thorough test with a reboot. If it doesn’t work you can try again rather than dealing with a machine failing to come up cleanly because mountall is failing.

Comment by

March 28, 2012 @ 12:03 pm

I’d agree that is a better process. For the sake of the post I guess I assume its already mounted :)

RSS feed for comments on this post. TrackBack URI

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>