Building your NAS with a HP MicroServer N40L

If you were one of the avid hotukdeals.com members who picked up a bargain HP MicroServer this week like I did, or you’re looking at getting one, you probably want to turn it into a nice little home server that’ll do everything you could possible need, and to be honest it’s more than powerful enough to do that, so long as you acknowledge it as a server, and at most, a home theatre PC (HTPC)

It’s a fairly beefy machine with a 1.5Ghz dual core AMD Turion™ II Neo N40L processor which actually smokes older AMD 3200+ Athlon dual core processors from only a few years ago, but using a fraction of the energy to power it. It comes with 2GB of memory and a 250gb hard drive, which you almost certainly will be using for the OS, and the other drive bays will form your data storage, or RAID array if you’re super fancy.

I wanted to write a little post explaining how i’ve set it up, and it’s quirks, and because I like my homepage to stay reasonable, you’ll find that right after the jump, which is coming up right about now.I paid attention to a lot of forums and blogs and even the hotukdeals threads since I ordered mine, and there was a lot of people suggesting you should go with Windows, but the simple rebuttal to that is that you shouldn’t… probably. If you’re reading this, I reckon it’s a safe bet to say you’re nerdy, or at the very least, you’re able to read instructions and follow along at home. For that reason you should choose linux. It’s the lowest overhead way to get yourself up and running leaving the CPU to do the important bits, rather than making sure your start button animates nicely.

I went for a headless configuration: That is, I don’t intend to have it plugged into a monitor ever again, which obviously means I’m not using it as a HTPC, but if you were to go down that route, I’d install XBMCbuntu, then install gnome manually if you want to use other things, but as XBMCbuntu gives you a SSH shell, you don’t really need to login to a desktop manager ever, or shouldn’t at least. Anyway, back to headless:

Operating System

The choice of OS caused some issues, mainly with @bensmithurst who argued that you should use plain Debian. I can’t recommend Debian stable or testing though – I’d use unstable if you want to go down that route, purely because Debian is pretty slow at getting upstream packages back down into it unless you use unstable (or sid, to give it it’s proper name), and unstable is a bit misleading, as it’s just newer and still pretty stable – But I went for Ubuntu Server. It’s basically debian, but with a much bigger community wrapped around it, much easier third-party package control (ppa) and the ability to actually have new released software, which if you’re going to be using sickbeard and sabnzbd to automate download tasks, is important.

RAID

The N40L boasts embedded RAID, but actually it’s just a SATA controller with a little bit of extra logic that helps with RAID setup – the problem is it’s slow, proprietary and causes more problems than it’s worth. It’s called fakeraid commonly and is generally regarded by Ubuntu as terrible, and not worth using. So don’t. Configure software RAID as part of the OS installation. Setup the 250gb drive as the main OS drive (in my case, I went with a 2GB swap partition, and the rest mounted as ext4 the root filesystem (/)) and then put any extra hard drives in bays 2-4. You can configure RAID on theses as part of the install. I went with RAID0, as I wanted the speed, and will keep nightly backups of their data anyway, so if I one drive fails I can rebuild.

Sabnzbd (Sabnzbdplus)

Sabnzbd is a python based newsgroup (NZB) downloader. You can just install this with apt-get, but you’ll get an outdated version unless you include the PPA. Full details of this are here on sabnzbd’s website. Once setup, you’ll need to configure the base configuration in /etc/default/sabnzbdplus.

You probably want to configure that to USER=<your username>, HOST=0.0.0.0 (which will bind to all your IP addresses) and PORT is probably 8800. Then start with “sudo service sabnzbdplus start” and you’ll be able to complete the setup.

Take note that it’s default configuration will then live in ~/.sabnzbd, so add that to your backup schedule.

Sickbeard

Sickbeard is a python based automated TV downloading system, which uses Sabnzbd to perform the downloads. Its configuration is a bit harder, as there is no package, but you just need to follow these steps, after you’ve installed sabnzbd:

  1. Install git: sudo apt-get install git
  2. Make sure sabnzbd installed python-cheetah: sudo apt-get install python-cheetah
  3. Go to where you want to install the code. I use ~/.sickbeard, so: cd ~
  4. Clone the repo: git clone git://github.com/midgetspy/Sick-Beard.git .sickbeard
  5. Go into the newly cloned repo: cd .sickbeard
  6. Edit the startup script: vi ~/.sickbeard/init.ubuntu
    Here, you need to configure the following options:
    APP_PATH=/home/<your username>/.sickbeard/
    DAEMON=/usr/bin/python
    RUN_AS=<your username>

    Update 6th Sept 2012: As of a commit on 4th September 2012, SickBeard no longer wants you to edit init.ubuntu, instead you need to create a new file: sudo vi /etc/default/sickbeard
    Inside that file, you need to set the following options:
    SB_USER=<your username>
    SB_HOME=/home/<your username>/.sickbeard
    SB_DATA=/home/<your username>/.sickbeard
    That’s it for that file – Just those 3 lines will do unless you’re doing more clever stuff.
  7. Now, link that startup script to the system: sudo ln -s /home/<username>/.sickbeard/init.ubuntu /etc/init.d/sickbeard
  8. You’re now free to start sickbeard: sudo service sickbeard start
  9. You can then configure sickbeard at its default web address of http://<nas-hostname>:8081 (or :7071 if :8081 doesn’t work!)
    Optional
  10. You can set sickbeard to start at runtime, like sabnzbd is by default by installing it to run levels 2-5. I use a nice CLI tool called sysv-rc-conf to do this. Install with: sudo apt-get install sysv-rc-conf
  11. Then run: sudo sysv-rc-conf
  12. Mouse cursor down to sickbeard in the list of apps and move over to the boxes for 2, 3, 4 and 5, pressing space bar in each to add a X. Then you can press q to exit and you’re done!

Wrap Up

I think that’s pretty much it for how I configured the server. I use mine for energy monitoring via serial port, and reporting my router stats, but they’re just python and php scripts (PHP CLI needs to be installed for that, with sudo apt-get install php5-cli)

I installed samba too, but that’s pretty simple to get going with a few guides on google.

If you have any other questions, feel free to ask in the comments!


Comments

10 responses to “Building your NAS with a HP MicroServer N40L”

  1. Just testing comments 🙂

  2. about the microsever could I use it as installation of sabnzbd with, couchpotato sickbeard headphones. the. add hdd to the sever (4tb) and stream that to my jb atv2 ?

    1. Absolutely 🙂

      1. @lgladdy how do I do it then I am new to this

  3. HI Great Post, I started building the server today, installed Centos on the 250GB disk that came with the box. Added 2x3TB WD Green disks and configured RAID1 Mirroring using the RAID utility in hardware (Not Soft RAID).
    i have created a 3TB Logical DIsk successfully without issue and can see that in the RAID Configuration menu. However when i boot Centos the OS does not see the RAID volume , instead it sees both 3TB disks natively.
    I am starting to think that the RAID is somehow not able to present that LD to the OS enenthough its created successfully. Any Ideas?

    1. @VS it’s hardware raid is only fake raid and I could never get Linux to detect it when I used it either. Current best practice for fake raid is to use the built in software raid controller with the OS. Life will be much easier and you won’t lose any performance.

      1. @lgladdy  @VS On Debian you should edit your install medium bootloader with “e” and write at the end of this dmraid=true and now debian could installed on fakeraid
         
        A good Tutorial is here 😉
         
        http://wiki.debian.org/DebianInstaller/SataRaid

  4. Just dropping by to say thank you for making the change about /etc/default/sickbeard. I was getting an annoying error at boot about it and was using the old init file.

  5. Hi Liam,
    Sorry – I know it’s a few months since you last posted to this, but have a few questions as I’m looking at setting up a fresh hp n40l myself. Did freeNAS ever factor into the question of which OS to use rather than Ubuntu Server? (I’m debating going for one of the two) And how’s your set up working after ~6 months?

  6. Anyone installed a firewall as I would like mine to have ethernet cards…might go the pfsense route although not sure!

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.