Mounting your hard drive in fstab

This tutorial will show you how to mount your hard drives in the fstab file used on all Linux systems.  The following commands were run on Linux Mint 11 but should still work on other systems.

Open up a terminal and type su.  When prompted enter your root password.

Next type gedit /etc/fstab.  This will open up the fstab file which is located in /etc using the text editor gedit.  You should get something which looks like the following:

# /etc/fstab: static file system information.
#
# Use ‘blkid -o value -s UUID’ to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type>  <options><dump>  <pass>
proc            /proc           proc    nodev,noexec,nosuid       0            0
# / was on /dev/sda1 during installation

/dev/fd0   /media/floppy0 auto rw,user,noauto,exec,utf8 00      0
/dev/sdb1       /media/dev/sdb       auto       defaults           0             2
/dev/sdc1       /media/dev/sdc        auto       defaults           0             2


Now the entries that interest us are the final two for sdc1 and sdb1.  These are two internal hard drives that have been added to the system.

Before adding any entries you must first know what the hard drive is called.  Chances are if you are adding a second drive then it will be called sdb1 but to check type fdisk -l (as root).  Once you know you will then need to decide where to mount it.  Linux usually uses the /media directory to mount file systems but the choice is yours.

Once you have the required information copy the entry above for either sdb1 or sdc1 and replace /media/dev with your mount point and sdc1 / sdb1 with the name of your hard disk.  That’s it.  Reboot and your hard drive should now be recognised and mounted at boot.

About the Author

Hi I am Chris Wakefield the owner of ComTech IT Support. I provide Windows and Linux based IT Support, laptop repairs and computer repairs to both business and personal clients in and around Stirling.

For a list of what I can offer you why not visit my website www.comtech247.net where you will find a list of my services, testimonials, blog and much more.

 

This entry was posted in Blog and tagged comtech, fstab, hard drive, how to, linux, mount. Bookmark the permalink.

One comment on “Mounting your hard drive in fstab

  1. Many thanks for taking the time to describe the terminlogy towards the starters!

Leave a Reply

Your email address will not be published.

50,691 Spam Comments Blocked so far by Spam Free Wordpress

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>