diff options
author | Ryan Schanzenbacher <ryan@rschanz.org> | 2022-01-13 16:05:38 -0500 |
---|---|---|
committer | Ryan Schanzenbacher <ryan@rschanz.org> | 2022-01-13 16:05:38 -0500 |
commit | 9014c45d81ec44d6124727262e432f236f2096b9 (patch) | |
tree | 9b32d0a16b97633d13fdf51251fe90242d3f80e2 | |
parent | 6a044c8d316a8f6004f28b7e95986895354fd598 (diff) |
media server article rev 1
-rw-r--r-- | content/about.md | 2 | ||||
-rw-r--r-- | content/media_server.md | 22 |
2 files changed, 21 insertions, 3 deletions
diff --git a/content/about.md b/content/about.md index a2fb98e..1ba7036 100644 --- a/content/about.md +++ b/content/about.md | |||
@@ -29,5 +29,5 @@ Now, after some amount of time, I decided to remove the WUBI install because it | |||
29 | 29 | ||
30 | ### Taking the plunge | 30 | ### Taking the plunge |
31 | 31 | ||
32 | So I used this setup for some time, probably until like mid-2011 or so. I kept using both OSes, though my Windows XP install was just taking up space for not a lot of use. I couldn't really do too much on it anymore, so I eventually decided to just take the plunge. I put everything I needed on on a USB drive, and just reinstalled everything on the PC, this time choosing "Use this entire drive for Ubuntu." Goodbye Windows! I realize I probably didn't need to reformat my entire computer to do this, but at the time this is how I knew to do it. Ever since then, I don't think I've had a permanent Windows install on a computer. I've fallen in love with Ubuntu and the ideals surrounding it. Fast-forward to today, I distro-hopped more times than I can count on my hands; all for various reasons. One may have been I preferred the DE of another distro, or Ubuntu didn't have the package I wanted, etc. | 32 | So I used this setup for some time, probably until like mid-2013 or so. I kept using both OSes, though my Windows XP install was just taking up space for not a lot of use. I couldn't really do too much on it anymore, so I eventually decided to just take the plunge. I put everything I needed on on a USB drive, and just reinstalled everything on the PC, this time choosing "Use this entire drive for Ubuntu." Goodbye Windows! I realize I probably didn't need to reformat my entire computer to do this, but at the time this is how I knew to do it. Ever since then, I don't think I've had a permanent Windows install on a computer. I've fallen in love with Ubuntu and the ideals surrounding it. Fast-forward to today, I distro-hopped more times than I can count on my hands; all for various reasons. One reason may have been I preferred the DE of another distro, or maybe Ubuntu didn't have the package I wanted, etc. |
33 | So I probably used Ubuntu, Kubuntu, Xubuntu, Fedora, Puppy Linux, OpenSUSE, and Arch in my lifetime. At the moment, I use Arch on most of my systems, since I can choose pretty much exactly what I want to install. | 33 | So I probably used Ubuntu, Kubuntu, Xubuntu, Fedora, Puppy Linux, OpenSUSE, and Arch in my lifetime. At the moment, I use Arch on most of my systems, since I can choose pretty much exactly what I want to install. |
diff --git a/content/media_server.md b/content/media_server.md index 0d6ab16..605d743 100644 --- a/content/media_server.md +++ b/content/media_server.md | |||
@@ -1,7 +1,7 @@ | |||
1 | --- | 1 | --- |
2 | title: "Home Media Server" | 2 | title: "Home Media Server" |
3 | date: 2022-01-10T08:50:50-05:00 | 3 | date: 2022-01-10T08:50:50-05:00 |
4 | draft: true | 4 | draft: false |
5 | --- | 5 | --- |
6 | 6 | ||
7 | ## Some History | 7 | ## Some History |
@@ -22,4 +22,22 @@ Just this past Christmas (2021), we ran into a breaking point. I was gifted a bo | |||
22 | 22 | ||
23 | ## Planning the Solution | 23 | ## Planning the Solution |
24 | 24 | ||
25 | So, we had this server that had a total of 6TB of storage and 32GB of RAM. This was *more* than enough for our needs. Since we were also looking to overhaul our home network, we decided to work on this as well. | 25 | So, we had this server that had a total of 6TB of storage and 32GB of RAM. This was *more* than enough for our needs. Since we were also looking to overhaul our home network, we decided to work on this as well. Ideally, we wanted to move all of our networking equipment into another room so it was out of our downstairs family room, making it look a lot nicer (and most likely more performant since the modem would be closer to where the coaxial cabling enters the house and we've historically had issues with noisy signal where we have it set up.) |
26 | |||
27 | We took some time to jerry-rig a mount for the server (since we don't own a rack nor have a place for an entire rack) and start preparing to place the server there. While we were coming up with a mounting solution, I got started setting up the server. | ||
28 | |||
29 | ## The Build | ||
30 | |||
31 | As mentioned previously, this machine was a decomissioned server from my dad's office. It was a backup server for their infrastructure in a past life. So, first thing I did was wipe everything off of it to start with a clean slate. Now, we wanted full redundancy with this new setup, so I had to come up with a solution. Since this machine happened to support EFI booting, I used that. Just note that the approach I used would have worked with BIOS booting as well, just some small differences in setup. We had 6 1TB drives that I split into two partitions each. 1 ~500MB partition for the EFI boot files and 1 partition for the rest of the space which would go into the main storage pool. | ||
32 | |||
33 | Now, for full redundancy, I had to make sure *everything* got replicated, because if I just relied on one drive for booting that would be a single point of failure. Since every drive was the same size and partitioned exactly the same I was able to setup two RAIDs to solve this issue. | ||
34 | |||
35 | ## The RAID setup | ||
36 | |||
37 | The method in which we setup our server is a bit unconventional (At least I think, I've never heard of a setup like this before). I used the beginning 500MB partitions as the EFI boot partition, duplicated among all 6 drives using mdadm's RAID1 and **metadata version 1.** The metadata version is the most important part of this setup. By using version 1, you avoid putting the mdadm headers at the beginning of the partition, meaning you can have your filesystem headers at the beginning instead, which is important if the motherboard firmware is to recognize these as proper boot partitions. Since the metadata is not at the front, I simply mounted the `/dev/md0` entry that was created after adding them all to an array and wrote my FAT32 filesystem with the proper flags set to it. Lo and behold, when I went back to look at the separate partitions, they all appeared to be "formatted" using the same FAT32 filesystem with the exact same data. Perfect! Our bootloader is fully redundant. I just added an entry for each drive in the motherboard's firmware so it will just run through all the drives and boot using the first one that's aailable, falling back if necessary. | ||
38 | |||
39 | For the actual operating system, I used ZFS in a raidz1 setup. This is akin to a RAID5 array. It gives you one drive failure before you begin to lose any data. Since I was basing this install on Arch (I wanted to install the least number of packages possible, this is simply a base OS for KVM to manage virtual machines.), I installed the zfs-dkim package from the AUR and let it compile for my kernel. Once it was fully installed, I created the pool using the second partition from all the drives I had available. We were just going to make one big partition that contained the system and the VM images all in one. Once I made the volume that the system would reside on, I followed the Arch install guide just like any other regular install. The only deviations made were for generating the fstab entries and generating the initcpio image. I followed the Root on ZFS guide from the Arch wiki to generate those properly. Once my system was fully installed, I rebooted and..... nothing :(. I booted back into the live usb I created a few more times, changing various settings to no avail. For whatever reason, the Arch initcpio wouldn't automatically mount our root partition and pivot into it. I could mount it manually just fine, but automounting did not work. Case in point, after a few hours, the fix was simple: just add `zfs=bootfs` to your grub boot entry. That solved our issue and we booted right to the OS. | ||
40 | |||
41 | ## Conclusion | ||
42 | |||
43 | This was a really fun project for me to work on over the break. It really got me out of my comfort zone and put me into a new territory of Linux I've never explored before. Coming up with a solution completely on my own, figuring out how to execute it properly, and watching it slowly come to fruition has been very rewrading to say the least. I'm sure at some point we will expand this server again, and I'll probably have to re-learn a lot of things, but hopefully this article taught you (and me when I inevitably have to read through it to figure out what I did) something new :). At the very least, I hope it was an enjoyable read and really put you into my shoes, if not just for a little bit. | ||