20.12.09

WD MyBook Hacks - The Basics

I recently started to play around with a 1 TB Western Digital MyBook. The aim is to make a versatile online storage and backup solution. I also found that this device can be used as a print server as well which is a plus that we might put to the test later on.

Here I will collect basic knowledge on the device as well a startup guide, while specific hacks will come later on. For putting this post together I highly relied on this wikidot page. I however decided the collect things here because sometimes I felt lost in the huge amount of wiki articles and forum posts and also some hacks are a matter of personal taste.

Upon hooking up the device on the local network, it usually gets IP address by the means of DHCP. It is recommended to supply it with a fixed IP afterward which can be achieved with most of the SOHO routers. If you want to reach the storage from outside of your LAN then it is also necessary to set up a portforward on the router for which you have to refer to the manual of the specific router or the iptables manual.

If the device is on the network, basic settings can be achieved on the web interface by simply putting the IP address of the storage to the address bar of the browser. The default login is "admin/admin". Most of the interesting stuff can be found in Advanced mode :)

I suggest to acquire the latest firmware (web update button) and both disable and unregister Mionet service. The later would be some tool for sharing remote data (except for anything that has an extension of avi, mp3...) but there are way more versatile tools for that including FTP, SFTP rendering this one useless. EDIT: it seems that simply disabling the service on the web interface is not enough. In fact, it periodically respawns. So what needs to be done is the following: From /etc/init.d remove S9M_ionet script, which starts the service upon boot.
In fact, this is not enough either, so the files /usr/mionet/changeNotifySocket and /usr/mionet/bin/cvm also need to be removed or renamed to something else.

Later on we will need to use SSH for customizing the device for which one needs either putty (for Win) or ssh for linux. For the first login the root password is "welc0me" which I strongly suggest to change immediately with the passwd command.

Next, the ipkg package management system needs to be installed. The tutorial can be found here. This lightweight package manager will give us the opportunity to get several hundreds of precompiled packages. One can also compile packages upon installing gcc, but this is way more inconvenient and usually is unnecessary.

Must have ipkg packages:
  • bash (3.2.49-1_arm). Note: for effectively using bash, the shell in /etc/passwd has to be rewritten for each user from /bin/sh to /opt/bin/bash.
  • bash-completion (1.1-1_arm)
  • pciutils (3.0.0-1)
  • usbutils (0.73-3)
  • libusb (0.1.12-1)
  • mc (4.6.2-1) Note: in order to preserve options, create .mc directory in ~. Further tuning includes e. g. coloring.
As ipkg installs everything in /opt, /opt/bin has to be included to the $PATH variable in /opt/etc/profile. For root, one has to include both /opt/bin and /opt/sbin to $PATH in /root/.bashrc and /root/bash_profile. Note: this applies for ipkg itself so in advance of doing so, /opt/bin/ipkg has to be used instead of simply ipkg.

Disabling Twonky Media Server is also a good idea: Like Mionet, it also consumes a great deal of memory and yet not that useful. In fact, instead of a streaming media server, one could always use file sharing and play media on the computer. Obviously this does not apply to consoles and similar stuff.  In order to permanently kill it, I simply renamed the script that starts the service upon boot:
#~: cd /etc/init.d
#~: mv S97twonkyserver /root/S97twonkyserver.old
#~: touch S97twonkyserver
#~: chmod a+x S97twonkyserver

This way we preserved the old startup script in case we need it later on and created a new placeholder file which simply will not do anything. Note that the old script has to be removed from /etc/init.d, otherwise it will run as well.

This was some sort of "must have" part, for specific hacks see the following links (continuously updated):
  1. LED interface
  2. S.M.A.R.T. capability
  3. Print Server
  4. Removing default folder shares
  5. Reading temperature sensors 
  6. Using MRTG

No comments:

Post a Comment