How not to build a home server

I had decided that I needed a NAS (Network-Attached Storage device) to store files on and maybe do some light hosting of services with. The process of figuring out how to do this while broke ended up being a fun and silly story.

Where to start?

I had been piggybacking off my familys Synology DS920+ for a few years at this point. To put it simply, Synologys software stack is fantastic; they’re basically the Apple of the NAS world.

Unfortunately, their extremely popular DS920+ was replaced somewhat recently with the DS923+, a replacement entry that gives an anemic Intel Celeron J1425 the boot in place of a small AMD CPU. The issue with this is that the AMD CPU lacks a GPU, which means no video transcoding and no possibility of expanding it to do so. Considering the removal of features, no way to purchase the old unit, and the fact that Synology had recently become more Apple-like in terms of hostility (for instance, removing the ability to view SMART info to check on ailing drives) I was hesitant to spend $600 on a device that didn’t come with drives.

And I didn’t have $600 at the time anyway. I was broke.

So what else was out there? I needed something that was easy to maintain. I wanted to be able to click on things, not type commands; I already run Arch, I spend enough time maintaining a system that’s barely held together by typing memorized commands. Watching my peers get consistently screwed over by their TrueNAS builds made it clear that software wasn’t an option. It seemed it was Synologys way or the highway for my use case…

Until I was told about Unraid.

Unraid is a paid NAS operating system. It is, to be blunt, really good. Unraid starts with Linux and builds on it with an impressive hybrid RAID scheme that protects against data loss and allows you to mix and match drives. As we’ll see shortly, it stands up to even the most torturous scenarios without losing a single byte of data. In addition to this, it provides a massive collection of community built Docker images, which usually allows you to install any software you want without issues.

Unraid was cheap– they just doubled the price of a license. But the old price of $125 was a price I was somewhat capable of digesting at the time. So I downloaded a 30-day free trial and set to work.

But where else to start?

Having not purchased a Synology NAS, I still needed hardware, and I’d have to make do with what I had because I didn’t have the funds to buy anything else!

So what did I have? Well, with my desktop inaccessible at the time, I had… My main laptop, and a bin full of old tech. What was in the bin? Apparently, none of the many NVMe drives I had accrued in recent years, those had all gone missing… But I did find one Lenovo Yoga 720 laptop, a ThinkPad Thunderbolt 3 dock, and six flash drives, SD cards, and SD card readers of various capacities.

If you see where this is going, groan now.

I plugged in all the flash drives to the Thunderbolt dock. Then, I booted up the Unraid trial and set the largest flash drive (256GB capacity) as the Unraid parity disk, the drive that does the magical syncing operations to protect your data. Finally, I set all the other disks to be data drives that stored files, clicked “start array”, and crossed my fingers…

It worked. The array came up, I saw a new network share in my file browser, and I was able to copy files on to the disks. By no means was it fast— I could see the moment it started writing files to the SD card after the flash drives filled up when the transfer speeds dropped to a crawl– but it did work, and that’s seriously impressive.

This image feels like the perfect representation of this blog.

I use Immich to back up and view my photos. Immich does machine learning on the images you give it to let you search by people and objects; however, it was truly painful to watch the i5-7200U in the Yoga try to handle the 10,000+ photos and videos from the last two decades, so I temporarily shut the system down, unplugged all the drives, then plugged them all back in to my good laptop and booted up the system that way. Unraid did not care. The licensing scheme of Unraid is tied to the flash drive it’s booted from, and as long as the drives it expects are present, it will happily boot up on anything you plug it in to.

The Ryzen 7 5850U in my laptop made short work of the images, but I needed my laptop back (4GB of RAM in the poor Yoga is too small for basic computing tasks anymore… Thanks, “modern web”) so I reversed the process, and on the system ran for a few more weeks.

It gets worse

Things weren’t cursed enough, and ~660GB of usable storage on flash drives wasn’t enough to store all my files, so I did a second revision. At this point, I had a few more dollars and access to an electronics store, so I decided to buff the storage of the build. I found a clearance Hynix 1TB NVMe SSD for $55 and a USB-C NVMe enclosure for $30. I also finally found my own NVMe drives two days after purchasing that one, so I added a 512GB NVMe disk to the laptops internal slot. Then the fun part: I found two 2TB hard drives on Craigslist for $50. They even came with an enclosure!

And the enclosure was a Thunderbolt 2 enclosure!

That’s right, I purchased a G-Technology G-RAID 2-Bay Thunderbolt 2 enclosure, from the early 2010s, for use in my NAS setup, which demands absolute reliability of disks. What could possibly go wrong?

Well, a lot. Thunderbolt is a term most tech-y people have heard by now, but most people probably don’t know what it is. It’s a physical connection layer that allows one to tunnel PCIe traffic over a USB-C cable. PCIe is really great– it’s very fast and extremely flexible. There’s a reason it’s been the standard connector in desktop parts for over 20 years now. PCIe is also how all NVMe drives talk to the host computer. It’s pretty great!

Thunderbolt is not great.

Anyone who’s used Thunderbolt in more than a passing capacity knows exactly how much it sucks. The main use for Thunderbolt is a “universal” docking station that works with any Thunderbolt-enabled laptop. But trying to use this docking station inevitably leads to it not working for some reason or another. Incompatibility with monitors, glitchiness, having to plug it in two or three times to work, random disconnection of devices… It’s a perfect mess that, while definitely better than its predecessors (proprietary docks for all manufacturers) is by no means good.

And that’s for its main use case. What happens if you do step outside the common grounds? Well, things get ugly.

There’s a really good rant by Cathode Ray Dude about what exactly is wrong with Thunderbolt. He explains it better than I ever could, so read it here.

Personally, for a while I was a Thunderbolt enthusiast. I truly believed it was the future, and that everything would connect over Thunderbolt; all other connectors would be things of the past. I bought a Thunderbolt PCIe add-in card for my desktop, and connected my graphics card to it so that I could use my Thunderbolt dock with my desktop.

What that caused in practice was a never-ending string of kernel panics and a consistently hot lump of a docking station always consuming power next to my desktop, tunneling devices that I already had ports for right next to it. I managed to get the setup mostly stable for eight months, but after some update or another broke it once again I finally took the whole thing down and just plugged the ports directly in to the tower like a normal person.

Coming back around, why was this enclosure a problem? Well, not only is this a Thunderbolt device, it’s a Thunderbolt 2 device. This was an older version of the spec that only showed up in Macs before Intel sold their snake oil to the entire world with Thunderbolt 3. TB2 uses the mini-DisplayPort connector, and Apple sold TB3->TB2 adapters with the release of TB3. One of these was included in the Craigslist posting, so I was able to connect it to the daisy-chain port of the Thunderbolt dock no problem.

Praise RNGesus, will he forgive me for this unholy abomination?

Let’s review the setup now:

  • Lenovo Yoga 720
    • 512GB NVMe disk connected internally
  • Thunderbolt 3 dock, connected to
    • 6 flash drives and SD cards of varying capacity
    • 1TB NVMe disk
    • Daisy-chain Thunderbolt connected to
      • Thunderbolt 3 -> Thunderbolt 2 bridge chip connected to
        • Two 2TB hard drives in a Thunderbolt 2 enclosure

Did it work?

No

Things seemed fine for a couple days. Then it started crashing.

At random, one or more drives dropped off the PCIe bus. At first, this seemed like a random event, probably from someone bumping into the whole physically weak mess. (This was all over a few cords, and the Thunderbolt bridge chip required fiddling to show up at all!)

Then it happened a second time. And again. And again. The internal NVMe disk always disconnected. Sometimes accompanied by the 2TB disks dropping off. Either way, any filesystem error (rightfully) took all of Unraid down.

Without having ever taken a picture of the original error message, I can’t say what exactly caused it. But my best guess is that the PCIe and Thunderbolt controller in the laptop just couldn’t keep up with the massive amounts of traffic going through it. After all, this was a mid-range 2017 consumer-grade laptop that was designed for planned obsolescence with its 4GB of soldered RAM and flimsy shell.

Now here’s the truly hilarious part– I borrowed another laptop and a desktop to desperately get the setup working again, reasoning that a better built computer would have a more functional Thunderbolt controller.

The laptop refused to recognize the hard drives.

The desktop refused to POST with them attached.

At this point, I started rolling on the floor with disbelief-struck laughter. . A single consumer-grade laptop from 2017 was able to recognize these drives connected via a supposedly universal technology, and more powerful computers either ignored them or keeled over with them attached. I can’t fathom how the developers and implementers of Thunderbolt messed up this bad.

Let’s step back to consider something incredible. In the face of all of these crashes, movement between computers, disconnected drives and loads more crap I probably didn’t even notice (for instance I am vaguely aware that the Unraid logs were spammed with PCIe transaction errors during the 6 flash drives phase) I did not lose a single byte of data. Throughout all of this insanity, Unraid kept my files safe, by both generally being really robust and then by taking advantage of its RAID scheme when drives cause problems. I’m very impressed by it, and it’s why I genuinely feel safe using 2TB drives from over a decade ago off Craigslist. I simply don’t think that they could cause data loss because of how potent Unraid is.

OK, let’s do this right

I still didn’t have enough money to build a whole computer, although I had bought my Unraid license at this point. Fortunately, in the middle of this story, I moved to an area where e-waste is freely collectable at designated points. This is pretty uncommon for the U.S., which prefers to keep used tech out of the hands of anyone who can find a good use for it, because of course we do. In any case, after some digging, I put together a desktop build with an Intel Core i5-6500 and all the drives previously mentioned simply directly connected to the motherboard. Because I didn’t find a case that wasn’t incredibly beaten up, I simply reused the drive enclosure to shelter the hard drives and stuck the rest of the build in the box for my Valve Index.

Wouldn’t you know it, directly attaching disks using normal connectors we’ve used for decades worked without a hitch. After initially copying off all files from the flash drives to the new drives, the final setup has been running nonstop with no trouble for about a month now. I will likely upgrade the system again in the future to something with more oomph and less power consumption, but this works perfectly fine until that day.

It doesn’t have a power button, so when I turned it on for the first time I bridged the power pins with a screwdriver. lol

Conclusion

The simple answer is usually the correct one. If I didn’t live in an area that allowed its people to dig into the trash, I probably would have waited a bit longer and purchased a used Dell Optiplex, which costs $100. (The linked post is a hoot, I recommend reading it.)

I run a few web services for my friends and family now. Anything I can imagine needing is freely available from the Unraid App store. I won’t turn this into an article on how to set up e.g. reverse proxies and the like, but the search terms you’re looking for are Cloudflare and Nginx Proxy Manager.

I hope people enjoyed this foray into how not to build a home server, how to build a home server, and why no one should ever use Thunderbolt. The end.


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *