Western Digital MyBook World and mounting CIFS

Background

I bought a 500GB WD MyBook World edition with the intention of using it to backup various servers on my network. I did a bit of research and found out that it ran Linux and also had a pretty decent community following; here and here. It isn’t anywhere near what the NSLU2 had (I was planning to purchase an NSLU2 and found out they were no longer in production) but it was still enough to convince me of my purchase. The plan was to mount the servers file systems locally on the MyBook and then use rsnapshot to take snapshots. The MyBook would sit in my cupboard doing its thing each night backing up files.

After purchasing the box it was pretty quick to enable SSH. I hit a brick wall when I tried to compile the CIFS module on the MyBook. It only had GCC 3.4 and the kernel was compiled with GCC 4.1 which would mean the strings wouldn’t match and wouldn’t load itself in. After many, many frustrating hours setting up a cross compiling ARM toolchain on my laptop, I managed to compile the module and eventially loaded it into the kernel.

Doing it yourself

SSH into the MyBook and issue the following commands.

# wget http://files.doylenet.net/linux/mybook/modules/2.6.17.14/cifs.ko

Make the directory for CIFS and copy it accross

# mkdir /lib/modules/2.6.17.14/kernel/fs/cifs
# cp cifs.ko /lib/modules/2.6.17.14/kernel/fs/cifs/

Now we would normally use depmod to add the module to the modules.dep file and find any dependancies that module requires, but the MyBook doesn’t have it installed and I couldn’t be bothered compiling it, so we can add the line that is required manually. Don’t forget the double “>”’s!!! I cannot stress this enough. If you don’t use >> then the entire file will get overwritten and you will brick your MyBook!

# echo "/lib/modules/2.6.17.14/kernel/fs/cifs/cifs.ko:" >> \
# /lib/modules/2.6.17.14/modules.dep

Now use modprobe to load the module into the kernel

# modprobe cifs

Finally we mount the CIFS share using the mount.cifs program (its part of samba). Add /usr/local/samba/sbin into your PATH if you want to use the “mount -f cifs” style, but the way shown below works fine.

# /usr/local/samba/sbin/mount.cifs //server/share /mnt \
# -o username=someuser,password=somepass

That should be it! Remeber to pass the ro (read only) option if you are using this for backup purposes. And remember, I take NO responsibility if you brick your MyBook. This worked for my 500GB MyBook World. I assume it will work for other models but won’t garuntee anything.

Conclusion

It was painful getting this module to compile so it would load cleanly into the kernel. I had a lot of trouble with buildroot (what the MyBook is based off) but eventially found a version that compiled for me. Ill blog a bit later on getting NFS mounted onto the MyBook as well. I’ve got the module ready but I am having a couple of issues getting nfs-utils to compile.

October 18 2008 01:09 am | Uncategorized

25 Responses to “Western Digital MyBook World and mounting CIFS”

  1. Marcel on 12 Jan 2009 at 8:15 pm #

    Thanks a lot.
    Works like a charm!

    Marcel

  2. bernie on 11 Feb 2009 at 9:51 am #

    Thanks man! Just what I was looking for!

    Un saludo
    bernie

  3. hans on 13 Mar 2009 at 7:12 am #

    Thanks a lot,
    was guessing and trying the whole day, but this solution works at one go!

  4. mrduguo on 01 Apr 2009 at 8:01 am #

    Thanks very much!

    You are the only make it working!!

  5. Peter on 21 Apr 2009 at 1:09 am #

    Thanks man, got it working on a 500 and 750GB MBWE.
    You have to load it it time you reboot the machine? Is it an idea to add the line “modprobe cifs” to the post_network_start.sh script?

  6. ryan on 21 Apr 2009 at 1:17 pm #

    Hi Peter

    I don’t think that auto module loading is enabled on the mybook world so you will need to use modprobe. I had a look at where the mybook loads the modules and it looks like it is the inittab. If you choose to add it in the inittab with the others, be careful, you don’t want to break it and brick your mybook. The post_network_start.sh would probably be a *safer* option. Personally, I have a backup script that runs and the first thing it does is modprobe cifs.

  7. Wolfgang Langbein on 08 Jul 2009 at 8:55 am #

    Thanks for your work! Unfortunately it seems that it doesn’t work with firmware 2.00.18 anymore. Can you verify this and hopefully release a solution? This would be a great help! :-) :-)

  8. ryan on 09 Jul 2009 at 1:17 am #

    Hi

    The new firmware most likely runs a new version of the kernel. What is the output of uname -a? This will tell you of the kernel version running.

  9. Wolfgang Langbein on 10 Jul 2009 at 8:24 am #

    The kernel version is the same. Somehow I don’t get it working again…?

  10. tom on 21 Jul 2009 at 9:19 pm #

    Thanks for the clear instruction, and availability of this solution

  11. ed on 27 Jul 2009 at 9:43 am #

    This is really great. Worked in 5 minutes. I am now using a script to copy from my “main NAS” to this MBWE “backup NAS”. Thanks!

  12. markus on 26 Aug 2009 at 1:50 am #

    Hi,

    works realy fine! Thank you for this HowTo.
    Thanks!

  13. Tevfik on 06 Sep 2009 at 9:32 pm #

    Thanks a lot, great work.

    I managed to follow the instructions but I have a problem in mounting the windows shares in windows domain network.

    I am using the command as:
    mount.cifs -o user=username,password=password,domain=domainname //sererip/share/ /mnt/mountpoint

    initially I get the error 13 permission denied, after a while I started get the error message: “Mounting the DFS root for domain not implemented yet, no ip address specified and hostname not found”

    any idea what might be wrong?

  14. ryan on 07 Sep 2009 at 2:18 pm #

    Hi Tevfik

    There are a couple of things you can try. First, are you trying to mount off a DFS share like the error says? Also, maybe try mounting with the username as domain\\username (double backslash is to escape the first backshash). EG mount.cifs -o user=domainname\\username,password=somepass //servername/share /mnt/mountpoint

    Also, does the server support NTMLv1? If you are mounting a Vista/2008 server, by default it will only work with NTMLv2. You can change this using the security policy editor.

  15. Tevfik on 08 Sep 2009 at 5:04 am #

    Hi Ryan,

    I tried your example but still no luck.

    To be honest I just assume that it is DFS share. I tried to use DFSUTIL to get some information about the servers but no luck there either. Server farm is part of our corporate network that is using Active Directory.We are using WD in our department and since it not officially supported by our IT, I cannot get any help from server side :-)

    Is there any hope to connect to DFS share with this version of Samba? If not any possibility to find a proper working version?

    Thank you in advance.

  16. ryan on 08 Sep 2009 at 12:15 pm #

    Hi Tevfik

    DFS support has been in Samba for a while. Version 3 definately does have it. The only other thing that I could really think of is the issue with NTLMv2. Can you verify what OS the servers are running? You could try changing a desktop’s NTLM level to v1 only and test if that can still access the server. If your workstation is part of a domain, then you probably can’t set the policy (group policy will override any local settings regardless). If not, go to Start > Run > gpedit.msc > OK > Computer Configuration > Windows Settings > Security Settings > Local Policies > Security Options > Network Security: LAN manager authentication level. Change this setting to Send LM & NTLM response only and see if you can access the server still (probably a good idea to reboot as well). Remember to change the setting back once you have tested.

  17. Tevfik on 08 Sep 2009 at 5:19 pm #

    Hi Ryan,

    Still no luck. I created a local share in one of the XP workstation and checked from other computers that it is accessible. However WD still gave the same error message “Mounting the DFS root ….”.

    I checked the lan authentication level of the workstation and it is set to “Send NTLM response only”. There must be something else wrong.

    The authentication setting is locked and not editable and I did not wanted to mess with the registery to change it.

    I tried to install samba3 via ipkg but I could not make it work either :-( (

  18. Vic on 21 Sep 2009 at 9:36 am #

    I’m sure it’s a pain, but can you explain how you created your toolchain?

    I’ve tried crosstool and crosstool-ng.

    Crosstool-ng complains about not having glibc-ports-2.3.2, and the earliest glibc-ports i can find is 2.3.5.

    crosstool complains because my gcc is 4.4.1

    I forgot my initial issues with buildroot – i think it didn’t have the base packages either…

    any pointers?

  19. Sree on 25 Sep 2009 at 8:19 am #

    This is a nice add-on! Thanks.

    But, PLEASE Please do share the NFS [nfs.o] module if you do get it to work. That will work wonders for me! Thanks

  20. ryan on 26 Sep 2009 at 3:29 pm #

    Hi Vic

    It has been a while since I setup my toolchain, but I remember that I did use buildroot. I couldn’t get the “official” WD released buildroot to compile, but I had to download a different one from buildroot’s homepage. You might have to get an old version of buildroot that is based on GCC 3.4 (or whatever GCC your MyBook was built on). Try a few different version if you are having issues building it.

    Good luck, I know it took me a while to get it to work.

  21. ryan on 26 Sep 2009 at 3:38 pm #

    Hi Sree,

    I do have the NFS module, but it is useless on its own, you will also need nfs-utils. I had a problem with getting nfs-utils to compile, as it depends on glibc. I suppose it is possible to patch nfs-utils enough to compile it against uClibc if you really want to.

    You can use ssh to copy files from a remote server and this is what I do using rsnapshot. It is slower this way, but for me it is still fast enough to remotely backup overnight. If you get nfs-utils to compile and want the nfs kernel module, let me know.

  22. Sree on 03 Dec 2009 at 10:52 am #

    Hi Ryan,

    While researching this issue with nfs-utils not compiling – I came across a patch that supposedly fixes the issue with uclibc 0.9.28 – perhaps you can give this a shot? You can find the patch here:
    http://dev.gentoo.org/~solar/uclibc/nfs-utils-1.0.6-uclibc.patch

    Read about it here:
    http://projects.linuxtogo.org/pipermail/openembedded-devel/2006-September/000138.html

    Please let me know if it helps at all.

  23. ryan on 21 Dec 2009 at 10:33 pm #

    Hi Sree

    Thanks for your comment. Although I do not really require the ability to mount NFS anymore (as I use SCP), I could perhaps compile the module and the utils if anyone was still wanting them. Thanks for your info into the issue.

  24. christian on 14 Aug 2010 at 5:15 am #

    Hi Ryan,

    I am fighting to build a cross compiler environment to be able to compile the nfs-utils and nfs for the MyBook.
    Do you still have time to do this? would be great if you are able to publish it here on your blog

  25. Ryan Doyle on 18 Aug 2010 at 11:36 am #

    Hi Christian

    Unfortunately my MyBook World died a few months ago. I can give some pointers to getting a cross-compile toolchain setup though. You won’t want to use the buildroot that is available on the WD website as this comes with only GCC3.4. You will need a buildroot that has GCC4.x to be able to build kernel modules as it looks like the kernel for the MyBook was built using GCC4.x (I forget the exact version now and don’t really have a method of checking). Download an older version of buildroot until you are able to get that to compile. It took me quite a few different versions until I could get it to compile correctly.

    Also if it helps, I did build the nfs.ko module needed for the kernel a while back when I was building the cifs.ko module. You will still need nfs-utils but atleast you may not need to compile the kernel module. You can get it here: http://files.doylenet.net/linux/mybook/modules/2.6.17.14/nfs.ko

    Best of luck compiling the rest!

Trackback URI | Comments RSS

Leave a Reply