WD my book live, runs Debian.

Soldato
Joined
22 Dec 2008
Posts
10,369
Location
England
Edit: Changing the OP to be somewhat more useful than the original.

This is a very small box, pretty much a just soft mounted hard drive with a plastic shell around it. There is a pcb plugged into the hard drive, the hardware is a 1 GHz Applied Micro APM82181, 256 MB ram. A gigabit nic is the only interface, but what more could we ask for :)

It runs Debian out of the box, comes with ssh access. It starts off running samba, twonky, apache (for a user interface) and with a fairly nasty security hole related to DLNA in some way.

Aptitude (package manager) works out of the box. I've edited /etc/apt/sources.list to the following, removing references to squeeze & experimental. This is intended to decrease the chance of apt-get bricking the device. Lenny is obsolete now, and apt-get upgrade hasn't killed it with the following sources.list so far.

Code:
MyBookLive:~# cat /etc/apt/sources.list
#deb http://ftp.us.debian.org/debian/ lenny main
#deb-src http://ftp.us.debian.org/debian/ lenny main
deb http://mirror.ox.ac.uk/debian/ lenny main non-free contrib
deb-src http://mirror.ox.ac.uk/debian/ lenny main non-free contrib
deb http://security.debian.org lenny/updates main
deb-src http://security.debian.org/ lenny/updates main
#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/ experimental main

Thanks to aptitude, I have rtorrent, rsnapshot and mediatomb installed and behaving themselves. Samba is installed already but slightly unusually set up, shares are defined in a separate file as below. The UI is a bit limited (I wanted read only), so I've set up my one share here.

Code:
MyBookLive:~# cat /etc/samba/overall_share
## BEGIN ## sharename = Public #
[Public]
  path = /DataVolume/shares/Public
  comment = Public Share
  public = yes
  browseable = yes
  writable = yes
  guest ok = yes
  map read only = no
## END ##
## BEGIN ## sharename = Data #
[Data]
  path = /DataVolume/Data/
  comment = 
  public = yes
  browseable = yes
  writable = no
  guest ok = yes
  map read only = no
## END ##

I didn't get on well with twonky, so have removed the service using the somewhat irreversible
Code:
update-rc.d -f twonky remove
It's still installed, as apt-get wasn't involved in installing it in the first place. Apache runs a UI which I'm not particularly interested in, but might want in the future. So I've taken a less extreme approach there, renaming as follows:
Code:
ls rc*.d/* | grep apache
rc0.d/off.K87apache2
rc1.d/off.K60apache2
rc2.d/off.S11apache2
rc5.d/off.S91apache2
rc6.d/off.K88apache2

Crosscompiler up and running as detailed here, so I have modules. loop and fuse so far, netfilter planned. Encfs works exactly as detailed here once loop.ko is installed. Encrypted partitions with luks also works, detailed somewhat further down this page. I can't think of a clever way to remount it after a reboot without storing a keyfile on the device, so probably only of academic interest.

I think that's it so far. I need to somewhat refine my backup of the original OS before playing around much more. In due time it's possible this will evolve into a howto for a £150, 10W headless home server :)
 
Last edited:
Non-x86 chips are difficult for me to tell apart. The link could well be wrong, though if it doesn't have 256mb of ram it'll be going back.

Should find out tomorrow :)

edit: Google'd the chip, it features onboard gigabit and sata controllers, and works with up to 512mb of ram. Intended for sbc applications, so there's a decent chance it is using a ppc after all. Does seem strange if previous versions were something different (I'm assuming arm and ppc aren't the same thing). Cross compiling for it may be interesting though, a previous version by WD used five different cross compilers. Lovely. Found some troubling hints that iptables will be difficult as well.
 
Last edited:
You're quite right there. I haven't tried to make my way around someone else's customised version of linux before either, I'm very grateful that the core is debian. Otherwise I'd be thoroughly lost. apt-get is indeed present, though I'm loathe to update it without a sane backup. I'm trying to work out what the 512k of flash is used for, but have confirmed that it has 256mb of ram, and that it thinks it's a ppc system.

Output of mount
Code:
/dev/md0 on / type ext3 (rw,noatime)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755,size=50M)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
procbususb on /proc/bus/usb type usbfs (rw)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,size=50M)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
tmpfs on /tmp type tmpfs (rw,size=50M)
/var/log on /var/log.hdd type none (rw,bind)
ramlog-tmpfs on /var/log type tmpfs (rw,size=20M)
/dev/sda4 on /DataVolume type ext4 (rw,noatime,nodelalloc)
/DataVolume/cache on /CacheVolume type none (rw,bind)
/DataVolume/shares on /shares type none (rw,bind)
/DataVolume/shares on /nfs type none (rw,bind)
none on /sys/kernel/security type securityfs (rw)
rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)

Need a backup, hmm

Edit: Getting write speeds of around 12MB/s to the root partition, a bit over 100MB/s to the ext4 shared volume. This is writing from /dev/zero. scp at around 8MB/s which I'm fairly certain is down to using a cheap 100/10 switch. On a related note, backing up the current state of the drive is going to take a long time (tonight & tomorrow night I think). Transferring 1850GB of data to it at 8mb/s is close to three days, which is not encouraging.
 
Last edited:
Megabyte indeed, I'm never sure what the correct combination of capital letters is for each.

That's a good question. Currently pushing a 2gb file over scp, and it's using 90% cpu to write at 8.6MByte per second. While this is not encouraging for the box's rated speeds of 100MByte/s, the cpu may be having a hard time with the ssh encryption rather than with the data itself. Setting up ftp / nfs will have to wait until I've backed the system up. The cpu seems to be alright at some things, it did a md5sum on a 6gb file in pretty close to the same time as a first generation atom.
 
Last edited:
The device is definitely not intended to be user serviceable. It's taken 20 minutes to disassemble, and my warranty is void. Internal drive is indeed a generic 2TB green model, 64mb of cache. Starting to backup the existing file system.

^My hope was that at 10Mb/s or so the cpu would be just ticking over. As it wasn't, I'm not expecting 80Mb/s through ssh out of it, even when connected to a gigabit network.

edit: Oh, right. Lenny doesn't like ext4. Nevermind, dd will still cope. The command I'm using to image the drive is
Code:
dd if=/dev/sda conv=noerror,sync bs=32k | gzip -9 > /mnt/data/MyBook_2TB.img.gz
The partitions on this thing are weird. sda1 and sda2 are both flagged as raid, and seem to contain the same data. sda3 is unrecognised by gparted. sda4 is labelled DataVolume, formatted to ext4, and is the default location for pretty much all user data.

I've tried to add a user through the web interface to run backup scripts, and it refused to accept the name backup. It also refused to let me change permissions on the Public mount. So I'm going to add my backup user in the traditional fashion instead.

The plan is to image the drive, then try to get backups / rtorrent /iptables working, and only then to put it back in the case. I don't want to have to remove it from the case again. So, lets see how this goes. Backup took a good six hours, left me with a 3.5gb image.

Altering the bootup scripts without paying attention is unwise, as a network-only nas which wont boot far enough to bring ethernet up is difficult. Good thing it isn't in the enclosure at the moment.

Samba shares are defined in /etc/samba/overall_share. Without editing this, read-only isn't possible. With editing it, well, it's samba. All is good. Rtorrent is installed, starts itself up when the box turns on, watches a folder and generally behaving itself. As a nice addition, the led will light up in pretty much whatever colour you wish. Blue/green/red all work.
 
Last edited:
Bugger optware and ipkg, I'll stick with aptitude. The 2gb root partition is huge :)

It has some things from squeeze installed (ext4 support for one thing), but mostly it's just a lot of custom configuration files. I can't find the kernel though, which is weird. The bootloader doesn't make a great deal of sense either. I'm starting to suspect the kernel & loader are placed on the 512k of flash, which the internet says is there but I haven't managed to find yet. To most intents though, it's a standard debian install.

Qualitatively the processor looks pretty good and I'm yet to go over 50% ram use. It's never going to cope with ssh encrypted data transmission at 40MB/s though. Iperf isn't going to tell either of us anything useful as it's on a 100MBit network, and it'll push data through scp at 11-12MB/s quite happily (at around 90% cpu usage). I need a faster switch before the arm chip is the bottleneck. Other peoples benchmarks suggest that 50MB/s over nfs is achievable, which is close enough to the limits of the internal hard drive that I'm happy with it.

My emphasis here is more on installing and configuring software which it's useful to run 24/7 than on raw performance, as I can't test raw networking performance. I agree this is an oversight, and shall see what form of benchmarks I can run on it in the near future.
 
256mb of ram and an 800mhz cpu of some description looked to be well worth a go. The mips kernel is probably as friendly as the ppc one, read only root sucks badly though. This thing sort of is a media player, or at least it's marketed as being dlna compatible and they've bought a twonky licence for each device. I need to remember to check resource usage whilst streaming.

So far, it hasn't skipped or jerked while streaming, and scp holds steady at 10MB/s. Seems pretty consistent. It's quite happy streaming, running rsync and rtorrent at the same time (I'm fairly sure rsync throughput suffers under these conditions).

Installing Debian software is near-trivial, installing a kernel module may not be. Do you happen to know where I can get the 2.6.32.11-svn21605 sources? Or for that matter whant the svn21605 bit means. I've asked WD for a copy (and posted on Debian's forums), so perhaps that'll bear fruit. I want netfilter running really, a home server without a firewall or any of the traffic shaping which comes with it doesn't seem right.

edit: 10W load power consumption is rather good. I make it less than a tenner a year in electricity :)
 
Last edited:
I think its easier to release closed code from a support perspective. Hopefully wd will forward me the source regardless. Sheevaplug looked good until i read their forums. Lots of dead plugs :(

Doesn't seem to be anything i can use in boot. Can't find many modules either, though those i have found were probably built with gcc 4.2.2. I'm digging through /proc looking for clues. It was built by steveh, but no config in sight. I'll look into kconfig this evening, man kconfig gave me naught.

Why iptables? I suppose I dont like the idea of a network device without a firewall. Particularly one running ssh which i'd like access to when away from home.

Are there any files you'd like a copy of? Try before you buy as it were.
 
/proc/version contains Linux version 2.6.32.11-svn21605 (steveh@steveh-desktop) (gcc version 4.2.2) #1 Fri Oct 15 17:13:23 PDT 2010

While finding 2.6.32.11 isn't much of a problem, all I've got on the latter part is that svn probably stands for subversion. I believe it refers to some patches applied, but I don't know which ones. The system believes it's Debian 5.0.8, but as there were unstable repo's added I don't put much faith in that.

As far as I know, for building and then inserting a module to work, it has to be built from very similar source code to the kernel itself. Quite how things are going to work if the kernel is currently residing on read only flash I don't know.
 
I have source! Happy days. WD support got back to me, with a concise email and a link to their website. Where the source is available. If I'm honest, I hadn't thought to look there. Link

Uboot is explained, a link is given to a cross compiler with directions, and the kernel source is included. Rebuilding a module shouldn't be too hard from this point.
 
Well, it's knackered. Somewhere along the road stability was compromised. I'm partway through the recovery process, mostly posting to note my anger that the ext4 volume has been created with a generally-unreadable blocksize of 65536.
 
So: if anybody were to clue me up regarding the boot process, how to use uBoot to install a custom kernel, and what to do if the install fails and the boot hangs, I will post a WD MyBook Live Disk Encryption HOWTO. ;-)

I'm still working on modules. Someone's beaten me to it though, see here for a guide. menuconfig is running into dependency problems and make 44x/apollo_3G_nas_defconfig isn't going too well either.

I read someone was able to open the WB MyBook live.. I'd like to do but how (without broke something?)
thank you in advance!
regards

They're a much more careful man than I am if so. There's four small plastic clips which allow a snap fit assembly, I suspect for warranty returns they'll pull the casing off and fit a brand new one. As it is, it took me about half an hour to pry the thing apart, and I broke two out of the four tabs. It still fits back together quite securely, sitting on my shelf it's as if I never touched it. The casing doesn't fall off readily either.

@Subliminal changing to x86 looks pretty appealing to me too, it's certainly a faster & easier option. If I can get this damned thing to compile modules (and hopefully stop it using an unreadable ext4 fs) then it'll do pretty much anything I could ask of it. Albeit slowly.

edit; Removed a lot of error codes. I've given up on compiling on the nas and installed a crosscompiler on x86. This seems to be working, in that I have loop.ko built, installed and behaving itself. Next up is working out which of the many netfilter modules I'm interested in.

@John31, which encryption method do you want to get running? Encfs works as soon as loop.ko is compiled, actually I was astonished by how smoothly the linked howto went.

Edit: A summary of dm-crypt setup on this device:

Code:
# 1/ Build the following modules (I'm still crosscompiling from x86)
drivers/md/dm-crypt.ko
drivers/md/dm-mod.ko

# 2/ copy these modules to 
/lib/modules/2.6.32.11-svn21605/kernel/drivers/md/

# 3/ install modules 
/sbin/depmod -a &&  /sbin/modprobe -av dm-crypt dm-mod

# 4/ apt-get install cryptsetup #possibly some other things I already had installed as well

# 5/ Test
head -c 100M /dev/zero > luksfile  # create empty file
losetup /dev/loop0 luksfile        # map luksfile to /dev/loop0
cryptsetup luksFormat /dev/loop0   # create LUKS on loop device
cryptsetup luksOpen /dev/loop0 testing #Open the /dev/loop0 file, call it testing
mkfs.ext2 /dev/mapper/testing  #Make an ext2 filesystem on testing
mount -t ext2 /dev/mapper/testing /mnt/tmp #Mount the device on /mnt/tmp

# 6/ Closing the encrypted volume
umount /mnt/tmp
cryptsetup luksClose testing

# 7/Opening the encrypted volume
losetup /dev/loop0 luksfile #Needed after a reboot
cryptsetup luksOpen /dev/loop0 testing && mount -t ext2 /dev/mapper/testing /mnt/tmp

edit:Not convinced cryptoloop is required, as it's the predecessor of dm-crypt.
 
Last edited:
What do you mean by "see"? I don't know much about *bsd, but google suggests ssh, nmap and ping are all available. ping and nmap should make finding the ip address of the nas straightforward, or you can look in the web interface of your router.

ssh will give you a root shell on the device (password is Welc0me, or possibly welc0me). Debian is different to *bsd internally though, so tred softly.

Once you know the ip address, nfs (network file system) or samba (emulates windows file sharing) are both available to linux and *bsd. Either of these will provide friendly read / write access to the device.

If it's a network issue, rather than directly related to the NAS, the networking section of these boards is pretty good. Wd community forums are useful too, though you have to dig through some rubbish to find anything useful.

I hope that helps a bit. Welcome the forums
 
Hi,

Iirc there are problems with udev if you try the obvious upgrade path, I think it upgrades to squeeze quite happily if you continue with the current kernel and hold back udev. I'm not sufficiently worried about the security of the nas to update to squeeze. You should read this though.

To be honest I haven't got around to trying to use netfilter on the nas. The kernel out of the box wont do it, but I think it's possible with modules. Maybe one of these days :(
 
Back
Top Bottom