Tuesday, September 2, 2008

Installing Debian on QNAP TS-209

What to do with a QNAP TS-209? Install a REAL Linux... Install Debian...


I have a QNAP TS-209 at home, but I am not really happy with it. One of my concerns is security. With the firmware I've used (2.0.1 Build 0324T) there was a massive security hole.

The file .ssh/authorized_keys will be overwritten on ach reboot, with an unknown user (admin@Richard-TS209). See authorized_keys oerwritten at reboot.


I am not sure if QNAP has fixed this issue with the new Firmware, but this showed me, that my QNAP is not the device where I've want to store my private data.


Some time ago I've read a Post that Martin Michlmayr is working on a QNAP-Port of debian. See more details abount Martin on his website and on wikipedia.

Now it is possible on an easy way to install debian on your QNAP. See here is Martins description. Read carefully!


I want to show you here my experiences with Debian on my QNAP TS-209


The first step is to create a backup of the original Firmware


cd /share/HDA_DATA/public

cat /dev/mtdblock1 > mtd1

cat /dev/mtdblock2 > mtd2


Save these both files to a USB-Stick or download them to your workstation!


Now download the required installer images


wget http://people.debian.org/~joeyh/d-i/armel/images/daily/orion5x/netboot/qnap/ts-209/flash-debian

wget http://people.debian.org/~joeyh/d-i/armel/images/daily/orion5x/netboot/qnap/ts-209/initrd.gz

wget http://people.debian.org/~joeyh/d-i/armel/images/daily/orion5x/netboot/qnap/ts-209/kernel


Run the following script to write the kernel and the initrd.gz to flash


sh flash-debian


This will take some time...


Writing debian-installer to flash... done.

Please reboot your QNAP device.


When you've rebooted the TS-209, you can login via ssh. The Firmware will configure the IP-Address via DHCP or if no DHCP-Server is available, it will fallback to 192.168.1.100.

ssh installer@192.168.1.238 (Password in install)

Here are the screenshots of the installer
Choose a mirror

Choose your language

I want to use the Manual Parttioning method

After setting up the partitions, creating the Filesystem, the installer start the installation of the base system.
Setting up users and passwords

I just want to install the standard software and configure the system later

It will take some time to install the software

Flash memory will be configured

The installation is complete!

After the reboot you are able to login via ssh...

2 comments:

Greg Kirkham said...

Hello Harry -

I've been combing the net looking for installation options for QNAP or ReadyNAS (and similar) boxes running alternative OS's, preferably FreeNAS. I stumbled onto your blog entry on Debian on your QNAP box.

Maybe you can steer me toward more info an hacking one of these boxes?

Thanks.

harryd said...

Hi Greg,

most and best information about installing Debian on a QNAP Box can be found on Martin Michlmayr page (http://www.cyrius.com/debian/orion/qnap/).
Currently it is not possible to install FreeNAS on a system which is not x86 based (and the QNAP is Marvell/Orion/ARM based).
I would also highly appreciate if it would be possible to install FreeNAS on a QNAP, but this is not in the focus of developer right now.
So IMHO it is the best way to build your own x86 based system (I would prefer a ATOM based system).
Or buy a barebone like NORCO (http://www.norcotek.com/DS-500e.php), VIA ARTIGO (http://www.via.com.tw/en/products/embedded/artigo/a2000/index.jsp) or Tranquil PCs Barebone Server (http://www.tranquilpc-shop.co.uk/)

Regards, harryd71