Wednesday 11 September 2019

Creating My Own NAS - Part 1: FreeNAS

For the last five or so years, I have been happily using a Synology DS215J NAS on my network to handle all of my off machine storage.

I love this device, it can accommodate two SATA drives in a number of RAID configurations to ensure that your data is securely stored. Right now, I use mine to archive important files as well as to act as a media server.

Synology provides an OS environment on the device itself that is highly configurable and one that has an active ecosystem of first and third party plugins to further extend the capability of the device itself. For instance, you can quite happily use this device as a full blown webserver, running PHP and POSTGres or as a CRM portal using Sugar, the choice is extraordinarily large.

For my needs, I make use of the media server plugins, this serves up all of my music and video across my network and any other device that can connect externally. I also have a cloud storage plugin that allows the device to connect to my various cloud storage solutions, OneDrive, Google etc, and sync files between these locations to ensure that I never lose my important data.

However, I have found myself in the position where I would like to upgrade my current solution in order to add more disks - I can have a max of two, and to increase the performance of the media capabilities - the CPU and resources on the box often get maxed if there is a lot of trans-coding.

I would have liked to buy a more capable version from Synology, but these things start getting expensive when you want to have more expansion options for disks and I just cannot justify spending that amount of money out for a device like this when I have other things I could spend the money on.

After doing a bit of investigation into other products I learned of something called FreeNAS. This is an open source storage OS specifically designed for, well, storage. It is intended to provide a complete and fully featured OS that supports NAS operations. All you need to bring to the party is your own hardware and you are up and running. This is an important point to note - in many consumer NAS solutions, you mainly get a rather under powered desktop PC that has been adapted for use as a NAS, for example the CPU in my DS215J is a Marvell Armada 375 Dual Core running at 800 MHz, it also has just 512MB of RAM. This is pretty weedy, even by the standards of five years ago.

The comparable model available now is the DS218+, which is a significant upgrade on my model and comes with a dual core Celeron running at 2.5Ghz and 2GB of RAM, a massive increase compared to what I have now - but this still has the same physical limitations as my current model with almost no ability to upgrade the memory or connectivity.

Now, FreeNAS allows you to install the OS on pretty much any hardware that is supported - you could run this on an old desktop PC that has IDE drives if you wanted to and it would work as a NAS, albeit a slow one by today's standards - but the upshot is that you get the sensibility that comes with a PC.

Like pretty much any guy of my age, I happen to have an old PC lying around - it serves as a stand for a lamp at the moment. I haven't used it in years, as far as I can remember it has an AMD Athlon CPU in it and what was a very capable graphics card from the mid-2000s. However, I dont plan to use any of that gubbins, I am interested in the case, its all aluminium and black (no windows, not that tacky) and takes a full sized ATX board. So I plan to gut this and source a second hand server motherboard to act as the basis for a new NAS build, one that should be able to take full advantage of the technical features available to FreeNAS as an OS.

FreeNAS itself is an OS based on FreeBSD, which doesn't need that much explanation for the purposes of this article. It also offers a number of features you would find on any enterprise level storage OS component, such as full disk encryption, RAID and backup that is compatible with many different providers. Additionally, it is based on the ZFS file system, which means it can handle snapshots and replication - again these are things you would find in any serious enterprise storage solution, but are neatly delivered to the hobbyist here.

As a result of this, it is possible for someone to create a custom NAS on their network at home that can handle all of the file-sharing, media serving, backup and replication that might be needed to keep an entire families worth of devices running hassle free. Not only that, but due to the fact you can install this on off the shelf hardware, the extensibility of the solution is only limited by your own finances and imagination. My current NAS has one gigabit LAN connection, but the new one I am about to build, why not throw in two 10GBE connections that are teamed? Probably wont do that though, lol.

So, for this little project I pretty much have everything I need to get started. I have a case and all the optical drives/floppy drives I need. I might need a new PSU, but I am going to get the following:

1 x server motherboard: This will be a second hand one from eBay. Nothing too old, but nothing too expensive either. This is my first time doing one of these builds, so I will refrain from going full on and getting a stupidly fast system, given that I dont need one so powerful.
1 x SATA controller: depending on the motherboard I get, I might need to obtain a SATA controller. This could be the case if the motherboard I get is not young enough to have this on board, right now I am assuming that whatever I get will support SCSI under RAID - but I dont have any SCSI drives (but I do have a stack of SAS drives...) plus SATA is a better choice for future drive upgrades. I may also want to have an NVME solution in here as well to boot from, this is something I will need to consider.
2 x CPU's: I am getting a server motherboard, so why not try getting a dual socket one? I was a teenager in the 90's, so I can remember the dream of owning a dual CPU PC for gaming back in the day, I know I dont need two CPU's these days but doubling up the chip count will also double my core count. This seems like an economical way of getting as much performance out of the setup as I can.
RAM: I have some RAM now, but I dont know if it is going to be suitable for this build, so depending on the motherboard I get, I made need more. But right now, I think I have 4GB of RAM that might be suitable for this.
HDD's: I have a stack of SATA drives I can throw in this baby from the get go. Most of them are 500GB drives, which will be fine for testing and getting the set up correct. I also have one 1TB drive I can throw in as well, but it will all depend on how the build will go and what sort of SATA controller I will end up getting, i at all.
1 x PSU: I have an ATX PSU right now, but I have no idea if this will be suitable for the build, so probably I will need to get another.

The first component I will source is the motherboard, this will pretty much determine the overall specification of the device and how much money I will need to spend on other components for this project. I want to keep the price as low as I possible can, naturally, so it will be scouring eBay for me until I find something suitable.

Part 2 should follow this one pretty quickly and will focus on the motherboard search.

No comments:

Post a Comment