I'm planning on building a desktop soon, but one of things I wanted to do first was build a storage server. I'm calling this a NAS, but it might be more correct to say networked DAS. At any rate, I want a central place to store my files, which are currently scattered across my laptop, homeserver, raspberry pi, external hard drive, and various USB drives. In building the NAS, I want to know the files I put there will be safe from mechanical failures and silent corruption. In addition to hard drives failing, digital storage has a scary failure mode. Here's the 3 main safeguards you should consider using to protect the data you care about most:
Safeguard | Example | Failure Mode |
---|---|---|
Redundancy | RAID, RAIDZ, backups | A hard drive dies |
Integrity | zfs, btrfs | Bit Rot |
Versioning | versioned backups, zfs, btrfs | You delete a file |
Many people have heard about RAID, but fewer are aware of Bit Rot. It's not very common, since hard drives have some built-in error correction, but it's still possible, and can be devastating for even a single bit flip depending on the exact circumstances. After reviewing various options, I settled on ZFS with RAIDZ2, which has all 3 features baked-in, and a very easy deployment process that lends itself to set-it-and-forget-it. It also has easy to use quotas which is good since I intend to share some storage with my friends.
For the hardware, I settled on a 6x4TB hard drive array in RAIDZ2. In exchange for reduced usable storage space (in my case 24TB became 14TB), RAIDZ2 means up to 2 hard drives can fail without any data loss. If a hard drive fails, you can just plug in a new one and ZFS automatically populates the new drive and restores redundancy. I picked the drive size and number based on my desired storage size (minimum 10TB) and the cost/TB of the drives. Based on various recommendations online, I went with WD Red drives. The rest of the hardware was chosen based almost solely on cost.
Item | Model | Price | Quantity | Total |
---|---|---|---|---|
RAID drive | WD Red 4TB HDD | $124.99 | 6 | $749.94 |
Spare drive | WD Red 4TB HDD | $124.99 | 2 | $249.98 |
System drive | Silicon Power 128GB SSD | $38.99 | 1 | $38.99 |
Case | Antec 302 | $64.96 | 1 | $64.96 |
Motherboard | GIGABYTE GA-B250M-DS3H | $59.99 | 1 | $59.99 |
CPU | Intel Pentium G4560 Dual-Core 3.5GHz | $58.99 | 1 | $58.99 |
RAM | Crucial 4GB DDR4 2400MHz | $47.45 | 1 | $47.45 |
Power supply | EVGA SuperNOVA 550 G3 Gold 550W | $85.99 | 1 | $85.99 |
Fans | Corsair HSP 120mm Purple LED 2 Pack | $23.99 | 1 | $23.99 |
Fan power cable | ModTek Molex to 4x3pin Fan | $8.99 | 1 | $8.99 |
PCIe SATA card | IO Crest PCI-e x1 4 Port SATA III | $39.89 | 1 | $39.89 |
SATA cable | Monoprice 18in SATA III 10 Pack | $14.99 | 1 | $14.99 |
SATA power cable | StarTech 4x SATA Power Splitter | $5.85 | 2 | $11.70 |
Operating System | Ubuntu 18.04 | $0.00 | 1 | $0.00 |
TOTAL | 14TB RAIDZ2 NAS | $1455.85 | ||
(excluding spare HDDs) | $1205.87 | |||
(excluding all HDDs) | $455.93 |
Some comments on the items:
- Case — I was extremely happy with this case; cable management was awesome, it's sturdy, and it's cheap to boot
- Power Supply — since this box will be on 24/7, I wanted a gold-rated supply, and I was quite pleased with the cables this one came with
- Fans — the 6 drives are packed together pretty tight in the front of the case, so I got 2 extra fans (Corsair advertised them as HSP "High Static Pressure" for cramped areas, but I'm unsure how necessary that is)
- PCIe SATA card — the motherboard has 6 SATA ports, so I needed an extra in order to connect the SSD; my intial intention was to scavenge parts from my homeserver (area11) hence the 1x channel width
After getting it up and running, I ran the long SMART test and destructive badblocks (the latter inside screen sessions) on each drive to appease my paranoia (all tests came back clean as they should for brand new drives):
sudo smartctl -t long /dev/sdX
sudo badblocks -wsvo diskX-bb.txt /dev/sdX
sudo smartctl -t long /dev/sdX
It was then affectionately dubbed trichiliocosm in honor of one of Zoro's attacks from an episode of One Piece (kudos @glenn for the suggestion). Photos:
Further reading: