[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
//192.168.1.1/USB_Storage /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 //192.168.1.1/USB_Storage (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:
http://www.automaticable.com/2008-01-18/how-to-mount-a-network-drive-in-ubuntu/
http://ubuntuforums.org/showthread.php?t=1651160
Thanks for the heads up, Bob! Based on your comment, I added a cautionary note to the post.
This article is way out of date and contains instructions that could damage your system.
What VPN do you use personally?
I followed the steps on Cinnamon Mint and receive this error message:
mount: only root can mount //192.168.1.1/USB_Storage on /media/public
Hi Eric,
I wish I could offer some advice, but you’re already beyond anything I’d know to try. Anyone else have suggestions?
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. 192.168.1.34:9100. 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 192.168.1.1
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)
file:///media/zaboo/WD%202TB
/dev/sdc1
001A3301
Here is the command I tried.
#Mount my ZyXEL network drive using these parameters
//192.168.1.1/USB_Storage /media/public smbfs guest 0 0
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.
Hello,
Is this available for Mac?
Good!that’s just what i am googling
Thank you, this was very helpful 🙂