Even though Ubuntu is pretty good about automatically mounting any new external or internal hard drives, I think one of the things all Linux users should have a little bit of knowledge of is the fstab file. fstab is a config file that contains information about all the partitions & storage devices in your computer. It’s located at /etc/fstab.
Why is this important? It’s nice to be able to mount your drives to wherever you want on your computer, and make sure it mounts to the same place every time you boot. I recently added another external drive to my computer that was from an old Windows computer obviously formatted as NTFS. I had three options: 1) let the drive auto mount 2) reformat the drive as ext3 so Linux could read it natively 3) add a mount point in my fstab file. I chose option 3. Here’s how to do it.
Install the NTFS Configuration Tool
- Go to ‘Applications’ –> ‘Add/Remove’
- Search for ‘NTFS Configuration Tool‘ and install it
- Go back to ‘Applications’ and choose ‘System Tools’ –> ‘NTFS Configuration Tool’
- Put a check in both boxes. If for some reason you can’t and you are unable to mount your NTFS drive at the end of this tutorial, come back to this step and try it again. I was only able to access both options after the drive was added to the fstab file (not sure why). I’m also not sure how important this step is in the latest release of Ubuntu 8.10, but I added it just in case.

Add the Folder You Want As Your Mount Point
I like to mount all of my drives in the ‘media’ folder. So for this example, I’ll be creating a folder called ‘myBook’ inside ‘media’
- Open a terminal and type ‘sudo mkdir /media/myBook‘ (replace ‘/media/myBook’ with wherever you want your mount folder to be)

- Now type ‘sudo chown USERNAME:USERNAME /media/myBook‘ (replace both USERNAMEs with your username, and again, the directory to whatever yours is)
- Next type ‘sudo chmod 777 /media/myBook‘ (766 should also work, and is probably a bit more secure, I’m just lazy and don’t want to deal with permission issues)

Find the Drive You Are Trying to Mount
First Way (a tiny bit harder, but quicker. my preferred method)
- Open the terminal and type ‘sudo fdisk -l‘ (that’s an L like Larry)
- You will see what looks like a bunch of random crap, we’re specifically looking for the drive location (something like /dev/sdb1). You can locate the correct drive by looking for things like the size of the drive and the format.

- So the information I need is /dev/sdh1
Second Way (more graphical, more time)
- Go to ‘Applications’ –> ‘Add/Remove’ and search for ‘gparted’
- You will see something called the Gnome Partition Editor, install it
- After it is installed, go to ‘System’ –> ‘Administration’ –> ‘Partition Editor’ (if you don’t see it, log out and log back in)

- Choose your drive from the top right drop down menu and you’ll find the same information as with the other method, just presented in a nice gui

Edit your fstab file
OK, so we have NTFS configured, our mount folder created and the location of the drive. Next we will actually add our drive to the fstab file.
- Open a terminal window and backup the current fstab file by typing this command: ‘sudo cp /etc/fstab /etc/fstab.bak‘
- Now type ‘sudo gedit /etc/fstab‘ This will open the fstab file for editing.
- At the end of this file, add this line
‘/dev/sdh1 /media/myBook ntfs-3g defaults,locale=en_US.UTF-8 0 0‘
(replace /dev/sdh1 with the info you got above and /media/myBook with the mount folder you created)

- Save and close the fstab file
Test It
You’re officially done, but if you want to test it to make sure everything worked do this.
- Make sure the drive is unmounted by entering into the terminal ‘sudo umount /dev/sdh1‘ (replace /dev/sdh1 with the location of your drive)

- Now type ‘sudo mount -a‘

- This should mount all the drive on your machine that are not currently mounted. If you get an error, check your work to make sure everything is correct.
Conclusion
That’s about it. It seems like a lot of work to do all this and that it would be easier to just let Ubuntu manage your drives, I assure you…it’s not. In the long run, if you start to have many different drives, this is time well spent. Also note that mounting ext3 formatted drives is almost exactly the same. Simply create your mount point and find the location of the drive as above and add this line to your fstab:
‘/dev/sdb1 /media/music ext3 defaults,user 0 0‘
Happy mounting! I don’t think that came out right…
**UPDATE**
Not sure if this is helpful or not, but I figured I would include it anyway. It’s just my actual fstab file pointing out my 2 external and 1 internal drives that I have being mounted.

Copy the code below to your web site.
Related posts:
- Speak & Spell In Ubuntu? Turns out Ubuntu has a seriously weird built in text-to-speech...
- Install Woopra 1.3 RC2 On Ubuntu 9.04 If you’re not familiar with Woopra, it’s an amazing...
- Unable to Lock Download Directory When Updating Ubtunu Sometimes when you’re trying to either use the Update manager...
- How To Kill An Unresponsive Process In Ubuntu While this doesn’t seem to happen near as much in...
- VirtualBox VERR_VM_DRIVER_NOT_INSTALLED (rc=-1908) Error I recently installed the updated kernel in Ubuntu 8.10. Everything...
Related posts brought to you by Yet Another Related Posts Plugin.
blog comments powered by