How to Hack WD My Book Live
By kumkum on Dec 20, 2011 - Comments: 22 - Today view: 0 - Total view: 2,962
WD My Book Live is network storage installed with Debian Linux operating system. We can setup this device to be our web server at home. Here are the steps how I did it.
SECTION 1
Follow this section 1 if you haven’t upgrade the firmware and you don’t want to use Debian Squeeze. If you just upgraded your My Book Live to latest firmware and you want to use Squeeze, go to Section 2.
1. Activate SSH
Open browser, and go to http://device_ip/UI/ssh and then enable SSH service.
2. Login to SSH
username: root default password: welc0me
3. Backup the system and protect udev update
Backup system:
# dd if=/dev/sda bs=15728640 count=1 | bzip2 > /DataVolume/shares/Public/SDA_MBR_FREESPACE.bz2 # dd if=/dev/sda1 | bzip2 > /DataVolume/shares/Public/SDA1_IMA.bz2 # dd if=/dev/sda2 | bzip2 > /DataVolume/shares/Public/SDA2_IMA.bz2Protect udev update:
# aptitude hold udev
4. Disable load cycle count
Download idle3 tool from http://mybookworld.wikidot.com/local–files/mybook-live/idle3ctl.tar.gz
# wget http://mybookworld.wikidot.com/local--files/mybook-live/idle3ctl.tar.gzExtract, execute and reboot.
# tar zxvf idle3ctl.tar.gz # ./idle3ctl -d /dev/sda # reboot
5. Install mysql-server
Comment out debian squeeze references from packaging list
# sed -ie "s/deb .* squeeze/#&/g" /etc/apt/sources.listUpdate aptitude and install mysql
# apt-get update # apt-get install mysql-server mysql-client php5-mysqlCreate symlink of /etc/init.d/mysql in /etc/rc2.d/ to autostart the mysql server
# ln -s /etc/init.d/mysql /etc/rc2.d/Initialize mysql data dir and create system tables
# mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysqlRestart apache
# /etc/init.d/apache2 restart
6. Create apache virtual host
Go to apache vhost folder:
# cd /etc/apache2/sites-available/Copy current vhost configuration file:
# cp wdnas mywebsiteEdit mywebsite vhost file:
# nano mywebsiteModify to the following:
<VirtualHost *:80> ServerName mywebsite.mooo.com ServerAlias www.mywebsite.mooo.com ServerAdmin webmaster@localhost DocumentRoot /DataVolume/shares/mywebsite/ <IfModule mod_rewrite.c> RewriteLog /var/log/apache2/rewrite.log RewriteLogLevel 0 RewriteEngine On </IfModule> <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /DataVolume/shares/mywebsite/> Options -Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ErrorLog /var/log/mywebsite_error.log LogLevel warn </VirtualHost>Create document root folder:
# mkdir /DataVolume/shares/mywebsiteEnable virtual host file:
# a2ensite mywebsiteRestart apache:
# /etc/init.d/apache2 restart
7. Create your domain mywebsite.mooo.com using free DNS service by afraid.org. Follow this article on step no. 4, 5, 6.
8. Make cron running when in standby mode
Kill monitorio.sh script:
# killall monitorio.sh # nano /usr/local/sbin/monitorio.shComment out the following line:
#/etc/init.d/cron start > /dev/null #/etc/init.d/cron stop > /dev/null
9. You can access your website at http://mywebsite.mooo.com. My Book Live UI also available at http://device_ip
SECTION 2
Use this section if you are just upgrading your My Book Live to latest firmware.
1. Activate SSH
Open browser, and go to http://device_ip/UI/ssh and then enable SSH service.
2. Login to SSH
username: root default password: welc0me
3. Backup the system and protect udev update
Backup system:
# dd if=/dev/sda bs=15728640 count=1 | bzip2 > /DataVolume/shares/Public/SDA_MBR_FREESPACE.bz2 # dd if=/dev/sda1 | bzip2 > /DataVolume/shares/Public/SDA1_IMA.bz2 # dd if=/dev/sda2 | bzip2 > /DataVolume/shares/Public/SDA2_IMA.bz2Protect udev update:
# aptitude hold udev
4. Disable load cycle count
Download idle3 tool from http://mybookworld.wikidot.com/local–files/mybook-live/idle3ctl.tar.gz
# wget http://mybookworld.wikidot.com/local--files/mybook-live/idle3ctl.tar.gzExtract, execute and reboot.
# tar zxvf idle3ctl.tar.gz # ./idle3ctl -d /dev/sda # reboot
5. Install mysql-server
Update aptitude and install mysql
# apt-get update # apt-get install mysql-server mysql-client php5-mysqlCreate symlink of /etc/init.d/mysql in /etc/rc2.d/ to autostart the mysql server
# ln -s /etc/init.d/mysql /etc/rc2.d/Initialize mysql data dir and create system tables
# mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysqlRestart apache
# /etc/init.d/apache2 restart
6. Create apache virtual host
Go to apache vhost folder:
# cd /etc/apache2/sites-available/Copy current vhost configuration file:
# cp wdnas mywebsiteEdit mywebsite vhost file:
# nano mywebsiteModify to the following:
<VirtualHost *:80> ServerName mywebsite.mooo.com ServerAlias www.mywebsite.mooo.com ServerAdmin webmaster@localhost DocumentRoot /DataVolume/shares/mywebsite/ <IfModule mod_rewrite.c> RewriteLog /var/log/apache2/rewrite.log RewriteLogLevel 0 RewriteEngine On </IfModule> <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /DataVolume/shares/mywebsite/> Options -Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ErrorLog /var/log/mywebsite_error.log LogLevel warn </VirtualHost>Create document root folder:
# mkdir /DataVolume/shares/mywebsiteEnable virtual host file:
# a2ensite mywebsiteRestart apache:
# /etc/init.d/apache2 restart
7. Create your domain mywebsite.mooo.com using free DNS service by afraid.org. Follow this article on step no. 4, 5, 6.
8. You can access your website at http://mywebsite.mooo.com. My Book Live UI also available at http://device_ip
Reference: http://mybookworld.wikidot.com/mybook-live
Keywords:
- my book live hack
- mybook live hack
- wd my book live hack
- my book live hacks
- hack my book live
- hacking my book live
- mybook live hacking
- hacking wd my book live
- hack mybook live
- mybook live hacks
Related posts:
Filed Under: Featured • Linux • Networking • Technology • Tips and Tricks • Tutorial

Hi,
Can this be done in an already updated WD MyBook Live 2Tb?
I want to use it to host my web page while I learn to program and to configure PostFix mail server
Hi, elmany. Yes, as long as you can get root login, you can setup your web server on it. Let me know if you need any help.
Is it normal that the 3. step takes over an hour ?
Hi, ubuntu
Yes, it is normal for 800Mhz machine with 256MB RAM to backup and compress 1,2GB of data. It will take an hour.
When I attempt to do the apt-get install mysql-server mysql-client php5-mysql I get the following:
Reading package lists… Done
Building dependency tree
Reading State information… Done
Note, selecting mysql-server-5.0 instead of mysql-server
Package mysql-server-5.0 is not available, but is refferred to by another package.
This may mean that the package is missing, has been obsoleted, or is only available from another source
E: Package mysql-server-5.0 has no installation candidate
Its a MyBook Live 2TB and all the commands prior worked fine. Any ideas on how to get this to work?
It looks like a repository problem.
What is the content of /etc/apt/sources.list file ?
a cat sources.list in the /etc/apt directory yeilds:
deb http://ftp.us.debian.org/debian/ squeeze main
deb http://ftp.us.debian.org/debian/ sid main
deb http://ftp.us.debian.org/debian/ esperimental main
Can I assume that the
sed -ie “s/deb .* squeeze/#&/g” /etc/apt/sources.list
Command (which I did) should have removed the reference to
deb http://ftp.us.debian.org/debian/ squeeze main ?
What should be there in its place ?
Yes. This tutorial is not using squeeze. Don’t do the sed command if you are using squeeze.
I was following the Tutorial exactly. The sources.list file has the three lines above with # in front (Commented out)
Its been a while since I did anything with Linux, so pardon my confusion.
Should there indeed be a non commented line in the sources.list file and if so, what should its contents contain ?
Just remove # character in sources.list file and run apt-get update.
So sorry if my article make a confusion.
Maybe I have to update my article to avoid this problem.
Thanks.
Can somebody send me original vhost configuration file, that was copied on step 6? I lost it
My mail is mr.fomos@gmail.com. Thanks.
Hi, Alex. Vhost file sent. Please check your email.
Hi!
How do I reste MyBook to it’s original state after doing all of this (I am tryin gto learn more about Debian OS etc. hacking).
Also have another question; I got the same error as chkstar when running “apt-get install mysql-server mysql-client php5-mysql”
I took away the # before the three lines in the sources.list file.
It upgraded but I got an error. (will post later)
I can’t access my MyBook via http://www.wd2go.com, is this normal?
I also can’t access my device via wd2go.com.
Having problem in loading Java interface.
I’m using Firefox browser. I haven’t try to use another browser.
Hi, Karl
To revert to original state, you have to download .deb firmware file from http://wdc.custhelp.com/app/answers/detail/a_id/5735 and execute this command:
$ sudo dpkg -i firmware-file.deb
I am not using any of the other features of my 3rd generation MBL except the share creation. I need access to the share through a mapped drive, which has been accomplished in setup, but I also want intranet web access to the share for music and video streaming that needs to be able to see directories and files i.e. ht tp ://192.168.1.100/Media/ to give a listing of files and folders in the media share folder, without any authentication. I am ok with disabling the UI through SSH and only turning it on when needed.
I needed the same thing. This is how I did it.
‘set up a share using UI’
‘go to http://device/UI/ssh to enable ssh’
‘ssh in’
Username root
Password welc0me
cd /etc/apache2/sites-available/
nano webshare
‘add this to the file and save’
ServerAdmin webmaster@localhost
DocumentRoot /DataVolume/shares/
RewriteLog /var/log/apache2/rewrite.log
RewriteLogLevel 0
RewriteEngine On
Options FollowSymLinks
AllowOverride None
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
ErrorLog /var/log/mywebsite_error.log
LogLevel warn
cp wdnas wdnasbakup
cp webshare wdnas
a2enmod autoindex
/etc/init.d/apache2 restart
That’s it. Remember that your share is case sensitive.
That just derped all my code for the webshare file, but it is the same as the tutorial, with the directory pointing to DataVolume/shares/ instead of DataVolume/shares/mywebsite
Got apache and php successfully working (able to display a page with .
However, having trouble with mysql. Specifically, the mysql_install_db command fails with the following:
—–
# mysql_install_db –user=mysql –basedir=/usr –datadir=/DataVolume/www/mysql_data
Installing MySQL system tables…
ERROR: 1 Can’t create/write to file ‘/DataVolume/www/mysql_data/mysql/db.MYI’ (Errcode: 13)
120425 21:42:26 [ERROR] Aborting
120425 21:42:26 [Note] /usr/sbin/mysqld: Shutdown complete
—–
Installation of system tables failed! Examine the logs in
/DataVolume/www/mysql_data for more information.
I checked permissions of mysql_data and the owner is mysql with group root. Attempted setting permissions to 777 with no success.
Any ideas?
Hi, Mark.
Can you check mysql log for any error message?
Maybe can check on /DataVolume/www/mysql_data or /var/log