I have QNAP TS-110 home NAS box installed with Debian Linux 6.0 (Squeeze). Recently it was broken with latest kernel update (I expect all these since it is a Testing branch). I took this opportunity to learn more on recovery of QNAP. Martin Michlmayr maintains nice documents to get the recovery done. It has instructions to restore the image. Thanks, Martin.

To complement this document, I am writing this post. In Martin’s document it is assumed that user has fair knowledge of setting up DHCP and TFTP servers. But I am not so (I am a desktop Linux guy!). Here I am writing complete instructions on recovery process which includes DHCP and TFTP server setup on Ubuntu 10.10 (Beta). The basic purpose of this post is as a reference for myself in future.

The purpose of DHCP server is to allocate IP Address to QNAP server. TFTPD is for transferring recovery image to QNAP.

What is the trouble I faced?

Recently I run “# apt-get update && apt-get upgrade”, which brought new kernel and flashed. After update, I restarted the system. But.. oops.. the system did not come up!!! The status LED blinks RED and GREEN alternatively. I don’t have TTL Serial adapter to get debug console. Right now I don’t even have keyboard and mouse ( I use laptop only ). As a learning process I thought of doing a recovery. Here is how I did it.

Preparing recovery image

Recovery image can be any of the following. You can select as per your requirement. I assume that you have backup of flash partitions in your workstation. In my case it is Ubuntu. So run these command in your workstation.

Case 1. Factory installed QNAP firmware – You should have backed up before installing Debian as explained here.

In this case run the following command to make a recovery image.

$ cat mtd0 mtd4 mtd5 mtd1 mtd2 mtd3 > F_TS-110_qnap

Case 2. Debian Installer – In this also you should have backed up before installing Debian as explained here. And also download linux kernel and initrd images from this debian repository. Run the following commands to create installer image.

$ dd if=kernel of=kernel.pad ibs=2097152 conv=sync

$ cat mtd0 mtd4 mtd5 kernel.pad initrd.gz mtd3 > F_TS-110_di

Case 3. Working Debian System image – In this case, you should have run the following command from running Debian system periodically to create backup of this working Debian linux.

The recovery image file name should start with specific QNAP model number. In my case it is F_TS-110. You can identify your model number with following command.

$ strings mtd4 | grep bootp_vendor_class

In this case I am restoring the Debian installer to start installing Debian again (F_TS-110_di).

Setting up TFTP Server in Ubuntu

I go for quick command to get it done.

$ sudo apt-get install tftpd

$ sudo vi /etc/xinet.d/tftp

Create above mentioned file with below content.

service tftp {

protocol = udp

port = 69

socket_type = dgram

wait = yes

user = nobody

server = /usr/sbin/in.tftpd

server_args = /tftpboot

disable = no

}

$ sudo mkdir /tftpboot

$ sudo chown -R nobody /tftpboot

$ sudo chmod -R 777 /tftpboot

$ sudo service xinetd restart (or) $ sudo /etc/init.d/xinetd restart

Copy the image to be restored (F_TS-110_di) to /tftpboot directory.

Setting up DHCP Server in Ubuntu

Installing the DHCP Server –

$ sudo apt-get install dhcp3-server

Configuring interface – Set the network interface in Ubuntu used for DHCP. In my case it is wireless card, so it is “wlan0”. In wired LAN case it may be eth0, eth1…

$ sudo vi /etc/default/dhcp3-server

I have just configured the follwing in this file.

INTERFACES=”wlan0″

Configuring DHCP server parameters –

$ sudo vi /etc/dhcp3/dhcpd.conf

Ensure that following are set properly apart from other default values – In my case IP Address of Ubuntu is 192.168.0.100. For QNAP, 192.168.0.103 is allocated. Set the subnet and mask value also according to it. Note down the MAC address (00:08:xx:xx:xx:f0 in this case) of QNAP from a sticker behind the server (You can also note down from /var/log/syslog file once DHCP server started. QNAP will send DHCPDISCOVER message to Ubuntu). Enter right filename, which is nothing but our recovery image.

Pushing Debian installer to QNAP

Power on the QNAP server while keep pressing the reset button (at rear side, use small pin to do it). Keep pressing this button after starting the QNAP till you hear two consecutive beeps. If everything goes fine, QNAP should get IP address from DHCP server and fetch debian installer image from TFTP server. It will then write the image on flash and restart itself again. Once it is booted, you will hear a single beep, which indicates that Debian installer is ready. Now connect to QNAP through the SSH terminal with IP address you assigned. Use username as “installer” and password as “install”.

6 comments

Today, I went to the beach front with my kids. I found a sea shell and gave it to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.” She put the shell to her ear and screamed.
There was a hermit crab inside and it pinched her ear.
She never wants to go back! LoL I know this is entirely off
topic but I had to tell someone!

Hello there I am so excited I found your blog page, I really found you by mistake, while I was searching on Google for
something else, Anyways I am here now and would just like to say thanks a lot
for a remarkable post and a all round exciting blog (I also love the theme/design), I don’t have time to go through it all
at the minute but I have saved it and also added in your RSS feeds, so when I
have time I will be back to read a great deal more, Please do keep
up the great work.

Webnomics Technologies is a Web Development and outsourcing company providing affordable design and development services.(Forex Trading ) Webnomics technologies has their expertise in Forex Market and travel industry which provide most latest Forex Trading, Forex Broker and updates. Webnomics Technologies also have etravel services for the one Click Trips booking. Webnomics technologies has a software development department to provide Modern Software.Top Forex Deal, Comparison Forex Markethttp://www.compareforexmarket.com

Follow me

For Firmware Engineers

Digital Design FundamentalsThis is a series of post on Digital Design Fundamentals required for a Firmware Engineer. It includes many basic building blocks used in Hardware (FPGA/ASIC) design. This should help a Firmware Engineer to effectively understand Hardware Micro-architecture documents from Design team.

Featured Sections

DE0-nano FPGAThis section features posts on DE0-nano FPGA Kit based projects. This kit has Cyclone IV E series FPGA with 32MB SDRAM, 40 Pin GPIOs, Accelerometer, AD Converters, built-in LEDs and Switches, etc. necessary to explore the world of FPGA.

GNU/LinuxLinux was originally developed as a free operating system for Intel x86–based personal computers, but has since been ported to more computer hardware platforms. It runs from supercomputers to embedded devices like phone. This section features all hacks.

MSP430 MCUMSP430 is a power efficient Microcontroller from TI, suitable for wearable devices. This section includes posts on eZ430 Chronos and MSP430 Launchpad kit.

Raspberry PiRaspberry Pi is an revolutionary board hackable for any purpose you imagine. Its support for standard linux stack and GPIOs makes it easy to implement any embedded system protocols. It deserves its place right from learning hello world LED programming to Home theatre system building.