Qnap

From miki
Jump to navigation Jump to search

This page is about the QNAP NAS.

TS-21x Recovery Mode

Several methods:

  • QNAP Live CD at [1] (not tried)
  • Manual method at [2]

We'll follow the manual method.

Generate a recovery image from a running system

  1. First generate the flash image. From a running equivalent system (or from a flash backup you made previously):
cat /dev/mtdblock0 /dev/mtdblock4 /dev/mtdblock5 /dev/mtdblock1 /dev/mtdblock2 /dev/mtdblock3 > F_TS-219_debian

Generate a debian install image

  1. Download inirtrd and kernel, and pad the kernel file:
dd if=kernel of=kernel.pad ibs=2097152 conv=sync
  1. Generate the install image
cat mtd0 mtd4 mtd5 kernel.pad initrd.gz mtd3 > F_TS-119P2+_debian

Start recovery mode and download image

(might have to remove the disk for this to work)

  • Start Wireshark, and connect PC to QNAP directly, and start QNAP in recovery mode (basically, remove power plug, press Reset button, power on, and keep pressed for 10sec until 2 beeps).
  • Look into Wireshark log, open the DHCP DISCOVERY request, and look for the Vendor Name string used by the QNAP. This is the prefix that the image must have. In our case we had F_TS-119P2+, so we named the image file F_TS-119P2+_debian
  • First install dhcp3-server. Then edit file /etc/dhcp3/dhcpd.conf:
subnet 192.168.1.0 netmask 255.255.255.0 {
  range 192.168.1.1 192.168.1.100;
}

host ts119 {
    hardware ethernet 00:08:9b:c8:78:0f;
    filename "F_TS-119P2+_debian";
    fixed-address 192.168.1.71;
    next-server 192.168.1.2;
}
  • Install tftpd. By default tftpd run via inet.d, and files are located at /src/tftp:
sudo apt-get install tftpd
sudo cp F_TS-119P2+_debian /srv/tftp/
sudo chmod 777 /srv/tftp/*
  • Restart the dhcpd:
sudo /etc/init.d/dhcp3-server restart
  • Restart the QNAP again in recovery mode. QNAP should start downloading the image (check your linux log files). Flashing shall take 3 to 4min, After 3min, flashing is done, and the QNAP will make 2 short beeps again and restart.

Running Debian Installer after recovery

  • When QNAP restarts, plug it to internet. When boot is done, you can connect to it with SSH. See [3] for detailed instructions.
ssh installer@192.168.1.71             # password is 'install'