Building a new Home File Server (Part 2 – Software)

As mentioned in Part 1, my exisiting server is using Mandriva as the base OS for all the other services I run. The reasons for this are largely historical – it was the first Linux OS I really used as a viable Windows replacement, as a desktop OS Mandriva was the most user focussed (in my view) giving a very powerful suite of GUI tools that were not present, out of the box, in any other distribution. The Mandriva Control Centre is a superb tool and kept me using Mandriva until recently. Whilst I love the power of the command line I don’t use this stuff regularly enough to remember all the commands I use, so a good GUI simplifies things enormously.

The later versions of Mandriva just had too many packages that had issues for me to continue to use it regularly. I’ve now switched to Fedora for desktop use, largely because of  RPM familiarity and the SELINUX model which makes it a very secure platform against the ever increasing threats from our increasingly connected world.

For the new server though a rethink was required and a more server-focussed OS was in order.

From a management perspective the file sharing is the easy part, the element that’s slightly more time consuming is the installation and management of the virtual machines. This desire for easy virtualisation support led me to look at the various tools and distributions available. VMWare ESXi was an option but as a free user it’s management options are restrictive as they are iultimately trying to drive corporate purchases.

There are a number of Linux-based virtualisation platforms, but after a bit of research Proxmox VE kept ticking all the buttons. It supports both KVM and OpenVZ virtualisation and is managed through a nice Web-based UI. It has some very high end features, including clustering, easy backups, excellent monitoring and notifications and easy VM replication to other Proxmox boxes for redundancy.

If you are considering using or paying for ESXi you owe it to yourself to check out Proxmox, it’s VERY powerful and easy to use once you overcome the initial unfamiliarity.

I have no intention of using the clustering features at the moment, having one server running 24/7 is bad enough,  but the ease of management it brings to VM creation is a winner even for home use.

The other thing I was keen to use was the ZFS file system. This was created by Sun / Oracle as a radical re-think of the way file systems work, it’s highly scaleable, with no practical real world limits on file system sizes, delivering very high performance.

The primary reason behind it’s choice though is data integrity. It is the ONLY file system available that can absolutely guarantee the integrity of the data stored, delivering higher integrity than expensive hardware-based RAID solutions by eliminating the RAID5 ‘write hole’ and checksumming every single bit of data you store.

There is never a need ever to run fsck or similar disk checking tools; even in the event of a power failure the data written to disk is guaranteed consistent. It also eliminates ‘bit-rot’, the risk that data stored on the disk can degrade over time, through the use of a scrubbing tool that reads every single bit of data on the drive, verifying it’s integrity against the integral ZFS checksums and correcting any errors. This peace of mind in a home environment is worth a lot. A simple cron job to run disk scrubbing on a regular basis will ensure your bits are safe.

There are those who claim it’s too complicated for home use, but having used it I just cannot see their point of view. It’s actually considerably easier to use in my experience. Creating a RAIDZ pool (the ZFS equivalent of RAID5) over the 4x 2TB drives takes seconds, it’s ready to use instantaneously and there’s no need to wait hours, even days, for the array to format or sync.

Creating a new filesystem (the ZFS equivalent of a partition) is equally easy and quick, and has major advantages over LVM or simple conventional partitions. Each filesystem is free to grow or shrink within the available total disk pool space, which means no deliberating about how much space I need to allocate to video, music or pictures, I just create a filesystem and use it.

At first glance the ZFS filesystems look like folders, but they are much more powerful than that, as you can set quota’s, reserve space or set permissions to easily restrict or reserve disk space as you see fit, with the ability to change any of those parameters at will. No more remembering LVM commands, waiting for partitions to resize and tense moments waiting to see if all your data is still there after the changes!

The downside is it isn’t available out of the box in any linux distro as it’s open source licence is incompatible with the licence of the Linux kernel. This restriction doesn’t apply to OpenBSD which now does support ZFS with NAS distributions like FreeNAS now having ZFS support built in.

To install ZFS on Linux there are several options, you can download and compile from source the Solaris Porting Layer (SPL) and ZFS file system. Or, as I did in my case, add the ZFSonlinux repository to Proxmox (which is a Debian-based platform) and install.

That pretty much covers the software choices, whilst it’s not recommended to use the underlying Debian platform of Proxmox, some services make more sense to do this way, especially with ZFS since you don’t want additional software layers between you and the files on the ZFS store, for this reason the underlying file shares, as seen by the other machines on the network are managed by ZFS’s integral NFS sharing (for sharing to Linux machines) and Linux’s SAMBA (for sharing to Windows).

All other services will be virtualised through Proxmox-managed virtual machines, e.g. Vortexbox, a superb media sharing platform supporting the Logitech Squeezebox Server platform and the equally awesome Subsonic which I use to give access to my music collection via my mobile devices.

There will be a couple of Linux VM’s running Minecraft servers to keep my two boys happy when playing with their friends.

The only other software package I’ve added is Webmin which brings another nice Web-based UI to day to day server management, from this you can add / remove users, monitor hard drive SMART data (using smartmontools), add cron jobs and much, much more through it’s extensive plugin module system.

That wraps up the software choices, the next installment will cover the technical details of set up and configuration, along with some foibles I discovered that will hopefully save others some work if they take this path themselves.

This entry was posted in Engineering, Gadgets, Linux, Music, Streaming, Technical. Bookmark the permalink.

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.