Saturday, June 27, 2009

Setting Up a D945GSEJT Server with Debian Lenny


I previously blogged about the QNAP Turbo Station as a possible candidate for a low power home server. The big problem with that solution was the loud fan, which seemed to be a real show stopper. Searching for an alternative solution, I found the recently released Intel D945GSEJT motherboard. With a TDP below 20W (apparently ~10W when idle) and being totally fanless, it is ideal for the task. I combined this with two 1TB Western Digital Caviar Green discs (cool, quiet and with low energy consumption) in an Emko EM-153 case with a built-in, fanless 60W power supply.

The resulting build is a completely passively cooled, extremely low power, fully functional home server. I installed Debian Lenny, the currently stable release of Debian, which is known to be very robust, and will allow me to easily configure the machine as an SSH server, web server with LAMP, etc. With the disks set up as RAID1 and an encrypted LVM partition containing all but /boot, it is first and foremost the perfect solution for secure file storage.

This setup took quite some effort, which is why I will document the critical points I encountered, for my own reference, and hopefully to help anyone who comes across this entry dealing with a similar setup.

The first problem was that of setting up the OS. I had more or less decided on using Debian, since I am running Ubuntu on my desktop machines. With no optical disc drive connected to the system, I considered installing Debian from USB. The problem with this solution is that the Debian Lenny installer is unable to recognize the Realtek 8111DL Ethernet controller (previous versions of the Debian Lenny installer, read this update about the latest version of the installer). I realized after the install was finished that it would probably be possible to load the correct kernel module manually during the install, which is of course a more elegant solution than the one I ended up using. Ubuntu 9.04 (Jaunty) Server, which I considered as an alternative, also had problems with the NIC (I found a reference that this would work, but I had no success myself). Intel lists some Linux distributions that they have tested on the board, one of which is Ubuntu 8.10 (Intrepid). The installer for Ubuntu 8.10 Server indeed recognized the NIC, so beside the fact that I would settle for an earlier distribution, and not solve the network problem permanently, it could have worked.

However, a problem with pre-Lenny Debian installers, like the one for Ubuntu 8.10, is that the partition editor has a serious flaw in that it cannot correctly handle encrypted partitions set up on a RAID device. There is a workaround for this, which I tried, and unfortunately did not get to work.

My brute force solution, growing tired of the problems I encountered, was to hook up the hard drives to my AMD 64 X2 4850e desktop computer, and perform the installation of Debian Lenny using the DVD drive and network card (another Realtek NIC that the installer could handle) of that machine. A small bump in the road was that the installer hanged when booting, which I solved by specifying the option acpi=off to the kernel. I found a reference to another person having the same problem, in which case the problem was solved by specifying pci=off. For me, this resulted in being able to boot, but prevented the detection of my SATA DVD burner. I now was able to set up the partitioning correctly, and let the installer percolate for about 24 hours, since the 1TB encrypted RAID partition had to be initialized with random data.

With the discs still wired to the desktop computer, I booted into the new system, and used the working network connection to dowload and compile the correct kernel module for the Ethernet adapter. The instructions for doing this can be found here. Although in that case the Intel D945GCLF2 board was used, which has the RTL8111C NIC, the D945GSEJT features the RTL8111DL Ethernet controller, which is handled by the same kernel module (r8168), as can be seen on the Realtek download page for the drivers. After following all of the advice given in the mentioned blog entry, including the module blacklisting, the kernel kept loading the wrong (ie r8169) module when I moved the discs to the Intel Atom board. I tracked this issue down to the file /etc/udev/rules.d/70-persistent-net.rules, which listed the r8169 module, which was the correct module for the desktop AMD computer NIC. Commenting out all the lines in this file and rebooting, udev reconfigured the network setup, and I finally had everything working correctly on the mini-ITX server.

One artefact from the installation procedure was that the acpi=off option made its way from the installer to the final install. Removing this option worked fine on the Intel board, and enabled me to use frequency scaling, which of course is a very desirable feature for an always-on system as this one.

So there you have it. Lots of obstacles along the way, but the end result was well worth it. I hope this can serve to ease the burden of anyone else planning on a similar setup.

14 comments:

  1. Anonymous4:27 PM

    I'm building the exact same system. You've helped me alot!

    thnx

    jules

    ReplyDelete
  2. Nice to hear! Let me know about your experiences.

    /Jonas

    ReplyDelete
  3. Made similar machine, but used a 1.5TB Samsung ECO F2 Drive. Used Ubuntu 9.04 as for my desktop, as this made it easy to create the USB install on the pen drive. No problems found with drivers for ethernet (I connect at 100Mbps not 1Gbps, but I assume no difference). Using desktop version of Ubuntu seems fine for light server duties.

    Ray.

    ReplyDelete
  4. Congratulations on your setup, Ray! It's interesting that you didn't have any problems with the NIC using 9.04, since I couldn't get it to work myself. Using Ubuntu instead of Debian for a server such as this one is essentially a matter of taste. I wanted an extremely dependable system, and since the risk of breakage is slightly higher with Ubuntu, I chose Debian.

    /Jonas

    ReplyDelete
  5. Thank you for your post. I had problems as well with the RTL8111DL, but I fixed them using the newest kernel 2.6.31. At the time it works just fine.

    ReplyDelete
  6. Thank you, it's good to know that the RTL8111DL is correctly supported in later versions of the kernel!

    ReplyDelete
  7. If anybody is interested I have written some comments regarding my experiences with this motherboard here: http://justlinuxguide.blogspot.com/2009/11/how-i-have-installed-debian-linux-on.html

    ReplyDelete
  8. I've been scouring for a reasonable case that doesn't have a power supply and can accomodate two 3.5 drives for this board. Could you guys reccomend a US source for such a case? Thanks.

    ReplyDelete
  9. I want build a distant wireless touchscreen including this board under LINUX, connected by WiFi with a PC. Is it possible to use Debian as you did for this application?

    ReplyDelete
  10. Sam and Pierre, sorry about the late reply, but I'm afraid I can't help either one of you. I have no experience with touch screens, and I live in Sweden. As I mentioned in another reply, if you send an email to info@mini-pc.se (the retailer from which I got my case), maybe they can help you find a US source.

    ReplyDelete
  11. ldolse3:45 AM

    One important note on the Realtek driver I've only seen posted in one place for this board:

    Most older distributions attempt to load a wrong/incompatible driver. Attempting to load this driver will put the NIC in some weird failure state. After compiling/installing the latest driver, you need to PHYSICALLY DISCONNECT THE POWER from the board. If you don't the motherboard's phantom power draw will keep the Realtek driver in its failed state. I learned this the hard way after installing several distributions and compiling the latest driver several times....

    ReplyDelete
  12. @ldolse: good to know, thanks for the comment!

    ReplyDelete
  13. Anonymous8:05 AM

    Thank you for your reply. Are you able to mount a 3.5" hdd in that case? if so, out of the box, or does one need some additional mounts/adapters/brackets....

    thanks in advance! :)

    ReplyDelete
  14. Thank you for your reply. Are you able to mount a 3.5" hdd in that case? if so, out of the box, or does one need some additional mounts/adapters/brackets....

    thanks in advance! :)

    ReplyDelete