Teacher and coach

How to access an external network drive using Ubuntu

[Editor’s Note: Please be aware that this post is *several* years out of date, and I no longer use Ubuntu so I have not attempted to update it. At least one commenter has suggested that it “contains instructions that could damage your system.” I decided to leave the post up in the hopes that it still contains information that some will find useful, but please don’t use this as your only resource if you’re trying to set up an external drive using Ubuntu.]

The new Netgear N600 router I just bought for my home wireless network works great.  It even has a USB port on the back to which you can attach an external USB hard drive, which every computer on the network can then use as a kind of shared storage space.  And it’s really simple to use, too; you just plug in your external hard drive to the router, type a couple of commands into your computer, and presto!

Actually, it turns out the external drive feature is really simple to use as long as you’re using either a Windows PC or a Mac, because Netgear was kind enough to provide the commands for you to type in for those two systems.  If, however, you’d like to be able to access your new external network drive using your Ubuntu computer, you have to do a little bit of extra googling to figure out the magic commands to type in.  So once you have your hard drive connected to your router, open up a terminal window on your Ubuntu machine and do the following:

1. Install the smbfs package – smbfs is part of a suite of programs called Samba which handles networking type stuff between Unix and Windows systems.  Install it on your Ubuntu machine by entering “sudo aptitude install smbfs” (without the quotes).

2. Create a directory in which to “mount” your external hard drive – I created a directory called public under my media directory, by entering “sudo mkdir /media/public” (without the quotes).

3. Edit the file /etc/fstab – This is a config file your computer reads each time you start it up, and you need to add some lines in it to tell it how to mount your external drive.  Enter “gksudo gedit /etc/fstab” (without the quotes) and at the end of the file add the following lines:

# Mount my Netgear network drive using these parameters
// /media/public smbfs guest 0 0

The # line is just a comment line.  The second line is the important one (and note that there’s a space after “USB_Storage”).  It tells your computer that when it starts mounting all the different things that need to be mounted, there’s something at // (i.e., your external hard drive) that you want to be able to access by going to the directory /media/public (which you created in step #2 above).  The rest is just some parameters used by the mount command.

Apparently “USB_Storage” is some kind of hard-wired name that Netgear gives to whatever USB drive you plug in to your router; it would have been nice if Netgear had mentioned this somewhere in the documentation, but I guess they didn’t think it was necessary.

4. Re-mount your drives – Save your newly updated fstab file, then type “sudo mount -a” (without the quotes) and your computer will mount all your drives again, including your external drive according to the new line you added to your fstab file.

And you should now be able to see your new external drive at /media/public.  Note that there are probably other ways to make this work as well, and if folks more fluent in Ubuntu than I am want to offer additional tips in the comments, please feel free.

Also, many thanks to the authors of these two posts, who provided a lot of the information for this one:


11 Responses to “How to access an external network drive using Ubuntu”

  1. KoenP says:

    Thank you, this was very helpful 🙂

  2. Tommy says:

    Good!that’s just what i am googling

  3. Hello,
    Is this available for Mac?

  4. bledsoe says:

    I know that Ubuntu can be installed on a Mac (though I’ve never done it), and I would guess that you can set up an external network drive in Ubuntu on a Mac as well, though I’ve never done that either.

  5. Eric says:

    Hello. I am trying to do this very thing. I followed the instructions to the letter but no joy. I believe it’s my router. I’m running Xubuntu 13.10 connected to a Zxytel NBG-419N v2 router. At first I was just trying to get my Samsung CLP-620ND Laser Printer to work since it is connected to the USB port on the router but never got that to take. I did however, manage to get it to function using a J45 Ethernet Cable plugged into the router & printer using the following Address. I got that address by accessing the printers network settings and having it print out a detailed report of my network. I’m actually new to Linux but have come a long way in a short amount of time. To be honest, everything is the way I want it. It’s just this final hurtle for me. can anybody offer any advice. I don’t care how it works, just get it to work. By the way, I tried Wine with the Windows drivers but that did not take either. I also have Mac drivers but don’t know of a way to try them.

    Routers local address is

    When the external USB drive is connected directly into my laptop here is some of the data I collected

    TOSHIBA USB 3.5″-HDD (100)

    Here is the command I tried.
    #Mount my ZyXEL network drive using these parameters
    // /media/public smbfs guest 0 0

  6. bledsoe says:

    Hi Eric,
    I wish I could offer some advice, but you’re already beyond anything I’d know to try. Anyone else have suggestions?

  7. Krys says:

    I followed the steps on Cinnamon Mint and receive this error message:
    mount: only root can mount // on /media/public

  8. What VPN do you use personally?

  9. Bob says:

    This article is way out of date and contains instructions that could damage your system.

  10. bledsoe says:

    Thanks for the heads up, Bob! Based on your comment, I added a cautionary note to the post.

  11. BestAdelaide says:

    I have noticed you don’t monetize your website, don’t waste your traffic, you can earn additional bucks every month because you’ve got hi quality content.
    If you want to know how to make extra money, search for: Ercannou’s
    essential tools best adsense alternative


  1. How to use your DD-WRT router for NAS storage - Best VPN.com - [...] In Linux / Ubuntu follow these instructions. [...]
  2. Harmony Banter | How to mount a Netgear ReadyShare external drive - [...] they worked fine. I wanted to record them here for my future reference, but all credit should go to…
  3. Configure DD-WRT router for NAS storage - KLB || InfoSec - […] In Linux / Ubuntu follow these instructions. […]
  4. Ubuntu:How do I access an external hard drive plugged into my router? – Ubuntu Linux Questions - […] have this same router and just figured out how to access an external drive via Ubuntu. I wrote a…
  5. The $100 Super Router – A Definitive DD-WRT Guide - BestVPN.com - […] In Linux / Ubuntu follow these instructions. […]
  6. How to make a NAS with an external hard drive and DD-WRT Router - Best Backups.com - […] Follow this guide. […]
  7. Configure DD-WRT router for NAS storage - KLB TV infoSec - […] In Linux / Ubuntu follow these instructions. […]

Leave a Reply

Your email address will not be published. Required fields are marked *

Powered by WordPress | Designed by Elegant Themes