Using Western Digital NetCenter with Ubuntu Linux
I bought a Western Digital NetCenter drive in anticipation of switching to Linux not too long ago (wanted a place for multimedia). While Windows had no problem using the shares I set up on the drive, getting it to work in Linux has been a nightmare. After a lot of failed discussions in #ubuntu on the IRC Server, as well as a post on the Ubuntu Forum that went unanswered for a month, I figured out the problems and decided to post my own tutorial so that poor schmoes like me searching for NetCenter-specific information could find it.
Before I go through this, you'll need to see if my goal with the NetCenter is close to your own. Basically, I wanted a place for multimedia on the network, such as mp3s and the like. I wanted to be able to still download stuff using my Linux machine (my main Desktop computer), but then move stuff to the network drive. This meant that I wanted a simple directory somewhere within Linux that behaved as though I had all of my multimedia on the machine itself. In Windows, I'd map my MP3 Share to the Z: drive, so my mp3s were always at Z:\. I wanted it to be similarly simple in Linux.
Preparing the Shares
Step one is to enable NFS on your shares. When you make a share in the NetCenter web admin tool, you must make sure that, for the security settings for your folder, you enable NFS.
I believe the NetCenter comes with some kind of Windows-centric application to manage shares, but I didn't bother with that. Once you find out your NetCenter's ip address, you can simply load that IP in your web browser and find the web admin tool. Make your shares through that.
I'm going to assume you have made a share called MUSIC, and you intend to place all of your mp3s there. I'm also going to assume you are making it a PUBLIC share, rather than password-protected. I'm assuming this because that's what I did, and thus I have no idea how to work with the password-protected shares. I can only assume it's about as painless as simple as working with public shares, which is to say I imagine you're going to want to pull your eyeballs out and eat them if you attempt such a thing.
Mounting in Linux
Almost all of the other tutorials on the web that discuss this kind of thing have you mount your shares using SMBFS. This is an awful idea, because SMBFS apparently has some bug in it. The end-result of this bug is that, if two threads try to access the mount concurrently, the entire mount will freeze, any application reading from it will freeze, and any program that tries to access it again will freeze. This will last a few hours (3 for me) before the share is magically available again. Oh, and if you have other mounts going to the same machine, those will freeze too.
This is particularly frustrating when you are storing MP3 files, because when you scan your library most programs will do so in a threaded manner, thus instantly breaking everything for a good 3 hours or so.
The workaround for this, I found, is to avoid SMBFS entirely and use NFS instead.
First, you need to make a directory for what you will mount to. A lot of people mount this kind of stuff inside /media, so I'll assume you want to as well (I didn't, but whatever).
Type sudo mkdir /media/mp3. This will make an mp3 directory that you will map your MUSIC share to. Now, let's mount it. Let's assume the IP address of your NetCenter drive is 192.168.0.200.
Type sudo mount -t nfs 192.168.0.200:/shares/Main/MUSIC /media/mp3
That should be it. Cd into /media/mp3 and list some files. To unmount it, type sudo umount /media/mp3.
If you wanted to mount with cifs instead, the path would simply be //IP/MUSIC, so you might be wondering what the /shares/Main is for. The Western Digital runs a flavor of linux itself, which is why using NFS is so much better. However, it hides the location of your shares in /shares/volume_name/share_name. This isn't found anywhere in any documentation, and if you send Western Digital an e-mail simply asking "I'm trying to mount using NFS, what's the path to my share on the drive?" they will respond by telling you they do not support Linux. If you respond and tell them you aren't asking about Linux, you are asking about NFS, which the drive clearly supports as there is a checkbox for enabling it for every share you make, they will reply again by telling you they do not support Linux.
Western Digital loses major points with me for how they have handled this situation. It's frustrating enough that they don't support Linux on a network-attached storage device (since the most common use of NAS is enterprise, and a lot of companies run on Linux). but to refuse to help with an actual feature of their device was particularly infuriating. If support is important to you, do NOT buy a Western Digital NetCenter drive. The drive works great once you get it working correctly, but WD will not help you.
Automounting
To make it so that this is mounted when you boot your machine, type sudo gedit /etc/fstab
Then add this line to your file:
192.168.0.200:/shares/Main/MUSIC /media/mp3 nfs rw,user 0 0
Save the file, and do sudo mount -a in a terminal. This should reload the file and mount whatever is there. This will occur automatically when you boot from now on.
You will also notice that an icon appears on your desktop for this drive. I found this bothersome, and if you do as well, simply remove the ",user" from the config line.
Writing to the directory
You may find as you try to move files into the share, that you cannot write. In my case, I moved a lot of files onto the drive from Windows before switching to Linux, so all of my music and multimedia was already on the drive. I discovered I couldn't read any of it or move additional files to existing directories.
The following steps will 1) Make all of the directories writable for EVERYONE on the network 2) Make all of the files readable and writable for everyone on the network and 3) Change the owner of everything on the drive to "root".
This is an extremely permissive way to set up your network share. The reason I provide instructions like this is that, when the WD NetCenter is set to "public", the behavior of the drive is that everyone in windows can read and write to everything on that share. Thus, I am trying to emulate that behavior in Linux. If you want to use a more restrictive permissions scheme, you can go ahead. Feel free to add to these instructions in the comments if that is the case for you.
In any case, the first thing you need to do is set all of the directories on the drive to be read/write/execute for everyone. Type this: sudo chmod -R a+rwX /media/mp3
This will set +rw for everyone, and set the X bit for everyone if it's already set for the user (since directories have this bit set to allow directory listing, the end-effect is that directories will be set correctly). This also sets all files to be +rw, but not +x.
The next thing to do is change the owner. This is mostly for cosmetic purposes: sudo chown -R root:root /media/mp3.
That's it. Your drive should now be usable by you without having to sudo.




















Jake:
Nice! I just ordered the 500GB NetCenter, so this is timely for me.
14 January 2007, 2:02 pmRod:
Jake: you’re using Linux? I thought you were a Mac junkie now ;)
14 January 2007, 3:43 pmSean LeBlanc:
Thanks for the suggestion…however, the drive is going to be (mostly) read-only for mp3 library and NFS has its own issues, IIRC, one being that if you have a network burp, it tends to get flakey. Though to be fair, it’s been years since I’ve re-visited NFS.
BTW, I was having problems with SMBFS under any sort of load at all…like just trying to cp or mv large files across the network - the number of threads didn’t seem relevant, though maybe there was some other process in Ubuntu I’m not aware of doing something that might have added thread(s).
And boy, do I hate it when companies pretend that Linux doesn’t exist - even when they are using it under the hood…ugh. I remember calling AT&T@Home to tell them that their DNS servers were not working (as I could ping known IPs, but could not resolve any domains) and the call proceeds like this:
“Mmmm-hmmm. Sir, could you go to the Start button and…” at which point I cut them off and say I run Linux. They couldn’t get off the phone fast enough, and that’s what is so irritating at times - say “Linux “or “*BSD”, and it’s like Bugs Bunny saying “Abracadabra” to that one character - they shrink and become non-existent support…from that point on, I tried to make sure that I had a Windoze box up and running with their goofy software when calling AT&T@Home, and had circumvented my Linux box doing NAT.
15 January 2007, 9:31 amJake:
Well, currently I have Win, Mac, and an old iBook with both OS X and Ubuntu installed. I figure this will come in handy to make sure all of the above can see and use the NetCenter.
15 January 2007, 7:38 pmJake:
Weird… I don’t even see the option to select NFS when setting up a new share. WTF?
20 January 2007, 1:42 pmAll I get is a Public/Private radio button with password fields shown if I select Private.
At least the Mac seems to not mind the default CIFS/SMB.
Rod:
Jake:
Er. Uhhhhh. Erm.
Well, CIFS works way better than SMB (which is dog shit), so you can basically alter my indstructions.
Esentially you just have to change nfs to cifs and change the path to //IP/ShareName. This works alright, but when I was doing it I wound up having to sudo to copy anything to the NetCenter. It’s better than freezing though, which is what SMB does.
I’m surprised you don’t have checkboxes for nfs and cifs. Maybe all are enabled by default on the new version of the firmware. Did you try following the instructions aside from that bit to see if they work?
20 January 2007, 2:04 pmM:
Thanks for the great instructions. However, now my Windows machine cannot see the shares/Main folder. All it is able to do is show the config folder.Any idea what happened? What can I do to resolve this problem?
24 January 2007, 6:59 pmRod:
M:
I had an extremely similar problem. I set all of my folders to be read/write, and was then shocked to see that Windows couldn’t see anything. Make sure that, for directories, the execute bit is also set. Execute for directories means that you can use ls.
24 January 2007, 7:21 pmM:
So I re-ran the ‘chmod -R a+rwX /media/mp3′ command. Still not able to see the folders in Windows.
24 January 2007, 10:24 pmRod:
M:
Manually do ls -l to see if the permissions for the folders have the execute bit. The way the capital X works, it only sets X on the other two permissions if it’s set on one. If the folder is -rw-rw-rw for some reason, then it’ll stay that way.
25 January 2007, 6:49 amHerman:
Mounting works fine, but automounting is giving me troubles. I added the line to my fstab file:
#192.168.0.6:/shares/Main/scott/Documents /home/scott/documents cifs rw,user 0 0
…but mount -a fails with the message:
mount: wrong fs type, bad option, bad superblock on 192.168.0.6:/shares/Main/scott/Documents,
missing codepage or other error
dmesg | tail gives me the following description of the error:
[17184825.864000] CIFS: UNC Path does not begin with // or \\
[17184825.864000] CIFS VFS: cifs_mount failed w/return code = -22
I’ve searched around a bit without finding any answers. Any ideas?
25 January 2007, 5:56 pmHerman:
Oops. The line in the fstab line only has a # because I’ve commented it out until I get this worked out.
25 January 2007, 5:57 pmRod:
Herman:
You’re using NFS-style path (IP:/shares/Main/sharename) but trying to use CIFS. Did you mean to use nfs?
I noticed I typo’d on the automount line. Where it says cifs, it should say nfs, like so:
192.168.0.200:/shares/Main/MUSIC /media/mp3 nfs rw,user 0 0
I’ve updated this in the post, and I apologize for the mistake.
If you wanted CIFS, you would keep the type of mount (after the /media/mp3) as cifs but change the path from 192.168.0.200:/shares/Main/MUSIC to //192.168.0.200/MUSIC. In your case, CIFS would be:
192.168.0.6/scott/Documents /home/scott/documents cifs rw,user 0 0
and nfs would be
192.168.0.6:/shares/Main/scott/Documents /home/scott/documents nfs rw,user 0 0
26 January 2007, 7:09 amHerman:
Yeah, that was the problem. Thanks!
27 January 2007, 9:45 amM:
Still have the same problem, below is the directory settings
drwxrwxrwx 10 root root 440 2006-10-17 12:36 books
27 January 2007, 4:14 pmdrwxrwxrwx 47 root root 12464 2006-11-05 10:33 books2file
drwxrwxrwx 4 root root 240 2006-12-21 13:37 drivers_files
drwxrwxrwx 8 root root 200 2006-10-19 21:43 music
drwxrwxrwx 3 root root 184 2006-12-07 22:11 My Pictures
drwxrwxrwx 3 root root 312 2007-01-09 23:17 resume
drwxrwxrwx 2 root root 200 2007-01-09 23:17 TaxCut
Absolutely No Machete Juggling » Blog Archive » Saying No To Windows:
[…] Getting my mouse to work correctly has been a pain. Making Ubuntu play nicely with my Western Digital NetCenter was something of a nightmare. Linux can’t seem to handle my KVM switch without disabling my mouse wheel. Every torrent app for Linux is inferior to uTorrent. I’ve definitely dealt with a lot of frustration in Ubuntu - frustration with things that I took for granted when I used Windows. Despite these frustrations, there has been a noticeable lack of something important: a dealbreaker. […]
29 January 2007, 1:57 pmme22:
Just a note for anyone using NFS with the NetCenter:
I couldn’t connect to it without adding the “nolock” flag to the mount options.
My mounting line:
4 February 2007, 11:51 ammount -t nfs 192.168.0.11:/shares/Main/Shared\ Files /mnt/nas -o udp,soft,intr,nolock
bane73:
First off, *THANK YOU* for putting this online… I started having a whole host of issues trying to get my NC working properly with my SUSE box… it now appears to be running correctly with NFS but as one of the posters above mentioned, I also had to use the “nolock” option (thank YOU also for the tip!)
Here’s my fstab line (BTW, I’m running openSUSE 10.2):
192.168.1.100:/shares/BRANDON/BRANDON /zoe/brandon nfs defaults,nolock 0 0
13 February 2007, 10:21 pmPete:
What is maximum filesize for NetCenter? I’ve heard it’s 4Gb.
Can you format NetCenter to EXT2 or EXT3 (in regard of fragmenting problems on FAT32)??
I’m “driving” Suse10.1 on main pc and terminal based linux flavor on my digital sat. reciver so I’m thinking of using NetCenter as video stream storage device (aswell as regular backup device). Transfer speed looks OK, but I’m worried by max filesize & fragmenting on FAT32 filesystem.
14 February 2007, 4:54 amRod:
Pete,
I’ve put files larger than 4GB on the drive. I’m pretty certain the netcenter actually uses ext3 and linux under the hood, though you can’t change anything about it.
14 February 2007, 6:57 ambane73:
Rod, that’s right… though I don’t know what version of *nix is being used, the NC is certainly using some type of journaling filesystem (and, yes, most certainly ext3)… it becomes obvious when the drive starts acting funky and locking up (which it will do a great deal if you are using SMB or even CIFS to some degree (although *MUCH* more stable and more rare, my drive would act funky under CIFS about once/week)… turning the drive off in the middle of a write operation without unmounting it or anything and turning it back on… you can HEAR the drive grinding away for about 5 minutes while it sets about checking itself and it always comes back up stable and in-tact… obviously a FAT32 drive could get lucky from time to time but not consistently as I’ve seen this drive do.
Also, Pete, I don’t know what max file size is but I’m sure it’s larger than 4GB since most likely the drive *IS* using ext3. I would think neither of these 2 issues are a concern.
14 February 2007, 7:40 amPete:
If it’s EXT3 then maximum filesize is…~2000Gb (wiki info).
A bit strange how WesternDigital does not provide that kind of information for this “box” (filesystem and running os). I’ve read in dozen of places that NC is formated as FAT32, and that it can be “transfered” to NTFS! but in read-only mode.
14 February 2007, 2:33 pmThis must be a linux system - ext2 or ext3. Usual linux distros have read only NTFS capability, so when you put all this together - it makes sense! Thanks guys for info!
john:
hi
thanks for this saved me a few days of head banging. btw i didn’t see the nfs [must stop typing NTFS :-)].
jc
1 March 2007, 2:19 pmOberdan Albertoni:
Thanks for the suggestion.
4 April 2007, 3:03 amIf I wanted to use NFS with password is possible ?
By obe.
Tom:
Golden. Your instructions are perfect. Thx!
7 April 2007, 8:05 pmMatt:
(Jake, Tom) No NFS option present? These appeared once I upgraded the firmware. http://support.wdc.com/download/?cxml=n&pid=16&swid=33
7 May 2007, 8:56 amNat:
Don’t know if any one can help. I am looking for away to run my NetCentre as a standalone server for my Roku Soundbridge. Anyone know of anyone who has hacked it to run the firefly media server?
23 May 2007, 12:27 pmLiam:
Thanks! Saved my bacon. Recently converted to Kubuntu and this was driving me mad. Cheers!
30 June 2007, 9:42 ammercurio:
It works!
26 July 2007, 9:15 pmThank you very much, I was nearly hopeless for getting it work properly, but now it really works with NFS in Kubuntu.