WD my book live, runs Debian.

Soldato
Joined
22 Dec 2008
Posts
10,370
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:
Soldato
OP
Joined
22 Dec 2008
Posts
10,370
Location
England
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:
Associate
Joined
4 Aug 2009
Posts
187
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.

You've never worked in embedded ;) Changing chips last minute is fairly common, vendor comes up with something cheaper and there you go ARM to PPC move. This can happen even without the product changing name (look at the amounts of chips in the WRT54G router!).

And your right PPC needs a different cross compiler than arm, although GCC caters well for both (there are many models of each saying 'arm' is a bit like saying 'intel').
 
Soldato
OP
Joined
22 Dec 2008
Posts
10,370
Location
England
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:
Associate
Joined
4 Aug 2009
Posts
187
I'm hoping it's 8MByte/s and not 8Mbit/s ;)

Unfortunately most of the embedded chips can't really sustain such high write speeds. What's the CPU load of the chip while doing the copying?

Also remember with 256MB of RAM and copying ~2TB of data, the box will not be able to do any buffered IO like your PC will typically do!
 
Soldato
OP
Joined
22 Dec 2008
Posts
10,370
Location
England
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:
Associate
Joined
4 Aug 2009
Posts
187
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.

Well with a 100Mb/s ethernet, i'm not surprised. Your at 12MB/s max. So with the overhead from doing an scp transfer it's not surprising your going that fast and eating the whole CPU.

Try using rsync, you'll probably manage to max out to 12MB/s on ethernet.
 
Soldato
OP
Joined
22 Dec 2008
Posts
10,370
Location
England
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:
Soldato
OP
Joined
22 Dec 2008
Posts
10,370
Location
England
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.
 
Soldato
Joined
27 Oct 2006
Posts
6,972
Location
London
Thanks Jon that's useful ...

I should have also read the title 'WD my book live, runs Debian' so obviously no optware :rolleyes:

Yep low powered linux server for 24/7 is the golden ticket. The box has 256 meg of RAM too which gives you a lot of headroom.

I've been primarily hacking realtek media players and they typically are running a mips kernel and with the bloated media player app consuming most of the memory I've had to add a usb stick to swap with. Plus with / being ro I had to create a chrooted environment and install all my apps and daemons on that :mad:

What you have here looks like being much easier to hack.

/snip - forgot to read the below gem...

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.

Perfect that is very strong....

What was the number of interrupts like during such transfers. My player spikes badly :/

Eyeing up getting one of these boxes if the idle and load power consumption figures agree with me
 
Last edited:
Soldato
OP
Joined
22 Dec 2008
Posts
10,370
Location
England
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:
Soldato
Joined
27 Oct 2006
Posts
6,972
Location
London
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 :)

Beautiful ... I'm at the 10W figure too.

Considering it's based on debian and your target is arm (what is that almost x86 !) then you shouldn't have much trouble building. Have you tried dumping the kernel config, (kconfig might even be already compiled in) and building your own modules instead ? Maybe they even left the conf in /boot/ ? - You never know !

My mips box by comparison was a nightmare... I found the sources but then had to build the toolchain targeting uclib - LOTS and lots of grrrrrr involved.

btw why not leave ipfilter on your router and or create a vlan for your WD
 
Soldato
Joined
22 Aug 2005
Posts
8,840
Location
Clydebank
While this is great to hear, I wonder why cant a company just make an open verison of this, without all the need for hacking. I'm past the stage of fiddlign with stuff to get functionality. A few years ago I would have been all over this.
 
Soldato
Joined
27 Oct 2006
Posts
6,972
Location
London
While this is great to hear, I wonder why cant a company just make an open verison of this, without all the need for hacking. I'm past the stage of fiddlign with stuff to get functionality. A few years ago I would have been all over this.

Very much agree with you - hacking used to be cool many years ago, then I too grew up.

However now these boxes are getting so cheap and more powerful by the month so what I do is to re-purpose these boxes as a core part of my business.

With regards to a (semi) open platform ... How about sheevaplug ?
http://en.wikipedia.org/wiki/SheevaPlug

Not enough cpu grunt for my needs but still an option for those who still like to play.
 
Soldato
OP
Joined
22 Dec 2008
Posts
10,370
Location
England
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.
 
Soldato
OP
Joined
22 Dec 2008
Posts
10,370
Location
England
/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.
 
Soldato
Joined
27 Oct 2006
Posts
6,972
Location
London
Well I'm very much convinced that it is lenny with probably some unstable packages forced in.

You could always debootstrap yourself a new clean root based on lenny stable - chroot to it and play in there as opposed to being scared on the live filesystem.

I'm currently building debian for my box using the same principal... I've had enough of the optware c*** and this thread inspired me to do it ;)
 
Back
Top Bottom