Building an unRAID Server

unraid_logo

For as long as I can remember I have had a way of serving my media files from my main desktop PC to my TV.  Over the years I’ve gone from Windows File Sharing, to FTP, back to Windows File Sharing, to Samba, to NFS, and lately to a combination of Plex Media Server (for videos, and Logitech Media Server (for music).  These files are then served to a combination of boxes and devices around my house.  I currently stream files to a dedicated Revo 1600 XBMC box, an AppleTV 3 (via PlexConnect), a Boxee Box, Chromecast, and various SqueezeBox setups.

Lately I have been getting frustrated with buffering issues with my current setup and decided that it was time to upgrade to a dedicated box.  In my mind I had two options: the first being a store bought, pre-built NAS, and the second was for me to build my own server.  Both have their merits, but I opted to build my own since it would be cheaper, more powerful, and have the ability for greater customization.  I then decided that unRAID would serve as the backbone for this system.  unRAID is nice in its inherent file redundancy as well as the various plugins available for it.  Another benefit to unRAID is that it comes in three flavors, depending on the number of drives that you want to support.  For now, since I just want to use 3 drives, it is actually free.

Shopping List

  1. Intel Core i3 4130 3.4GHz – $99
  2. ASUS H87I-PLUS – $107
  3. Corsair CX430 430W – $20 (after rebate)
  4. Patriot Viper Xtreme 8GB DDR3 1600 – $55 (after rebate)
  5. SanDisk Cruzer Fit 16GB – $10
  6. BitFenix Phenom Mini-ITX Tower Case – $50 (ebay open box)
  7. Fan Splitter – $6
  8. 2 x Western Digital Red NAS 3TB – $120 each
  9. Seagate Barracuda 2TB – $free (pulled from old computer)

Total w/o Hard Drives: ~$345

Tools

  1. Various Screwdrivers
  2. Old Credit Card (for applying thermal compound)
  3. A computer with internet access and a USB port
  4. Zip ties (*optional)

Requirements

  1. Provide file access over LAN
  2. Plex Media Server (Including PlexConnect)
  3. Logitech Media Server
  4. File redundancy
  5. Faster transcoding than my PC
  6. Small but upgrade-able

Server Build

unRaid Server Parts
Everything needed to build an unRAID server

Why these parts

To start with, I knew that in order to meet my build requirements I would need a decent computer.  I couldn’t just get away with recycling one of my old desktops if I was planning on doing on the fly high definition transcoding.  The first part in my little shopping spree was the processor, the rest of the build more or less was based on this.  I waited a bit for a good sale to popup on a later generation i3 and jumped on it when I saw it in the Microcenter flyer (one of the few good flyers I get in the mail).

After that, I knew that I wanted a fairly small case.  This in my opinion, limited me to the micro-ATX and the mini-ITX form factors.  I picked out a few nice looking cases and again waited for a good deal.  I religiously checked Amazon, Newegg, TigerDirect, eBay, etc.  In the end, I lucked out when someone posted a listing for the BitFenix Phenom; no reserve, low opening bid, opened once to only find out it didn’t fit his motherboard.  Perfect, his loss was my gain.  I placed my bid and got a great case for a great price.  It allows me to fit up to 6 standard size hard drives in a mini-ITX case!

Now my challenge was to find a motherboard that would fit these parts.  I needed an LGA 1150 socket mini-ITX motherboard and I wanted for it to have at least 6 SATA ports.  This was a good and a bad thing.  The good thing, was that it severely limited my choices.  The bad, was that it severely limited my choices.  The odds of a deal were not that good.  In the end, I just went with the cheapest option with these requirements.  Amazon had a decent price, so I just ordered from them.

After that, I searched around for some deals on RAM, hard drives, a USB stick (to run unRAID off of), and a power supply.  After running a few power supply calculators I knew I didn’t need anything crazy, just a fairly good brand, and nothing too low in wattage.  430W should be enough and for $20 (after rebate) who am I to argue.

In terms of storage capacity, I didn’t want to just buy a bunch of drives that I didn’t need right off the bat.  I wanted room to expand as I needed.  If you are unfamiliar with unRAID and RAID type setups, to provide redundancy you don’t get to use all of your storage space (unRAID calculator).  Basically, your largest drive if used as a parity drive and your data is strung out across all of the other drives.  So if one of your drive dies, you can just pop in another and your server will recover your “lost” data for you.  So, for that reason I opted to buy two new 3TB drives in addition the 2TB drive I had lying around.  Just as a reminder, your largest drive will be used for parity, so in my current setup I will only be getting about 5TB.  If I decide to add another 3TB drive, I will move up to 8TB.

Install the Power Supply

First, you are going to need to unpackage the case and the power supply.  From there, you can just screw the power supply into the power supply slot in the case.  One of the nice things about this case, is that it uses a standard ATX power supply.  So, no gotcha’s there.  Just follow the instructions that came with the case and you will be good.

Prepare the Motherboard

Now on to the heart of the system.  I’m going to recommend that you are careful here.  Static discharge could severely damage your new server before you even get it started.  First, I installed the CPU in the CPU slot, careful not to get your finger prints all over the top of it.

Next, its time to prepare the heat sink.  Apply the thermal compound per manufacturers recommendations.  I used an old credit card to help smear the compound evenly on the CPU.  Next, apply some to the bottom of the heat sink.  Lastly, push the heat sink down, locking it into place.

Then, I installed the two sticks of RAM.  Make sure they are seated all the way in and you feel/hear the sticks click into place.  If they are not installed all the way, you will have issues booting and/or running properly.

Install the Motherboard

This is fairly straight forward, just line it up and screw it in place.

Install the Hard Drives

I actually rotated the HDD rack from the way it came.  It is held in place by a few screws and is made to be oriented either way.  So easy enough.

Slide a hard drive tray out and then pop the hard drive into the tray.  Then slide the tray back into the rack.  That’s it, no screws involved.  Repeat this for all you drives.  I left the top slot (5.25″) empty for now.  I may want to add a cache drive for down the road and I feel like it should be located at the top.

Wiring

Now the last step is to connect all the wires.  I would recommend taking your time and try to plan out the best place to run your wires.  You can use zip ties to help hold things in place.  First I ran the power supply wires to the motherboard.  There is a 24 pin and a 4 pin connector that power the motherboard and the CPU.  The PSU comes with an 8 pin connector (NOT THE 4PIN).  This is OK, just use one half of the connector.  

Next up were the fans, plug them into the motherboard.  This was actually a pain.  I didn’t realize that the motherboard only had one 3-pin connector for a case fan.  The Bitfenix Phenom comes with two fans.  So, I had to order a fan splitter from Amazon (this was an unexpected and kind of disappointing delay in the build).  Hook up the power supply to the hard drives.  Finally, connect the SATA cables (I found right angle cables worked better) from the hard drives to the motherboard.  Boom! Your done building and ready to start setting up unRAID.

Configure unRAID

Preparing the USB Drive

The nice thing about unRAID is that it is self contained/installed on a USB drive.  In order to setup the USB drive, you are going to need to use another computer.  I configured mine on Linux, but Windows and OSX should be the same.

Linux/Windows/OSX Instructions

Download the latest unRAID (I went with the stable release) and unetbootin

  1. Plug in your USB drive (this must be at least 512MB).
  2. Format the USB drive to MBR partitioning, FAT32 file system, and name the drive UNRAID.
  3. Change the file extension of the unRAID file from .ZIP to .ISO.
  4. Start unetbootin, if Linux run as super user.
  5. Click Diskimage radio button and locate the unRAID file you changed to a .ISO.
  6. Change Type to USB Drive.
  7. Select the USB Drive you want to be your UNRAID drive.
  8. Click OK.
  9. If you are prompted with an alert that it found some files and wants to overwrite them, click Yes to All.
  10. When it is finished, eject the Drive and you are ready to setup unRAID on your server.

Setup unRAID

To make sure everything was good, I plugged in a monitor, keyboard, and ethernet cable to the unRAID server.

Next hold press the DEL key during boot up to get into the BIOS configuration.  We are going to go into the advanced BIOS settings and change the boot order/settings.  Disable booting from any of the other hard drives and set the first boot device to be the USB drive with unRaid on it.  Now you are ready to power up your system.

After I powered it up, I was prompted for a username.  The default username is root and there is no password.  I then went over to another PC and navigated to http://tower.  If that doesn’t work, try going to http://[ip_address_of_unraid].  If you see the default unRAID web interface, you are on the right track.

Next up is to assign the drives to slots (make sure you pick one of your largest for the Parity drive).  After that format the drives, and run a parity check.  This will take a while.  I let it run overnight.  In the morning, everything was good to go and I was able to start the array.

unRaid Web Interface
unRAID Web Interface during initial Parity-Sync

And there you have it.  A fully functioning unRAID server, built from the ground up.  Now all I have to do is install some unRAID plugins.  These plugins will allow me to finish meeting my requirements, giving my unRAID server both Plex Media Server and Logitech Media Server functionality.