TonidoPlug running Squeezecenter 

One of the best gadgets I bought recently is a TonidoPlug, the TonidoPlug is based upon the well known SheevaPlug. The SheevaPlug is a 1000 MHz Marvell CPU combined with 512 MB flash, and 512 MB internal RAM. At the size of roughly two cigarette boxes it makes it an ideal home server using just 5 watt. These great hardware specs are combined with a great software package running on top of it. The package is based on Ubuntu 9.04 and lets you choose to use a variety of services (Torrent Client, Photo Gallery, Jukebox, WebsharePro (remote access to your files), Workspace, Thots, Search, Backup and Explorer). It’s really easy to setup and you can easily expand its capabilities.

Being a music lover I use Squeezecenter (also known as Squeezebox Server) for listening to my mp3 collection or internet radio. Before I bought the TonidoPlug, I used an old pc as a Squeezecenter server. The old server was using 300 Watt, made a lot of noise and was never up and runinng when I wanted to listen to my music. It resulted me ending up waiting 5 minutes each time while starting up the old cow. Now things have changed after reading several articles I managed to install Squeezecenter server on my TonidoPlug. In this article I’ll try to walk you through.

Prerequisites (what you need to get it working):

When you first receive you TonidoPlug, read the manual and configure the TonidoPlug as described (which means you need to create an account, change your basic admin password (nosoup4u)). Make sure your TonidoPlug is working properly, logon to it and update if necesarry.

The next thing you need to do is Repartition and Format your External USB drive (or don’t)

1 – Swap partition (1 GB)
2 – EXT3 filesystem (8 GB and make sure it’s flagged bootable)
3 – NTFS data (mp3) storage (rest)

Now you’ve repartitioned and formatted your External USB drive you can hook it up to your TonidoPlug.

Start up Putty and connect to your TonidoPlug.

mount /dev/sda1 /media/usb0

Download the root and modules tar ball from TonidoPlug site and place in the newly created partition:

cd /media/usb0
wget http://www.tonido.com/downloads/plug/rootfs.tar.gz
wget http://www.tonido.com/downloads/plug/modules.tar.gz

Untar the downloaded tar file onto the ext3 partition:

tar zxvf rootfs.tar.gz
tar zxvf modules.tar.gz

Now stop tonido and copy the tonido directory from your existing internal flash disk:

initctl emit tstop
cp -dpr /root/app/ /media/usb0/root/

Now everything is ready. You can unmount the drive and reboot the plug. Leave the USB harddisk on the plug itself. When the plug reboots, it should reboot off the USB drive:

cd /root
umount /media/usb0
reboot

You can ensure that the plug has booted on the external HDD by using the following command:

df -h /

Filesystem                            Size  Used Avail Use%
Mounted on rootfs                8G  669M  2.9G  10% /

You can see that we have booted the plug of the 8GB External USB drive. If you see 512MB then probably you are still booting of the internal flash.

The DHCP client is configured to ignore any DNS servers returned by the DHCP server and use 127.0.0.1 instead, while there is no local DNS server. Consequently, you won’t be able to connect to any hosts by name until you fix this. In order to fix it:

Edit /etc/dhcp3/dhclient.conf and comment out or delete the line “supersede domain-name-servers 127.0.0.1;”.

Run “dhclient eth0”:

dhclient eth0

Try “ping kernel.org” – it should work:

ping.kernel.org

The directory /var/cache/apt/archives/partial which the APT package management system uses lives on a RAM disk, so it gets wiped on every boot. Marvell helpfully included a boot script to recreate the directory, but they not so helpfully failed to make the boot script actually work. Additionally, /tmp and /var/tmp have invalid permissions. To fix these problems: Edit /etc/rc.local. The two insmod commands fail, and because the shell is invoked with the -e flag (see first line of the file), a failing command causes the whole script to exit. Delete or comment out all lines except “mkdir -p /var/cache/apt/archives/partial” and add “chmod 1777 /tmp /var/tmp” before the mkdir. You might also want to add, after the mkdir, a line “/usr/sbin/ntpdate-debian” to automatically sync your clock over the network.

After editing, run “/etc/rc.local” from the command line:

/etc/rc.local

The TimeZone is not set.
To fix it, just execute the following command as root and select the appropriate timezone for you:

dpkg-reconfigure tzdata

Update your OS:

apt-get update
apt-get dist-upgrade
apt-get autoremove

Now check your partitions by typing:

fdisk -l

initialize the swap:

mkswap /dev/sda3

enable swap:

swapon /dev/sda3

If you’ve done everything correctly, swap will be working. You can check by:

cat /proc/meminfo

The next thing to do is to put the swap information in /etc/fstab so that it will enable the swap at boot. Edit /etc/fstab and add the line:

/dev/sda3      none  swap  sw  0  0

Next we’ll install Squeezecenter server:

wget http://downloads.slimdevices.com/SqueezeboxServer_v7.5.1/squeezeboxserver_7.5.1_all.deb
dpkg -i squeezeboxserver_7.5.1_all.deb apt-get -f install

Suggestions for improving this article are welcome, please let me know and drop me a line !