Home Media – Part 2 – The Setup

Part 1: The NAS Build

Part 3: The Rip

Part 4: OSMC/KODI/XBMC

So what do you do if you want to build an unRAID box?

unRAID boots from a USB flash drive, and the flash drive needs to have a GUID or Globally Unique Identifier. This is for the purposes of licensing. If you do end up loosing or something happens to the flash drive generally lime-tech is pretty good about it and all you need to do is email them, they might ask for a new GUID and send you a new key. Here is their policy on that. I’ve had two flash drives fail on my and they were pretty good about giving me a replacement key. Once unRAID boots from the flash drive it mostly runs in memory, and since it’s a stripped version of Slackware Linux it doesn’t really require a lot of memory to run.

First, grab a 4GB flash drive, for best results grab a flash drive from the Hardware Compatibility page. The key here is that your flash drive needs to have a GUID, some have it and some don’t. Speed is also a factor, as in read and write speed. Alternatively if you want to know if your drive is compatible and has a GUID grab any flash drive and quick format it to FAT32, use Volume Label: UNRAID, then unzip the contents of the ZIP file found here to said drive, and boot it on any networked machine. If you’re having trouble booting follow the drive preparation instructions. Once booted log into unRAID, username:root, password:<blank>. Type in ifconfig to obtain the IP address, then head over to another networked machine and type that IP into a browser, this should take you to the main unRAID page. Here is the getting started page from Lime-Technology which describes the same thing in greater detail. Alternatively by default you can access the unRAID web GUI by typing in http://tower instead of http://<unRAID IP address>.

There is also something called the GO file which is located in the /config folder on the root of the flash drive. The go file gets executed at boot and in here you can put any special instructions or drive maps that you’d like to execute at boot. In my case I mount a drive that is outside of the array, I call it the system drive and it holds all the configurations for my docker containers. This is not necessary as the same can be accomplished with the cache drive. Here’s what my go file looks like.

#!/bin/bash
# Start the Management Utility
/usr/local/sbin/emhttp &

# Make directory and Mount the system drive
mkdir /mnt/system
mount -t reiserfs /dev/disk/by-label/systemdisk /mnt/system
sleep 5

#Install Screen and Utemper, utemper is necessary for screen to work
installpkg /boot/packages/screen-4.0.3-x86_64-4.txz
installpkg /boot/packages/utempter-1.1.5-x86_64-1.txz

The free version of unRAID (uR) allows you to use 3 drives. The Hardware compatibility list also provides some standards and minimum requirements for the server hardware, usually an old desktop will do. If you decide to go with a 8 or 25 disk server, you will need to pickup a decent RAID card and a good enclosure.

There is also something called the GO file which is located in the /config folder on the root of the flash drive. The go file gets executed at boot and in here you can put any special instructions or drive maps that you’d like to execute at boot. In my case I mount a drive that is outside of the array, I call it the system drive and it holds all the configurations for my docker containers. This is not necessary as you can to the same for the cache drive.

Plugins vs Docker. In unRAID, plugins were the go to in version 5 and prior, this was the way to install applications on your NAS. They were easy to install and worked well, until you installed a new plugin which had, let’s say a newer version of Python in it. If this happened it would break all the plugins which relied on the previous version of Python. I ran into this issue multiple times in both version 5 and 4 of unRAID. There was no standard and people wrote plugins they way it suited them. At one point in version 5 I had to go into a the plugin and change the python version it pulled and installed, this broke a minor function of the plugin but made it sort of work. There was also an issue I had with sql lite, a plugin was pulling a newer version than was supported by another application, and finally some plugins would break the web interface. When version 6 of unRAID entered beta and docker was a possibility I jumped for joy. Yes by nature the docker equivalent is larger, however since these are self contained application on top of a OS layer, there is no chance that one application would break another. Also now with docker one could have multiple versions of python ans whatever the prerequisite for an application was. The only problem with docker is that it is not as easy to implement as the plugins. It takes a little know how to get it up and running. But, since I moved everything to docker I have less downtime on my server, and I’m not as often remoting into the server to administer it. That’s a win in my books.

Most applications that you would want on your NAS more than likely already have a docker container created for them. However if you want to create your own and if you’re curious about docker in general here is a great Docker 101 tutorial video by Ken Cochrane.

I’m not going to tell you how to setup docker in unRaid or how to put together your server hardware, but what I will do is point you to some really cool articles/blogs that describe how to do so. In my opinion there is no point in reinventing the wheel.

Update: In the final version 6 of UnRAID docker container manager is included and installing docker containers is as easy as point and click for the most part. Good place to get the containers is from http://linuxserver.io

Over at the Corsair Blog there is a really cool How to Build a PC section. I hope http://www.corsair.com doesn’t mind me linking to their site. It’s intended on teaching you how plan and build an gaming PC, but there are still articles relevant to building and putting together computer hardware regardless of what the desired purpose is. If you click the link make sure you sort by Date (Older – Newer), this way you will start on the first post and you can continue on in a logical order.

The Lime-technology website has a really good tutorial on how to get docker up and running on your server. Check out their Docker Guide over at http://lime-technology.com/ . Again I hope they don’t mind that I link to their content as this is a very well written and comprehensive docker guide.

And last but not least there is a really good plugin for Docker containers in unRAID, yes I said plugin, it’s ok to have one. This plugin allows to view / add / remove unRAID docker template repositories. The alternative is adding the repositories yourself, you can get these from this lime-tech forum post.

To install the plg you need to SSH into your server, I generally use PuTTY from a Windows machine. Once there navigate to the directory /boot/config/plugins by typing the following:

cd /boot/config/plugins

Any plg file that is located in this folder will get installed on server boot. Once there you’ll need to download the plg to your local machine. Do this by typing the following:

wget –no-check-certificate https://raw.githubusercontent.com/Squidly271/repo.update/master/plugins/community.repositories.plg

This will download the plg file. Now you can either reboot the server or install it manually by typing the following:

installplg community.repositories.plg

That’s all for now. You should now see a new tab under the Docker heading in the web GUI of unRAID.

If you have any questions or comments, post below.

Next: Part 3 – The Rip

Advertisements

Things to understand about unRAID and XEN.

There seems to be a little misconception about the target audience for unRAID and XEN, so I think I’ll take a couple minutes and clarify.

unRAID is primarily aimed at the entry to mid level as far as difficulty is concerned. Also you need some technical know how and the capability to trouble shoot. This is not a Western Digital DUO or equivalent, it is not plug and play. This software is aimed at the DIY crowd, having said this you don’t need a lot of technical ability as there is a lot of documentation out there for unRAID and the community is one of the best I have ever had the privilege to be a part of. Also to note that unRAID 6 is in beta right now and as of yet it does not have any plugins written for it, much like version 4 and 5 the finished product will have these. If you do not want to use XEN, in the final product you won’t have to. Right now however since it is in beta if you want application on version 6 you need to run them in a VM such as Ubuntu and Arch Linux. unRAID can be run on very inexpensive hardware, and it can be scaled as required by the user. Some users run unRAID on Atom processors with 4GB of RAM. If you do this don’t expect stellar performance.

This is not FreeNAS. I found FreeNAS to be flaky at best, and the hardware requirements for that OS are very particular. ZFS has some nice features and it protects your data really well, however it requires ECC RAM and quite a bit of it too. Cost of FreeNAS can be greater than unRAID. I say “Can be..”, because you can throw any hardware at unRAID, be it low end or high end it really doesn’t matter. So in the end unRAID scales better and one can start out with cheap hardware, then slowly upgrade. Also with unRAID and XEN now you can have features such as the ones offered in ZFS to protect your critical data, it is just a matter of you willing to put the work in.

Each disk in the unRAID array is independent, two disks crashing will not bring down your entire array only the disks that crashed. The array is designed only for parity. Parity is used by unRAID to protect against data loss. If a drive in the array fails, the data on the other drives can be combined with the parity data to reconstruct the missing data.In general, a parity process is designed to detect a single bit change across a given set of bits, by setting the value of an added bit such that a summation across that set of bits is forced to a known value. The added bit is known as a parity bit.

Digital data is stored as a 1 or a 0. So, for example:

  • If you have 4 drives with bit values 1,1,1,1 the parity will be 0 (1+1+1+1+0=even).
  • If the bit values are 1,0,0,0 the parity will be 1 (1+0+0+0+1=even).

In unRAID, the parity bits are stored on a parity drive independent of the data drives. This parity bit works across the set of bits in the same relative bit position on each drive. So the 57th bit of the parity drive is the parity bit for the 57th bit of all of the data drives. A parity check of the 57th bit position therefore adds up all of the 57th bits of every drive including the parity drive, and checking to see total is an EVEN number. If the value returned is not EVEN, then the parity bit is toggled so that the parity check WILL return an EVEN number. unRAID uses ‘even parity’, which simply means that the summation process (using a mathematical operation called ‘exclusive OR’ or ‘XOR’) across that set of bits must return a value that is an EVEN number.

XEN hypervisor is a lot more difficult to use than any other, IMO. However the benefits of the hypervisor outweigh the effort necessary to get XEN going. If you do not need a hypervisor go with unRAID 5 or 4, the license is transferable to version 6. Why XEN? XEN is capable of running a Windows VM that you can game on, provided you have the necessary hardware and are running a HVM. So it is very robust and powerful.