Debian Jessie Stable (8.3.0) on QNAP TS-251+

Debian on QNAP TS-251+
Debian running on a QNAP TS-251+.

I will get right into it.  If you want a quick review of the QNAP TS-251+, skip to the Closing Summary.

I apologize in advance for the poor quality of the pictures and would like to give props to my buddy DM in Montreal for helping me out when I was not prepared. :]

Requirements

  • Monitor with HDMI input (and HDMI cable, duh)
  • USB Keyboard
  • QNAP TS-251+ (I assume other *51 models as well)
  • Debian Jessie amd64 ISO
  • 2 Flash Drives
    1. Debian Installation Media should be at least 1 Gigabyte in size
    2. Flash drive should have at least 600 Megabytes free for factory image
  • Ethernet-based Internet Connection

Media Preparation

Download and write the Debian Jessie amd64 ISO to one of the flash drives.  Something like this generally works, but if you can, use BitTorrent instead;
wget http://cdimage.debian.org/debian-cd/8.3.0/amd64/iso-cd/debian-8.3.0-amd64-CD-1.iso

Once you have the Debian Jessie amd64 ISO downloaded, you should verify it.  This is important to ensure the disk image is both good, as in, not corrupted or altered during the download.  Here’s my session;

~/Downloads$ sha256sum debian-8.3.0-amd64-CD-1.iso
1dae8556e57bb04bf380b2dbf64f3e6c61f9c28cbb6518aabae95a003c89739a debian-8.3.0-amd64-CD-1.iso
~/Downloads$

If we check the SHA256SUMS file, we find the following entry (the first line, to be exact);

1dae8556e57bb04bf380b2dbf64f3e6c61f9c28cbb6518aabae95a003c89739a  debian-8.3.0-amd64-CD-1.iso

For me, in this operating environment, this is enough verification.  If you are using this is any sort of high-security environment, you can take an extra step and verify the SHA256SUMS.sig using PGP.  This will not be covered here.  Sorry newbs.

Once we have our verified ISO, we need to write to a USB Flash Drive. Be sure to check /var/log/syslog for the drive assignment as you plug in the flash drive. Once you have the drive assignment (in this case, it was sdc, YMMV), you can push the Debian ISO directly to the drive. The following is simple and effective.
dd of=/dev/sdX if=Downloads/debian-8.3.0-amd64-CD-1.iso

Assuming there was no errors reported, you should have a bootable Debian 8 ISO on flash drive.

Protect Yo’ Neck (make a backup)

It is a good idea to make a backup of the original factory image just in case you want to restore the original firmware.

Assuming you have already connected the monitor and keyboard and have the unit powered on, you will be greeted with a prompt.  Use the username and password admin .  You will end up a prompt below;

[~] #

In this case, with each bay loaded, I found the onboard 512M flash disk to assigned to /dev/sdc, but yours could vary.   Plug in the second flash disk (not the one with Debian on it).  Once plugged in, use mount to find the mountpoint of the flash drive. It will generally be under /share/external/<SOMETHING>.  Once you know this, you can use the following command to create a full image of the onboard storage as it came from the factory.

dd of=/share/external/DEV3301_1/ts251p-factory.img if=/dev/sdX

Once completed, verify the image is the proper size;

[~] # cd /share/external/DEV3301_1/
[/share/external/DEV3301_1] # ls -altr
drwxrwxrwx    4 admin    administ      4096 Feb 29 11:19 ../
drwxr-xr-x    2 admin    administ      4096 Mar  1 00:46 ./
-rw-r--r--    1 admin    administ 515899392 Mar  1 00:46 ts251p-factory.img

That’s right, about 512 MB in size.

At this point, we should have a Debian ISO on a flash disk and a backup of the QNAP factory image.  If for some reason your image is not good, feel free to contact me for a copy of my image.

Debian 8 Installation

Insert your Debian 8 install USB Flash Drive into one of the USB ports and press the power button on the NAS.  Upon boot, press Delete or F2 to access the BIOS. I had to modify the boot order to specify the Debian 8 Install drive.  Save and exit.

The QNAP TS-251 should boot into the Debian Installer.

Installation of Debian is mostly normal.

IMG_20160229_125807
Debian Installer partition setup on QNAP TS-251+

I was tempted to attempt to install the system on the internal flash disk, however after one attempt, I found the system was unusable, as there was only a few Megs available after the base install.  Instead I decided to place /boot and the MBR on the internal flash and place / on the harddrives (RAID 1).

You are free to partition your system however you like.  In the interest of brevity, you can see my setup in the picture to the right.

When asked to install the bootloader, choose the Internal flash disk (should be your /boot partition).

Once installation is complete, remove the Debian Jessie installation media and reboot the unit.  Login as the user you created during the Debian installation.

Post-Install Tasks

After login you should install the following packages.

apt-get install dhclient openssh-server

Closing Comments

All in all, I am very impressed with the QNAP TS-251+.  I had been using Synology devices and have found them to be lacking in many ways.  We’ll leave it at that.

While I have covered only the install of Debian, I will be making this into a small office, low-power fileserver, designed to provide the same services as OSX Server.  Next up will be installation of Netatalk and TimeMachine backups.

Leave a Reply

Your email address will not be published. Required fields are marked *