Mount NTFS Formatted Harddrives In Ubuntu

By Randy Jensen | Dec 26, 2008

Hard Drive NTFSEven 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

  1. Go to ‘Applications’ –> ‘Add/Remove’
  2. Search for ‘NTFS Configuration Tool‘ and install it
  3. Go back to ‘Applications’ and choose ‘System Tools’ –> ‘NTFS Configuration Tool’
  4. 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.
    NTFS Configuration Application

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’

  1. Open a terminal and type ‘sudo mkdir /media/myBook‘ (replace ‘/media/myBook’ with wherever you want your mount folder to be)
    Our new myBook Folder
  2. Now type ‘sudo chown USERNAME:USERNAME /media/myBook‘ (replace both USERNAMEs with your username, and again, the directory to whatever yours is)
  3. 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)
    Adding Mount Folder

Find the Drive You Are Trying to Mount

First Way (a tiny bit harder, but quicker. my preferred method)

  1. Open the terminal and type ‘sudo fdisk -l‘ (that’s an L like Larry)
  2. 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.
    Fdisk Location
  3. So the information I need is /dev/sdh1

Second Way (more graphical, more time)

  1. Go to ‘Applications’ –> ‘Add/Remove’ and search for ‘gparted’
  2. You will see something called the Gnome Partition Editor, install it
  3. After it is installed, go to ‘System’ –> ‘Administration’ –> ‘Partition Editor’ (if you don’t see it, log out and log back in)
    Gparted In Application
  4. 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
    Gparted

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.

  1. Open a terminal window and backup the current fstab file by typing this command: ‘sudo cp /etc/fstab /etc/fstab.bak
  2. Now type ‘sudo gedit /etc/fstab‘ This will open the fstab file for editing.
  3. 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)
    Fstab File
  4. 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.

  1. Make sure the drive is unmounted by entering into the terminal ‘sudo umount /dev/sdh1‘ (replace /dev/sdh1 with the location of your drive)
    Unmount the Drive
  2. Now type ‘sudo mount -a
    Mount the Drive
  3. 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.
My fstab



  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Design Float
  • DZone
  • Ping.fm
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • TwitThis
  • Yahoo! Buzz
Copy the code below to your web site.
x 

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

blog comments powered by Disqus
© 2009 Randy Jensen Online, - PassionDuo WordPress Theme