Replacing Apple Time Capsule with QNAP TS-459 Pro

I've been using the QNAP TS-459 Pro+ for about a year now, which is a very nice file server. It has a lot of network services, but it seems to be missing the ones i want. Initially i was thinking of putting a server next to it with the data mounted from the QNAP file server, until i noticed the CPU in the QNAP is about 1.8GHZ, and the firmware is already some sort of unix-flavor. So why not replace the OS with Ubuntu?

Backup the original image

Just to be on the safe side, backup the onboard qnap-image.

dd if=/dev/sdx of=/share/MD0_DATA/onboard_flash.img

Don't forget to download this file to something other than the QNAP server.

Create install disk (using MacOSX)

Download Ubuntu LTS iso from http://www.ubuntu.com/

Install the OS

Network

vi /etc/network/interfaces

auto eth0
iface eth0 inet static
    address 192.168.0.2
    netmask 255.255.255.0
    gateway 192.168.0.1
    dns-nameservers 62.179.104.196 213.46.228.196
    dns-search domain.eu

and activate:

ifdown eth0; ifup eth0

Restore data

If it says inactive, just reboot the server.

Re-attach the disk to the mirror

cat /proc/mdstat

md0 : active raid1 sdb1[2] sdc1[0]
      1953382208 blocks super 1.2 [2/1] [U_]
      [>....................]  recovery =  1.5% (31163712/1953382208) finish=319.7min speed=100204K/sec

Power management

apt-get install lm-sensors
sensors-detect
service module-init-tools restart

Either configure fancontrol manually by running "pwmconfig" or edit /etc/fancontrol: vi /etc/fancontrol

# Configuration file generated by pwmconfig, changes will be lost
INTERVAL=10
DEVPATH=hwmon1=devices/platform/it87.2576
DEVNAME=hwmon1=it8718
FCTEMPS=hwmon1/device/pwm1=hwmon1/device/temp3_input
FCFANS= hwmon1/device/pwm1=hwmon1/device/fan1_input
MINTEMP=hwmon1/device/pwm1=20
MAXTEMP=hwmon1/device/pwm1=60
MINSTART=hwmon1/device/pwm1=150
MINSTOP=hwmon1/device/pwm1=0

Restart to activate:

service fancontrol restart

LCD Panel

Configure the lcd panel like this:

stty -F /dev/ttyS1 1200

And then execute these commands to control the LCD (Switch on, Switch off, Set text in line 1, Set text in line 2):

echo -e "M^\x1" > /dev/ttyS1
echo -e "M^\x0" > /dev/ttyS1
echo -e "M\f\x0 HELLO WORLD 1234" > /dev/ttyS1
echo -e "M\f\x1 HELLO WORLD 1234" > /dev/ttyS1

The text has to be exactly 16 characters.