Imran's Blog
Stuff I feel like blogging about.


Upgrading my home server

Posted on

Like most nerds I have a home server that I use to serve media (via Plex) and maybe host some personal projects.

# History

I built the first version of my server (I think) about 8ish years ago. It's a simple and cheap setup. The OS ended up being ubuntu server since it had been quite a while since I dabbled in setting up a distro from scratch. This was the fastest way to have something up and running. For storage the OS was on a small SSD plus a 3 TB hard drive for the data. It had some ASRock motherboard that had a processor built into it and some negligible amount of ram. It wasn't powerful but it got the job done. It also started to struggle when streaming shows in 1080p.

The first upgrade was changing the OS. Though this isn't an "upgrade" I guess. I switched to using arch instead of ubuntu since a rolling release distro is less hassle to keep updated.

The next "upgrade" was switching from manually installed services to docker. There was a two reasons for this:

  1. I wanted to learn about docker
  2. I had two python applications that started having clashing versions of dependencies

This was my first foray into using docker and was quite pleasant. No more clashing dependencies and became a lot easier to bring up new services. Not to mention it helped increased the reproducibility of the server.

A couple years after that I got a i7 4790K + motherboard combo for a decent price. This was my first major upgrade to it, no longer did it struggle to stream 1080p videos.

A little while later I upgraded the ram to 16 GB because why not? And soon thereafter I had to upgrade the storage drive since 3 TB was not cutting it anymore.

I managed to grab five 3 TB Western Digital NAS red drives on sale during black Friday. I decided to go with use a software raid, a coworker recommended ZFS so I went with that. Creating a zpool with raidz1 was straight forward.

# The present day

I have started running out of space on the zpool. For this upgrade I decided on shucking some hard drives since it's hard to get regular hard drives at a competitive price. For those that do not know what "shucking a hard drive" is, it's when you buy an external hard drive and rip it out of its enclosure. The drives in these are typically "white label" drives but are still regular drives, just cheaper.

I ended up getting five 14 TB WD easystore drives. All ended up being white label EDFZ drives. I ran badblocks on them and verified there were no bad sectors.

The next step was figuring out how I was going to transfer all my data off my old zpool onto this new one. For reference my motherboard has 6 SATA ports, which are all in use. One for the SSD and the other five for the 5×3 TB zpool.

I decided to keep all the USB connectors on the drives attached as the motherboard had plenty of free USB ports. This simplified the transfer process quite a bit.

zpool create new_pool raidz <new drives>
zfs snapshot old_pool@now
zfs send old_pool@now | zfs recv -F new_pool
zpool export old_pool new_pool
poweroff
# After powering back up
zfs set mountpoint=/old_mountpoint new_pool

In order these commands do the following:

  1. Create a new zpool out of the new drives
  2. Create a snapshot of the data on the old zpool
  3. Send that snapshot over to the new zpool
  4. Let ZFS know I intend to physically disconnect both pools
  5. Turn off the machine
    1. This lets me remove the USB adapters for the new drives and plug them in via SATA after disconnecting the old drives.
  6. Change the mountpoint of the new zpool to be the same as the old zpool so applications can't tell the difference

I lucked out and singular drive out of the five needed to have the 3.3v pin taped over. For why that was necessary I recommend watching this video: https://www.youtube.com/watch?v=1YqMn1pCRd8

I super hope I do not have to upgrade again anytime soon!