Martin Michlmayr
Martin Michlmayr

I'm a member of Debian, and I work for HP as an Open Source Community Expert. The opinions expressed here are mine.

Subscribe to the RSS feed of this journal.

Fixing your Debian NAS from within initramfs-tools

The following article was contributed by John Cass. Note that John's instructions will also work on other NAS machines running Debian, such as QNAP devices.

I had a problem upgrading my Debian kernel to 2.6.32 on the D-Link DNS-323. The upgrade looked like it worked but on reboot I had a hung machine. I tried taking the disk out, putting it in my main machine and remaking the links in /boot to the previous kernel and initrd.img but it turns out that on the DNS-323 both kernel and initrd are actually stored in flash memory (the /boot disk files are where they are built and a useful archive but are not used during the boot process).

So I was stuck, and had to make a serial cable in order to find out what was going on. The instructions here and here were very useful and the CA-42 clone cost me 4 GBP on eBay and arrived within a couple of days. A delicate bit of soldering (and installing ckermit on my main machine) and I had a serial connection - I could finally see what was was happening.

The upshot was, during the boot process the DNS-323 failed to mount my root partition. This was because the partition was formatted ext3 and the initrd.img had not included the ext3 module. It probably did this because I had deliberately forced mounting it as ext2 in the /etc/fstab (in an attempt to limit the write access to the disk, I want it to stay in standby for a long time but that's another post). (Remark by Martin: this is a known issue with initramfs-tools.)

Anyway, having seen this, Martin was able to guide me to getting it fixed:

And it should all be working!

Fri, 26 Mar 2010; 11:57 — debian/orion/d-link/dns-323permanent link

Fan control on the D-Link DNS-323

The kernel in Debian doesn't have support for the fan control chip on the D-Link DNS-323. Since some people said that their device runs quite hot after installing Debian, I've prepared a 2.6.29 based kernel that includes the fan driver.

If you want to install this kernel, edit the file /etc/apt/sources.list and add the following line:

deb http://people.debian.org/~tbm/orion lenny main

Now you can install the new kernel:

apt-get update
apt-get install linux-image-orion5x

After a reboot, you can control the fan this way:

echo   0 > /sys/class/hwmon/hwmon?/device/pwm1  # turn it off
echo 255 > /sys/class/hwmon/hwmon?/device/pwm1  # turn it to full speed

Any values between 0 and 255 will work.

According to Anselmo Luginbuhl, you should also be able to use the lm-sensors package to automatically control the fan:

"Execute pwmconfig, it will make some tests and generate the fancontrol config file. At the end of the procedure it will ask you to "Select fan output to configure, or other action:", just be sure to pass through choice "1" or it would not fill in the configuration file, save the configuration and start the daemon /etc/init.d/fancontrol.

Probably the only thing that needs some attention to get an optimal result is to choose the right parameters for max and min temperature at which the fan should start or stop to minimize the °C and the noise."

Finally, this kernel also includes some performance patches from Marvell, so you might see some performance increases too.

Sat, 06 Jun 2009; 14:52 — debian/orion/d-link/dns-323permanent link

Automatic power on QNAP Turbo Station devices

All ARM based QNAP machines can turn on automatically when power is applied if the device was not powered down correctly. This is helpful when your power goes down. Follow the instructions below if you want to turn automatic power on using Debian on a QNAP TS-109, TS-119, TS-209, TS-219, TS-409 or TS-409U.

Edit the file /etc/apt/sources.list and add the following line:

deb http://people.debian.org/~tbm/orion lenny main

Now install a new version of qcontrol:

apt-get update
apt-get install qcontrol

Finally, turn the automatic power feature on:

qcontrol -d &
qcontrol autopower on
kill %1
rm /var/run/qcontrol.sock
Sat, 16 May 2009; 11:01 — debian/orion/qnappermanent link

Test kernel for Orion with performance patches available

Marvell posted some performance patches for ARM that speed up the copy_to_user and clear_user functions which are used to copy data around. I see quite a bit of performance increase with these patches on Orion, and I've prepared a test kernel so you can try them out too. This kernel should be treated as experimental, but I'm looking for testers with Orion-based hardware (e.g. QNAP TS-109, TS-209, and TS-409) who are interested in giving it a go.

If your system has a rescue mode (the QNAP devices and the HP mv2120 do), I suggest you first make a backup of your flash. On the QNAP devices, you can do this with:

cat /dev/mtdblock1 /dev/mtdblock2 /dev/mtdblock3 > qnapimg.bin

Then edit the file /etc/apt/sources.list and add the following line:

deb http://people.debian.org/~tbm/orion lenny main

Load the key used to sign this repository so that apt can verify it:

gpg --keyserver pgp.earth.li --recv-keys 68FD549F
gpg --export -a 68FD549F | apt-key add -

Now you can install the new kernel:

apt-get update
apt-get install linux-image-2.6-orion5x
flash-kernel

After the installation of the kernel, reboot and do some tests: Do you see any speedup? Do you see any problems?

Thu, 02 Apr 2009; 20:07 — debian/orionpermanent link

Debian lenny images and docs for Debian on D-Link DNS-323

After integrating Matt Palmer's installer patches for D-Link DNS-323, I have now created installer images based on Debian lenny. They will work both on the D-Link DNS-323 as well as the Conceptronic CH3SNAS. I've also written an installation guide and other information, including how to use the recovery mechanism through the serial console.

Sun, 22 Mar 2009; 22:34 — debian/orion/d-link/dns-323permanent link

D-Link DNS-323 and Conceptronic CH3SNAS support integrated in installer

I finally had a chance today to test the patches Matt Palmer created to add D-Link DNS-323 support to the Debian installer. I tested the patches on a Conceptronic CH3SNAS which, from a hardware perspective, is a D-Link DNS-323 (rev B1). I noticed that the firmware image specifies a number for the vendor, so we have to generate different installer images for the D-Link DNS-323 and Conceptronic CH3SNAS. That was easy enough to do and I was able to install Debian without any problems.

The next steps are to write an installation guide and other documentation, and to improve the kernel (the power LED is blinking and cannot be changed, and fan control is missing).

Sun, 08 Mar 2009; 21:51 — debian/orion/d-link/dns-323permanent link

SmallNetBuilder article about Debian on QNAP TS-209

Jim Buzbee published an article in SmallNetBuilder a few days before Christmas about installing Debian on the QNAP TS-209. I find the article very well written and balanced, and it makes a good introduction for folks who are interested in installing Debian on NAS devices.

Thu, 29 Jan 2009; 20:59 — debian/orion/qnappermanent link

Pictures of QNAP TS-409U and Conceptronic CH3SNAS

I took some pictures the other day of NAS devices I'm currently working on. They are now available in the QNAP TS-409U and Conceptronic CH3SNAS (aka D-Link DNS-323) image galleries.

Wed, 28 Jan 2009; 21:08 — debian/orion/qnappermanent link

HP mv2120 is sold in Europe as the HP mv5020

We added Debian support for the HP Media Vault mv2120 this summer and it works very well. While this NAS device is easily available in the US, I have unfortunately not been able to find it in Europe so far, which obviously limits the number of people who will run Debian on it. Yesterday I learnt that the mv2120 is sold in Europe under the name HP Media Vault Pro mv5020 (GX666AA). I found some shops in the UK that sell the mv5020 but I assume it's also available in other parts of Europe.

Tue, 13 Jan 2009; 08:33 — debian/orion/hp/mv2120permanent link

Recovery mode for QNAP devices available now

QNAP recently released an upgrade for u-boot, the boot loader used on most QNAP devices, that adds a recovery mode. With this recovery mode, a backup image is requested via TFTP and then written to flash. This is useful in case there are problems during the installation or an upgrade of Debian.

While Debian itself works well on QNAP and another NAS devices, we get reports from users every once in a while that their machine stopped booting (either after an upgrade or for no good reason) and it's usually impossible to say why since these devices are headless. The recovery mode allows them to put an image into flash that is known to work or an image of the installer that can be used as a rescue option. Essentially, the recovery mode removes the need for a serial console in many cases.

I've added information about the recovery mode for the QNAP TS-109, TS-209 and TS-409/TS-409U, including installation instructions of users already running Debian.

Tue, 09 Dec 2008; 20:47 — debian/orion/qnappermanent link

Installer working fine on the Kurobox Pro

Per Andersson ported the Debian installer to the Kurobox Pro this summer as part of a Google Summer of Code project. Along with Riku Voipio, I acted as Per's mentor and gave him advice while he was trying to figure out all the details that were needed to get Debian running on the device. Since I spent the summer in Israel and didn't have my Kurobox Pro with me, I never performed an installation on my own though.

Yesterday I finally found time to play with my Kurobox Pro. Per did a great job and the installation worked without any problems. I also investigated how the recovery mode works and added various new information to my Debian on the Kurobox Pro pages. The Kurobox Pro seems like a nice machine, but I hope we'll add full support for the Linkstation Pro and Live soon since these devices are much more easily available. It shouldn't take too much work since these devices are quite similar to the Kurobox Pro.

Thu, 27 Nov 2008; 18:52 — debian/orion/buffalo/kuroboxpropermanent link

Debian installer coming to the D-Link DNS-323

My posting about receiving a Conceptronic CH3SNAS a month ago prompted Matt Palmer to work on the installer. Matt did a fantastic job and had patches for everything within a few days: he added support for the revision B of the DNS-323 to the kernel, added code to the kernel so the MAC address is parsed from flash, and added DNS-323 support to various components of the installer. Finally, he wrote a really good porting guide that will hopefully inspire other people to port the installer to more NAS devices. Porting to another Orion based device usually doesn't take much now that we have the infrastructure in place.

While Matt's patches came too late for inclusion into the initial release of lenny, the release team seems agreeable to the idea of adding support for the D-Link DNS-323 and Conceptronic CH3SNAS to a stable update of lenny. To this end, the dns323-firmware-tools package which is needed to create proper firmware images for the DNS-323 was accepted for lenny a few days ago. Alan Fletcher also kindly agreed to make a serial cable for me, so hopefully I'll get a chance to test Matt's patches soon and integrate them into the installer. In the meantime, I created a few simple pages about Debian on the D-Link DNS-323 which I will extend once support has been integrated into the installer.

Mon, 24 Nov 2008; 17:53 — debian/orion/d-link/dns-323permanent link

Debian on the QNAP TS-409U

Christmas came early for me this year: after receiving a Conceptronic CH3SNAS yesterday, a QNAP TS-409U showed up today. QNAP sent it to me a week ago to ensure that Debian works on it but it was stuck in customs for a few days. The QNAP TS-409U is similar to the TS-409 but comes in a rack case (and with more RAM). It seems that QNAP have also changed the layout of the mainboard but essentially it's still a TS-409. This means that the installer works just fine. Another difference to the TS-409 is that the TS-409U has two fans but qcontrol works without any problems on both machines.

Wed, 15 Oct 2008; 18:32 — debian/orion/qnappermanent link

Conceptronic CH3SNAS and the D-Link DNS-323 revision B1

Conceptronic kindly sent me a CH3SNAS for my Debian porting efforts. The Conceptronic CH3SNAS is reported to be basically the same hardware as the D-Link DNS-323 but it costs slightly less. There were some reports that the CH3SNAS uses a 88F5182 chip whereas the D-Link DNS-323 uses a 88F5181 but nobody was able to confirm this for sure. As it turns out, there are two revisions of the DNS-323. Revision A1 uses a 88F5181 chip along with a separate SATA chip. Revision B1 on the other hand uses a 88F5182 which integrates SATA into the SoC itself. The CH3SNAS is equivalent to a D-Link DNS-323 revision B1. In fact, the mainboard of the CH3SNAS even says DNS-323 rev B1.

The Linux kernel from mainline only works on the DNS-323 revision A1 at the moment. Adding support for revision B1 should be trivial since you basically just need to initialize the SATA chip on the SoC and possibly adapt some other values. Unfortunately, the DNS-323 uses a very small serial connector so none of my serial cables work. If I can find someone who will make a serial cable for me, I'll fix up the kernel.

Tue, 14 Oct 2008; 12:32 — debian/orion/d-link/dns-323permanent link

Visiting Marvell in Yoqne'am

Marvell in Yoqne'am Since I'm spending the summer in Israel, I used the opportunity yesterday to visit the Marvell site in Yoqne'am where the majority of the NAS software engineering team is located. They first gave me a tour through the hardware labs which I found incredibly interesting. It's amazing what equipment those folks use to perform QA tests of new chips, how they can reverse engineer chips and even make some modifications to test their theories about hardware bugs. I found it really amazing and at the same time felt glad that changing things in software is so easy.

Later they showed me the software lab where they had an exhibition of various devices based on the Orion chip, including NAS devices, but also printers, wifi APs and game machines. They also told me some details of their product roadmap but unfortunately I cannot share that information. The only thing I can say is that we'll see a lot of new devices to which it would be cool to port Debian.

Mon, 08 Sep 2008; 19:19 — debian/orionpermanent link

TODO list for Debian on D-Link DNS-323

Someone asked me the other day what it would take to add Debian support for the D-Link DNS-323. Since we support a number of Orion based devices in debian-installer already, adding support for another device is typically fairly easy. I don't have a D-Link DNS-323 myself, but I looked around the useful DNS-323 wiki and this is what I came up. I'm sharing this list in the hope that other people are interested in working on DNS-323 support.

Sun, 17 Aug 2008; 16:57 — debian/orion/d-link/dns-323permanent link

Debian on HP mv2120 web site

I've created a web site with information for running Debian on the HP mv2120. The HP mv2120 is a NAS device based on Marvell's Orion platform and has a 500 MHz ARM CPU, 128 MB RAM and two SATA slots.

All components needed to support Debian on the HP mv2120 have been integrated into Debian and Debian installer. However, a new release of the Debian installer is required so installations of Debian testing are actually possible.

Wed, 30 Jul 2008; 22:09 — debian/orion/hp/mv2120permanent link

Daily installer image available for QNAP TS-109, TS-209 and TS-409

Daily installer images are now available for the QNAP TS-109, TS-209 and TS-409. This means that complete installations of Debian testing are possible now.

You can consider the daily image as a beta release of RC1 of the debian-installer for Debian lenny. It should only be used by experienced users and only if you can make a serial console in case something goes wrong. As the name suggests, the daily images change on a daily basis and they install Debian testing which also changes on a daily basis (although testing should be fairly stable since we're close to the freeze of testing in preparation for the release of Debian lenny).

If you install Debian with these installer images, please send an installation report to debian-boot send an email to me so I can let you know in case there are any important news you should be aware of.

There is a web site now with complete installation instructions and other information about Debian on QNAP Turbo Station. If you have any questions or suggestions, please let me know.

Mon, 21 Jul 2008; 20:18 — debian/orion/qnappermanent link

Debian support for HP mv2120: putting everything together

I managed to get my hands on a HP Media Vault mv2120, a nice ARM based NAS device, a few months ago with the intentions of porting Debian to it. Unfortunately, I have been really busy lately and most of my time was spent on adding support for the QNAP TS-109/TS-209 and TS-409 (which required a lot of generic work to get Marvell Orion support into Debian, a new SoC used in many NAS devices, including the QNAP TS-x09 and HP mv2120).

There were a number of things that had to be worked out before Debian would run on the mv2120. The good news is that Marc Singer and Eugene San have done all of the heavy lifting in the last few weeks in figuring out how the mv2120 works and that now it's just a matter of putting everything together for Debian to work.

Here are the issues that had to be worked out:

Now that these two issues are resolved, I simply need to put everything together and add support for the mv2120 to a number of debian-installer components. We already have Orion kernel images in unstable that support the HP mv2120 (along with a number of other Orion based NAS devices) and the rest shouldn't take too long.

Sat, 28 Jun 2008; 09:31 — debian/orion/hp/mv2120permanent link

QNAP TS-109/TS-209 and TS-409 experimental developer release

Yesterday I completed the first successful installation of Debian on a QNAP TS-209 using a custom debian-installer image with 2.6.25 from unstable. I made the installer image for QNAP TS-109 and TS-209 available as an experimental developer release and today I also uploaded images for the TS-409. More on my plans to support the QNAP TS-109/TS-209 and TS-409 in the upcoming release of Debian (starting with beta3 of debian-installer) soon.

Mon, 12 May 2008; 20:32 — debian/orion/qnappermanent link