Build your own media server, part 2: unRaid
By now you’ve probably read the first part of our media server guide, and have a good grasp on the hardware required to build your own efficient high-capacity media server. In this second part of our guide, we’ll walk you through the setup and configuration of unRaid, the Linux-based operating system that will manage your storage/media server.
Some of you may read “linux” and immediately assume that the setup process is going to be overly complex. You needn’t worry—if you can copy files to a USB flash drive and use a web browser, you can set up and configure unRaid. In fact, I’m willing to bet that most of you will have your servers up and running in under 20 minutes (well, at least to the point where everything is configured and the initial unRaid formatting process is underway)!
With that out of the way, click the “Read More” button to get started!
Build your own Media Server: unRaid setup
The steps below assume that you have a server assembled with hardware similar to what I’ve recommended in part 1 of this guide (with at least two harddisks installed). You’ll also need a blank USB stick (4GB+ recommended) to install unRaid to. If you’ve scrolled ahead, the amount of text may appear daunting, but I’ve been intentionally wordy to make the guide as easy to follow as possible—most of the steps consist of directions along the lines of “click on x”.
Step 1: Configure BIOS settings
Before we even get to unRaid, power on your server and enter the BIOS configuration area (usually accomplished by pressing the delete key on your keyboard repeatedly shortly after powering on). We want to do the following:
- Make sure that USB is the first option in your boot order. Some motherboards may require a USB stick to be inserted for this to be an option. Disable booting from other devices (SATA/IDE harddrives, CD, etc).
- In your BIOS’s SATA port configuration area, select AHCI mode if it is available. This will result in significantly faster disk performance.
- (optional) Disable any components that you won’t be using—on some motherboards, this may slightly improve your power efficiency. Most of you will only want your SATA ports and LAN port enabled. If you have onboard audio, IDE ports, and/or parallel/serial ports on your motherboard, feel free to disable them.
Step 2: Prepare your USB flash drive
Get out your USB flash drive, and make sure that there is nothing on it that you want to keep, as we’ll be erasing the contents.
- First, format the flash drive. Do this on any Windows computer by inserting your flash drive into any USB port, then open Windows Explorer and wait for Windows to recognize your flash drive. Once the drive appears, right-click on it and select “Format”. Leave the file system as its default setting, select the quick format option, and click the “Start” button to begin the format.
- When the format is finished, right-click on the flash drive again in Windows Explorer and click on “rename”. Enter “UNRAID” (in all caps, without the quotes). Note that you could have also entered this in the “volume label” area during the formatting process.
- Download the latest release of unRaid from the official Limeware page here. Make sure that you choose the version in the “Stable” section!
- When the download is complete, unzip the contents of the downloaded file onto your flash drive.
- Browse to your flash drive in Windows Explorer, and right-click on the
make_bootable
file. Select “Run as administrator” to execute it. - If you have an unRaid registration key, copy it into the root folder of your USB stick (don’t worry if you don’t, you can run unRaid in trial mode for now and copy a registration key later).
- Finally, right-click your flash drive one last time in Windows Explorer and click the “Eject” option to unmount it, and then remove it from your computer.
If you’ve followed these steps properly, you should now have a working, bootable installation of unRaid on your USB flash drive. Easy, wasn’t it?
Step 3: Boot unRaid for the first time in your media server
Now let’s boot our media server with the flash drive that we just created.
- Make sure that your media server is powered down, and insert your flash drive into any USB port. If your motherboard has an internal USB header built onto it (like the Supermicro board that I recommend does), you can use that to ensure that your USB stick never gets knocked loose or otherwise gets removed.
- Power on your server; if everything goes well unRaid should be booted from the USB stick. If not, double-check that your USB stick is listed as the first boot device in your BIOS (sometimes instead of the actual device name, certain older BIOSes may list a USB drive as “USB-HDD”, “USB-ZIP”, or “Forced-FDD”. If you’re still having trouble, you can also try: disabling USB 3.0 (or 2.0) in BIOS, disconnecting all other USB devices, disabling “fast boot” in BIOS, disabling USB keyboard support in BIOS.
- If all went well, and you have a monitor connected to your server (which isn’t necessary), you should be looking at a linux login prompt. We’re not going to actually do any of the configuration via the command line, so feel free to disconnect your monitor/keyboard/mouse from your media server, and have a seat at any other Windows (or Mac) desktop computer on your home network. We’re going to do the rest of the configuration via a web browser.
Step 4: unRaid basic configuration
Go ahead and open your web browser of choice (I use Chrome, but I assume that pretty much all of them will work fine). If your media server is fully booted and connected to your network, then you should be able to follow these steps to configure it remotely.
Note that these steps are for unRaid 4.7 (the latest stable version at the time of this writing). Later versions may differ slightly.
- Type
//tower
in your web browser’s address bar. Alternatively, you can enter the IP address of your media server. You should be looking at the unRaid GUI server management tool if everything worked properly. If not, make sure that your media server is physically connected to your network, and check your router to ensure that it appears on your device list. In the event that you use static IP addresses on your network (if you’re not sure whether you do or you don’t, then you don’t), you’ll need to assign your media server an IP address by editing theconfig/network.cfg
file on your USB stick. - Click on “Settings” on the navigation bar at the top of the page. There are a few options here that you’ll probably want to tweak. First, you can change the default server name from “tower” to something else if you like (note that after the change is applied, you’ll use the new name when connecting to your server via your web browser). Next, you’ll want to check the date and time settings and make sure that they’re accurate. Finally, under Disk Settings, pick a spin down delay time for your disks—this is the amount of time that your disks will wait before automatically spinning down to save power (I use 3 hours on my server). I recommend leaving the rest of the options on the page at their default settings unless you understand what you’re doing. Click “apply” when you’re done making changes.
- Reboot the server by clicking back to the main page (click “Main” on the top navigation bar) and then click the reboot server button.
Step 5: unRaid disk configuration
When your server finishes rebooting, reconnect to it via a web browser on another computer. Remember that if you’ve changed the server name from its default of “tower”, you’ll need to use the new name in your browser. I’ve named my server “unRaid”, so I type //unraid
in my browser’s address bar to reach mine.
Note that this step will destroy any data that is on your disks—if your drives contain data that you want to keep, make sure that you make backups before proceeding!
- Click on “Shares” in the top navigation bar.
- Next to “User Shares”, choose “Enable” and then click apply. We’ll come back here later to configure the shares, but it’s important that this be enabled before we assign disks.
- Click on “Devices” in the top navigation bar.
- Next to the drop-down labeled “parity device”, select your largest disk (if you have disks of different sizes).
- Next to the drop-down labeled “disk1 device”, assign a harddisk to this position.
- Repeat the above step for “disk2 device” and as many other disks as you have in your server. If you’re running an unregistered copy of unRaid, you’ll only be able to populate the parity disk, and disk1 and disk2 for now.
- After all of your drives have been added to the array, click on “Main” on the top navigation bar.
- Click “Start” to start the array.
- At this point, you should see a “Format” button appear at the bottom of the page. Go ahead and press it to begin the formatting process.
Feel free to take a break at this point. Depending on the size and speed of your drives, the initial parity check and formatting process can take upwards of 15 hours. When unRaid finishes, proceed to the next step.
Step 6: unRaid shares configuration
Shares are the method of accessing and organizing your data in unRaid.
- Connect to your unRaid management tool via your web browser if you haven’t already.
- Click “Shares” from the navigation bar at the top of the page.
- Under “Flash Share (SMB)”, I’d recommend setting this to “Don’t export”. This is the flash drive that contains your unRaid OS. You can always change it later if you need to read or write something to your flash drive and don’t want to physically remove it from your server.
- Most of you will want to set your “Disk Shares (SMB)” to “Export read/write”. This allows you to access each physical disk directly (should you want to) over the network by concatenating your server’s name with the disk name. For example, disk 1 can be accessed at
//tower/disk1
(assuming you haven’t changed your server’s name from the default of “tower”). If you’d prefer to not have the physical disks accessible, you can choose to not export them, or make them read-only, or even have them accessible but hidden.
Now for the fun part: setting up your user shares. Once these are configured, you (and your users) will no longer have to think about physical disks that your data is stored on. With shares, unRaid abstracts your data into logical storage buckets and makes it seem like your mish-mashed array of disks is simply one giant pool.
For example, if you create a user share called “Videos”, then when you access //tower/videos
over the network, unRaid will automatically aggregate the contents of /videos
across every physical disk. So while you may have files stored in a /videos
folder on disk 1, disk 3, and disk 7 (for example), the files will all appear as if they’re in the same single //tower/videos
folder when you access it over the network. Similarly, when you write new files to //tower/videos
, unRaid will automatically take care of placing the new files onto whichever physical disk is most appropriate, depending on the rules that you specify in the next steps. Neat, eh?
- Set up a new user share by filling in the name, and selecting “High-water” next to “Allocation method” (click here for an explanation of the different allocation methods), and “Export read/write” under “Export (SMB)” (99% of you probably want export read/write, but choose something else if you need to). Click the apply button when done.
- Repeat for as many user shares as you need. On my server, I have user shares for movies, music, photos, and backup (see image below).
Congratulations—you’re done!
At this point, you should be able to access your new shares over your network and copy files to your new unRaid media server (and read them back!). Note that write speeds are significantly slower than read speeds, but in a media server application, nearly all of your operations will be reads after you’ve got your initial data loaded.
In the next section of the guide, I’ll talk about user security and other advanced topics. Check back in a few days!
Leave a Reply