Accessing my Netgear Stora from Ubuntu
linux
ubuntu
fstab
nas
Like many tech-savy people these days I’ve been thinking about buying a Network Attached Storage device (NAS) for some time but being more into software than hardware I’ve never really understood enough about them to lay down my hard earned cash. Well recently my hand was forced by my external hard drive starting to act up and my girlfriends son filling his 70GB HDD with downloaded Flight Simulator extensions (and god knows what else!). After quizzing the infrastructure guy at work about his thoughts I ended up buying the Netgear Stora enclosure along with a Western Digital Caviar Black 1TB drive (another drive to follow next month). One of the reasons I opted for the Netgear unit was that it stated that it was compatible with Linux (in addition to Windows and Mac). As I run Ubuntu as my current desktop (and server) of choice while the rest of the systems in the house are XP/Vista this seemed to fit the bill nicely. However, as with most products that claim to be Linux compatible, there was no software provided for use on Linux nor was there any documentation. After trawling the forums I find that Netgear back this claim up by stating (something like) “you can access the device and the files via a web interface”, i.e. its compatible with any device with a web browser. Well I’m sorry but that is not acceptable! How do I get my Ubuntu server in the garage to send it’s backups etc when it doesn’t have a GUI let alone a browser? I want to be able to mount the device as a drive just like the Windows systems do – surely that’s not too much to ask (especially since – apparently – the Stora is running a version of Linux itself).
Well, as it happens it is possible to mount and access the Stora as a drive and access it just like any other. With the Stora connected and registered (which needs an internet connection by the way!) and while the Windows systems in the house started chewing up the disk space I started the hunt for informtion.
As is normal with these things, the information is seldom in one place. A clue here and a command line there and slowly but surely I homed in on a solution.
First of all I found a post on the Netgear forums describing the process for connecting a Fedora system to a stora. Good start, if Fedora can do it then surely Ubuntu could too. The problem here was that the process not only used Fedora but KDE and as I use Gnome this was not really useful to me – but as always with forums there’s normally hidden gold in the comments and this was no exception. One of the forum moderators posted a link to a post and explained that it would be simpler to configure fstab to mount the Stora instead – adding that he was more familar with doing this on Ubuntu. The downside is that (apart from the link being down as I type) the configuration didn’t appear to work – not for Ubuntu 10.10 anyway. But all was not lost, looking further down the comments of the original post (to #5) I found a command that did work.
sudo mount -t cifs -o uid=YOUR_UID,gid=YOUR_GID,file_mode=0777,
dir_mode=0777,username=USERNAME,password=PASSWORD
//IP_OF_STORA/FamilyLibrary /media/stora/FamilyLibrary
Command should obviously be on a single line!
To find your UID and GID just run the id command in a terminal window (assuming you are logged in as the correct user!).
Also the /media/stora/FamilyLibrary
folder needs to exist before executing this command or you can change the mount point as required.
So that’s it then – well not quite. This will mount the FamilyLibrary and Ubuntu will display a suitable shortcut on my desktop (or at least, does for me) but it’s not automatic, I’d have to run the command each time I log in – not major issue but then again not a slick solution either. So could I translate that command line into something that I could enter into fstab? Turned out it was easier than I thought 🙂
The format for a fstab entry is
<device><mountpoint><filesystemtype><options><dump><fsckorder>
Just about all of the information I needed was in the mount command above.
device is the path to the stora (in particular, to the root filesystem we want to mount)
mountpoint is where we want to mount the device to the filesystem
filesystemtype is just what it says!
options this is the comma delimited list in the middle of our command
dump is used by a backup utility called dump to decide if a filesystem should be backed up or not
fsckorder is used by the filesystem check utility fsck to determine the order in which filesystems should be checked
So our fstab entry looks like this (should be on one line but split here to fit the screen):
IP_OF_STORA/FamilyLibrary /media/stora/FamilyLibrary cifs
uid=YOUR_UID,gid=YOUR_GID,file_mode=0777,dir_mode=0777,
username=USERNAME,password=PASSWORD 0 0
Add this (with the appropriate values) into fstab and run
sudo mount -a
from the command line and (all things being equal) the drive should mount, a shortcut should appear on your desktop and in the Places menu.
Job done, yes?
Well almost….
While this does work we have our username and password in plain text in file which can be opened by anyone (maybe not updated, but read none the less). If only there was a way to tell fstab to look somewhere else for the username and password …… well as luck would have it there is.
First of all we need to create a hidden file in our /home directory which will contain two lines (one for the username and one for the password).
Fire up your editor of choice (I like nano for this sort of thing)
nano /home/dave/.storacredentials
and enter the following two lines:
username=your_username
password=your_password
Save it (CTRL+o then CTRL+x if you are using nano).
Now open up fstab and replace the username & password options with the following:
credentials=/home/dave/.storacredentials
Run
sudo mount -a
again and the drive should be remounted with the new configuration. If everything goes to plan then your should not really notice very much.
Finally, there is little point in moving your credentials from one file that everyone can access to another – so to ‘secure’ the .storacredentials file we need to configure it so that only root can read it.
chmod 400 .storacredentials
sudo chown root.root .storacredentials
I’ve added another fstab line for my MyLibrary area on the stora by changing FamilyLibrary for MyLibrary – works like a charm 🙂
Comments
Comments are now closed13 responses
This guide was such a godsend to me.
Thank you so so much
I was happy to find this as I too am an Ubuntu user and had been fooled by the Netgear claims about Linux compatability.
Finally got a chance to set up the stora last night, and once the set up was done via the wife’s windows pc, I went to one of my ubuntu machines, and low and behold, there was the stora available via Network/workgroup. I was able to access files, write files, rename folders, and transfer files all around the home LAN. This was working on both Maverick and Natty.I was also able to add the folders as sources in XBMC…. Happy Days!!
So you didn’t need to manually configure your systems at all? If that’s the case then maybe some update or other has fixed the issue our maybe just something on mine caused the problem.
Thanks for taking the time to share your experience.
mount: mount point /stort/FamilyLibrary
does not exist after using your script above. Can anyone tell me what I am doing wrong. Thanks in Advance ChrisThere is a typo in your comment – stort instead of stora, is this your problem?
Hey guys
I have been following this procedure to the tee and can not seem to get the credentials property working at all. I am able to mount the Stora to my machine using the credentials I need but when it comes to using the user name and password on /home/xbmc/.storacredentials I get this message:
sudo mount -a
mount: wrong fs type, bad option, bad superblock on //192.168.1.4/FamilyLibrary, missing codepage or helper program, or other error (for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount. helper program) In some cases useful info is found in syslog – try
dmesg | tail
xbmc@xbmc-HP-Pavilion-XBMC:~$ dmesg | tail
[ 763.809189] CIFS VFS: No username specified
It thinks i have no username or password to look at.
Is anyone running into this problem?
I’ve not come across this but take a look here – http://thinkinginsoftware.blogspot.co.uk/2010/10/cifs-vfs-no-username-specified.html at a post where someone else had a simlar problem.
Does the mount work when you include the username/password within the fstab entry?
Was the stora on you local network or do you have multiple vlan/subnets?
The Stora was in my local network – nothing flash, same subnet etc. I say ‘was’ as I’ve recently replaced it with a Synology Diskstation, the Stora was OK but had a few issues – speed being one of them, paying for more than 5 users another.!
Thank you. This was extremely helpful in mounting my Stora under Ubuntu.
Worked great for setting up my SeaGate GoFlex NAS. It’s perhaps worth mentioning that ‘ 40’ can be user for space in fstab, which might come in handy especially for GoFlex devices, which use creative share names like “GoFlex Home Personal”
Thanks!
I have an issue. I’ve been running my netgear Stora for some years with Ubuntu from say dist 10.04 onwards. On 13.10 now and have always just mounted the drives by entering smb://192.168 etc. All works and it seems to read and write except sometimes it hiccups. A classic situation is while using the backup facility. I’ve configured backup to log into the stora’s backup area, even with a password, I’ve also got it to encrypt the backup but sometimes it hangs. I can get it to hang if I open up files and locate the mounted backup directory, see all the backup files. Doing that will result in backup hanging, the last file has zero bytes and until I log out, remount, delete this file and restart backup it’ll not continue. This is backup No.1 and is taking me ages to complete. I also noted that if a file to be backed up has zero bytes it’ll hang there too.. Is the above or part of the above applicaable to me?
Not sure I can help with this one. I didn’t get any problems like that with my configuration but other issues have forced me to move from the Stora to a Synology NAS system.