Ubuntu AirVideo Server with NAS
Some people use their weekend for home renovation projects, I however used this particular weekend to perform some home information technology (IT) upgrades. My replacement iMac 27" Late 2012 model arrived this week, so after setting up this monstrosity of a machine, I am left with an extra box. An old Windows PC running Windows 7 with a very old AMD Athlon™ II X2 245 Processor along with 3GB of memory. Unfortunately the PC’s motherboard, a Gigabyte M61PME-S2P, is a three and half years old motherboard. It doesn’t even have gigabit ethernet on the board. Instead of having it sit around, I figured that it would be a good idea to try my hands on building a Linux file and media server.
I could do FreeNAS, but I wanted flexibility to run some additional software on the box in addition to just perform as a file server. We have many iOS mobile devices in the house, so I also decided to install Air Video Server on the machine. If you are not familiar with AirVideo, you are missing out. Check them out at http://www.inmethod.com. I ended up running Ubuntu Desktop 12.10 release as an experiment.
Here is a quick to do list that I set for myself:
- Installed Ubuntu;
- Consolidate old hard drives into a single volume for media storage;
- Install samba to share the volume, so I can copy media to it from other computers in the house;
- Install AirVideo server and configure it to serve media from the above volume;
- Ensure all of the above works when we reboot the box
Installing the operating system from a USB key was a piece of cake. This weekend project also gave me the opportunity to hunt for old hard drives that have been sitting around dormant in my home office. I wanted to place all my old hard drives into this box, reborn as my new Air Video Server (I named it AVS for short). To my disappointment the old motherboard only allowed for two SATA drives, and one was already taken. Therefore, I could only repurpose one of three old drives that I have found.
Adding drives to the AVS box, forced me to dust off the webs from my Linux knowledge base. I had to re-familiarize with myself on the topic of how to use lshw to find out the hardware that is being installed on the system, and using fdisk to partition the drives properly. I had two old drives. The first a 300GB SATA drive, and the other a 320GB drive. I created a single primary partition on each drive.
Once I’m happy with the partitioning, I’m ready to create a software RAID array or volume using the mdadm utility ( http://en.wikipedia.org/wiki/Mdadm ). I used mdadm to combined the two drives into a single volume of RAID-0 of 600GB. I didn’t care about redundancy or backup, so I chose RAID-0 instead of RAID-1. I am thoroughly impressed by mdadm in its ability to handle drives of different models to accomplish this.
Now that I have an array device created, I have to create a file system using mkfs.ext4. The last time I created a Linux file system, we only had ext2. I then have to brush up on my mounting procedures and configure the mount points with /etc/fstab. The mounting configuration was an optional step, but I wanted to rename the default mount point that mdadm gave me. After some more permission related configurations, and the installation and configuration of samba on Ubuntu to share the mount point, I have a Network Attached Storage (NAS) that I can copy videos to.
The installation of AirVideo Server was super easy. Kudos to Sergio Rubio. I literally downloaded the Debian install package from https://launchpad.net/~rubiojr/+archive/airvideo and I was done. After quickly configuring the server by editing the AirVideoServerLinux.properties in /opt/airvideo-server, I manually run the AirVideo Server on the command line to see if it works with my iPad. This was a good moment, but I am not finished.
I needed to ensure that all the services related to this new AirVideo Server comes up when the machine is rebooted. This launched another journey down memory lane in terms of /etc/init.d. Again to my amazement, I simply searched init.d and airvideo on Google, which lead me to a post ( http://www.inmethod.com/forum/posts/list/3485.page ) with a ready made /etc/init.d shell script. After some minor adjustments, I was off to the races with a completed AirVideo Server using my old computer and hard drives.
Although Ubuntu has made great strides in making Linux easier to use, I had to do most of the above on the command line as I find the user interface of Ubuntu is still thwarted with many bugs. Creating something like this is still not for the faint of heart.