Thu, 17 Dec 2015

Debian on QNAP HS-210

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
busybox wget
busybox wget
busybox wget
sh flash-debian

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
tar zxvf 20140812_rtl8192EU_linux_v4.3.1.1_11320.tar.gz
cd 20140812_rtl8192EU_linux_v4.3.1.1_11320/
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
  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
#       netmask
#       network
#       broadcast
#       gateway
#       # dns-* options are implemented by the resolvconf package, if installed
#       dns-nameservers

# my-wifi-static
auto wlan0
iface wlan0 inet static 
        # dns-* options are implemented by the resolvconf package, if installed
        wpa-ssid ssid 
        wpa-psk password 

# my-ethernet-local
allow-hotplug eth0
iface eth0 inet static


powered by Blosxom Valid XHTML 1.0 Strict