Ok, here goes.First of all, let me exlain the problem. The MBL comes with a miserable 256MB of RAM. When all services are enabled (AppleTalk, Web management, Twonky, NFS, Media Server, Samba etc) they require more memory than is available on the box. This causes the Linux kernel to have to swap and degrades performance to the point of making the device unusable. The way to fix the problem is to disable as many services as possible and get to the point where NO swapping occurs. Then the device becomes quite useable and I have seen write speeds of 30-40MB/sec and read speeds of 40-80MB/sec on my Mac with a Gigabit network. The lower speeds are obtained using SMB (Windows file sharing) and the higher ones with AFP (Apple Filesharing Protocol). O have not tested NFS but I would expect it to be even faster.
To do this you MUST be comfortable working with Linux. If this is not your thing, then donāt try this. Just return the device and get your money back. Seriously. Thereās no way I can think of to really fix this without a bit of Linux hacking.
I will post four scripts here. You need to upload them to your MBL device. I put mine in the /root directory. Make them executable (chmod a+x script_name). They do the following:
- rc1.sh will restore your device /etc/rc1.d directory bacjk to its original state.
- rc2.sh will restore your device /etc/rc2.d directory bacjk to its original state. You will use rc1.sh and rc2.sh for any time you want to put things back the way they were (i.e. incredibly slow and painful)
- mac.sh is a script at will disble all services except those that are useful for Macs.
- dos.sh is a script that will set things up for DOS (Windows) boxes.
OK. Deep breath and letās go. First of all, here is rc1.sh
#!/bin/bash
This script will recreate all the symbolic links in /etc/rc1.d for the
WD 2TB MyBook device after I have hacked at the runlevels.
ln -sf /etc/init.d/wdInitEntry /etc/rc1.d/S01wdInitEntry
ln -sf /etc/init.d/purgelogs.sh /etc/rc1.d/S02purgelogs.sh
ln -sf /etc/init.d/ramlog /etc/rc1.d/S02ramlog
ln -sf /etc/init.d/rsyslog /etc/rc1.d/S03rsyslog
ln -sf /etc/init.d/apache2 /etc/rc1.d/S04apache2
ln -sf /etc/init.d/mountDataVolume.sh /etc/rc1.d/S15mountDataVolume.sh
ln -sf /etc/init.d/ifplugd /etc/rc1.d/S20ifplugd
ln -sf /etc/init.d/smartmontools /etc/rc1.d/S20smartmontools
ln -sf /etc/init.d/reset_button_mon /etc/rc1.d/S88reset_button_mon
ln -sf /etc/init.d/rmnologin /etc/rc1.d/S98rmnologin
ln -sf /etc/init.d/wdInitFinalize /etc/rc1.d/S99wdInitFinalize
Now rc2.sh
#!/bin/bash
This script will recreate all the symbolic links in /etc/rc2.d for the
WD 2TB MyBook device after I have hacked at the runlevels.
ln -sf /etc/init.d/wdAppEntry /etc/rc2.d/S01wdAppEntry
ln -sf /etc/init.d/apache2 /etc/rc2.d/S04apache2
ln -sf /etc/init.d/fuse /etc/rc2.d/S11fuse
ln -sf /etc/init.d/mdadm /etc/rc2.d/S12mdadm
ln -sf /etc/init.d/ntpdate /etc/rc2.d/S16ntpdate
ln -sf /etc/init.d/ssh /etc/rc2.d/S16ssh
ln -sf /etc/init.d/monitorTemperature /etc/rc2.d/S17monitorTemperature
ln -sf /etc/init.d/monitorio /etc/rc2.d/S18monitorio
ln -sf /etc/init.d/portmap /etc/rc2.d/S19portmap
ln -sf /etc/init.d/nfs-common /etc/rc2.d/S20nfs-common
ln -sf /etc/init.d/nfs-kernel-server /etc/rc2.d/S20nfs-kernel-server
ln -sf /etc/init.d/samba /etc/rc2.d/S20samba
ln -sf /etc/init.d/sysstat /etc/rc2.d/S20sysstat
ln -sf /etc/init.d/vsftpd /etc/rc2.d/S20vsftpd
ln -sf /etc/init.d/netatalk /etc/rc2.d/S50netatalk
ln -sf /etc/init.d/mDNSResponder /etc/rc2.d/S60mDNSResponder
ln -sf /etc/init.d/upnp_nas /etc/rc2.d/S61upnp_nas
ln -sf /etc/init.d/sudo /etc/rc2.d/S75sudo
ln -sf /etc/init.d/dbus /etc/rc2.d/S79dbus
ln -sf /etc/init.d/avahi-daemon /etc/rc2.d/S80avahi-daemon
ln -sf /etc/init.d/forked-daapd /etc/rc2.d/S84forked-daapd
ln -sf /etc/init.d/twonky /etc/rc2.d/S85twonky
ln -sf /etc/init.d/orion /etc/rc2.d/S86orion
ln -sf /etc/init.d/cron /etc/rc2.d/S89cron
ln -sf /etc/init.d/lltd /etc/rc2.d/S90lltd
ln -sf /etc/init.d/stop-bootlogd /etc/rc2.d/S98stop-bootlogd
ln -sf /etc/init.d/vftd /etc/rc2.d/S98vftd
ln -sf /etc/init.d/wdAppFinalize /etc/rc2.d/S99wdAppFinalize
Now the one for Mac users (mac.sh)
#!/bin/bash
This script will turm off everything except AFP and Time Machine
The result will be a setup suited to most Mac users and will get
the NAS running way faster than it does āout of the boxā.
On my (Gigabit) network I get speeds of just under 40MB/sec on write
and just under 80MB/sec on read.
To put everything back again, use the rc1.sh and rc2.sh scripts.
rm /etc/rc1.d/S03rsyslog
rm /etc/rc1.d/S04apache2
rm /etc/rc2.d/S04apache2
rm /etc/rc2.d/S11fuse
rm /etc/rc2.d/S18monitorio
rm /etc/rc2.d/S20nfs-common
rm /etc/rc2.d/S20nfs-kernel-server
rm /etc/rc2.d/S20samba
rm /etc/rc2.d/S20vsftpd
rm /etc/rc2.d/S61upnp_nas
rm /etc/rc2.d/S84forked-daapd
rm /etc/rc2.d/S85twonky
rm /etc/rc2.d/S86orion
rm /etc/rc2.d/S90lltd
And finally the one for Windows (dos.sh)
#!/bin/bash
This script will turm off everything except SMB (DOS file shares)
The result will be a setup suited to most DOS users and will get
the NAS running way faster than it does āout of the boxā.
On my (Gigabit) network I get speeds of just under 30MB/sec on write
and just under 40MB/sec on read. Your mileage may vary
To put everything back again, use the rc1.sh and rc2.sh scripts.
rm /etc/rc1.d/S03rsyslog
rm /etc/rc1.d/S04apache2
rm /etc/rc2.d/S04apache2
rm /etc/rc2.d/S11fuse
rm /etc/rc2.d/S18monitorio
rm /etc/rc2.d/S20nfs-common
rm /etc/rc2.d/S20nfs-kernel-server
rm /etc/rc2.d/S20vsftpd
rm /etc/rc2.d/S61upnp_nas
rm /etc/rc2.d/S84forked-daapd
rm /etc/rc2.d/S85twonky
rm /etc/rc2.d/S86orion
rm /etc/rc2.d/S90lltd
rm /etc/rc2.d/S50netatalk
rm /etc/rc2.d/S60mDNSResponder
rm /etc/rc2.d/S80avahi-daemon
How to use:
- Copy and paste the scripts into four files. Call them anything you like but I will refer to them as rc1.sh, rc2.sh, mac.sh and dos.sh
- Enable SSH on your device. There are many posts that can tell you how to do this. Google.
- Copy the four scripts to your device. I put them in my /root directory (rootās home) but it really doesnāt matter.
- Login to root on your device
- Run either mac.sh or dos.sh according to what you want.
- Reboot the device (type in reboot (duh))
- Enjoy massively improved performance.
- Use rc1.sh and rc2.sh to put things back the way WD gave it to you (i.e. Slow and painful)
- I would imagine that hitting the reset button might also put things back the way they started but I couldnāt be bothered to try it.
If you have any questions or suggestions for improment (and I know there are many) then by all means post here or just e-mail me at tony at mattheys dot com. I hope this helps you get some more utility out of your device.