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 lenny main

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

gpg --keyserver --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-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

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

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

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

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