Thu, 17 Dec 2015
Like my previous installation of Debian on a QNAP device, this one wasn't easy.
Like others, I followed Martin Michlmayr's HOWTO guide, but had enough problems to conclude that something is off in the way 'jessie' handles a flash bootloader and that it'd be better to install 'wheezy'. This would required a slight modification to his wget commands to get the older version of flash-debian.
cd /tmp busybox wget http://ftp.debian.org/debian/dists/wheezy/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-219/initrd.gz busybox wget http://ftp.debian.org/debian/dists/wheezy/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-219/kernel busybox wget http://ftp.debian.org/debian/dists/wheezy/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-219/flash-debian busybox wget http://ftp.debian.org/debian/dists/wheezy/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-219/model sh flash-debian reboot exit
I had to follow the QNAP Firmware Recovery many times. When something went wrong with the Debian install, this was the only choice as I did not save any of my previous flashes anywhere to reload. After a while, I felt confident there wasn't a risk of bricking this unit as it could always be reset back to its initial configuration saved in flash memory. I would always manually load the latest firmware rather than use the automated firmware update which would download it each time and often not work.
Running the manual setup, I set a static IP address. When prompted to configure disks, I opted to configure disks later. SSH access is possible without first configuring disks.
It really help see what was going on during install by monitoring syslog on a secondary SSH connection.
tail -f /var/log/syslog
To begin setting up partitions, I selected 'Guided - Use entire disk', selecting the second partition (/dev/sdb) and choosing to put all files in one partition. When prompted to remove existing RAID partitions, I selected 'yes'. I then setup the first partition (/dev/sda) in exactly the same way. After that, configure software RAID1 with /boot as md0, / as md1, and swap as md2.
When selecting the kernel for the base system, I selected 'linux-image-3.2.0-4-kirkwood'. When prompted to include drivers, I selected 'generic'.
I also found that my old version of PuTTY was unable to connect to the default QNAP SSH server. Upgrading PuTTY to beta 0.66 fixed the issue. It also was necessary to start and stop the SSH daemon inside the QTS Control Panel under Network Services >> Telnet/SSH by unchecking 'Allow SSH connection', clicking 'Apply', and then checking the box and 'Apply' again.
Wireless Networking with D-Link DWA-131
'lsusb' reports the D-Link DWA-131 I bought from Amazon as USB ID 2001:3319.
Bus 001 Device 003: ID 2001:3319 D-Link Corp
which is the REV_E model based on the Realtek RTL8192eu chipset. This driver must be downloaded from D-Link.
cd /usr/local/src mkdir DWA-131 cd DWA-131 wget ftp://files.dlink.com.au/products/DWA-131/REV_E/Drivers/DWA-131_Linux_driver_v18.104.22.168.zip unzip DWA-131_Linux_driver_v22.214.171.124.zip tar zxvf 20140812_rtl8192EU_linux_v126.96.36.199_11320.tar.gz cd 20140812_rtl8192EU_linux_v188.8.131.52_11320/ make make install echo "8192eu" >> /etc/modules update-initramfs -u
My networking requirements for this NAS require that I set up a static IP address on wlan0 that will stay connected to my main subnet and an eth0 that will be configured for a local network. This was a little tricky to configure, since the only way to access the NAS is over ethernet of some kind. If for whatever reason both links were unavailable, I would not be able to access the OS in the NAS. This is how I set it up.
'wpasupplicant' was essential for WPA2 configuration. 'resolvconf' was necessary for getting DNS to work on the wlan0 interface, for some reason.
ip a iwconfig ip addr flush dev wlan0 apt-get -y install wpasupplicant apt-get install resolvconf
My /etc/network/interfaces looks like this:
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # The primary network interface #allow-hotplug eth0 #iface eth0 inet static # address 192.168.13.21 # netmask 255.255.255.0 # network 192.168.13.0 # broadcast 192.168.13.255 # gateway 192.168.13.1 # # dns-* options are implemented by the resolvconf package, if installed # dns-nameservers 184.108.40.206 220.127.116.11 # my-wifi-static auto wlan0 iface wlan0 inet static address 192.168.13.24 netmask 255.255.255.0 network 192.168.13.0 broadcast 192.168.13.255 gateway 192.168.13.1 # dns-* options are implemented by the resolvconf package, if installed dns-nameservers 18.104.22.168 22.214.171.124 wpa-ssid ssid wpa-psk password # my-ethernet-local allow-hotplug eth0 iface eth0 inet static address 10.10.10.2 netmask 255.255.255.0 network 10.10.10.0 broadcast 10.10.10.255 gateway 0.0.0.0