Homelabbing: first steps
This post describes my recent work on setting up my Proliant Microserver. I bought this machine because at the time it was very cheap and I wanted a NAS. It has four 3.5 inches drive bays on the front but I only used one until recently.
This post will cover the reasoning behind my work and provide a reference for the future when I need to fix the damn thing.
RAID: software or hardware
The first thing we want to get done with is RAID. RAID is a strategy to preserve your data in spite of disk failure or get better throughput.
My use case is preserving my data and there are only two ways to do RAID that are available to me. Software RAID is implemented by a program running on the machine and hardware RAID is implemented by a storage adapter card.
I have chosen to buy a Host Bus Adapter instead of a RAID controller because I don’t have performance needs that warrant hardware RAID 1 and disks managed by a RAID controller are then bound to that controllers. That means that when the RAID controller will stop working I will need to buy a replacement to access my data.
Using a Host Bus Adapter instead means that I always retain access to my data and I can upgrade it to better hardware transparently.
The choice for this build is a H222 Host Bus Adapter. This storage adapter is listed as compatible with my Microserver and has a nice mini-SAS connector accessible from the outside of the chassis. While you can buy a compatible storage adapter from other vendors none has this external connector so you can only connect the four internal drives to it.
I feel like I won’t need to use the external connector but it’s nice to know it’s there when I will need it.
LVM or BTRFS
Now that we have chosen to do software RAID there are only two choices I am comfortable with: LVM and BTRFS. Both LVM and BTRFS are able to fulfill my need of a single logical volume spanning the four physical disks with a RAID10 setup.
Because I am already using BTRFS for my laptop’s root filesystem it makes sense to use BTRFS on this array as I will have the opportunity to store snapshots from the laptop directly as subvolumes.
The alternative to having one of LVM or BTRFS is using both. I can use LVM as the volume manager providing RAID and BTRFS as the snazzy filesystem with snapshots and checksums. I’m not sure which are the advantages of this combination so I will not use it.
I have chosen to go with RAID10 for data and RAID1 for metadata. Eventually I will learn enough to move the metadata to an SSD for better performance but right now this will do.
Over the years I always used consumers disks and I could not give a crap about them. The bigger and the cheaper the better. For this build instead I have chosen to splurge a little and buy fancy disks.
The motivation is reliability and economic return. If I get more hours out of the drives then the extra I pay now for fancy disks is very little.
The previous drive I had used in this NAS was a hand-me-down from a desktop I had
and the SMART test report tells a very sad story. All the SMART attributes are
Pre-fail with reason. This poor disk was listed
with a Power-On Hours value of 2400 on the datasheet and we are already in
the 4000 range on my device. Goodnight little disk that could.
Knowing this number though we can actually plan for our new disks. I expect to
use this array for the next
n years or so and therefore I will need a
n * 365 * 24 power on hours value on the datasheet2.
A very quick table and here we can see that desktop drives are doomed.
No matter how cheap I can find them using desktop drives is an unfeasible solution. The reasonable choice is to get something more resilient and durable. Something for which working 24/7 is not as deadly.
There are two options available to me now. I can buy consumer grade NAS disk or enterprise grade disks. I have chosen to buy enterprise grade disks because they can be bought for cheap used. How cheap is mind boggling: I have bought a lot of five Seagate Exos 7E8 4TB used disks for the price of one new.
Obviously these disks have been used extensively already. All the disks have been powered on for more than 24k hours but all have an expected lifetime of around 43k before the warranty expires! And even though the Backblaze report says Seagate drives have the highest annual failure rate I feel they were a good deal for the price.
Choosing these drives was also the reason for buying a Host Bus Adapter. The drives are available in both SATA and SAS variant but SAS drives were by far cheaper. Without the Host Bus Adapter I cannot use SAS drives while SATA drives do not require it.
I expect to upgrade this array in about three years when the hardware refresh cycle kicks in and (I hope) 8TB drives will be available for cheap.
It’s amazing how easy it was to complete this project and I feel it was actually easier than putting together a desktop PC.
The microserver is described fully by the HP Proliant MicroServer Gen8 User Guide down to where the cabling goes. It also describes the possible hardware options and their installation.