The Brilliance of Linux

This is an old post!

This post is over 2 years old. Solutions referenced in this article may no longer be valid. Please consider this when utilizing any information referenced here.

I’ve been a Linux user for many, many years. Going all the way back to Red Hat 5.2, which I picked up to install on an ancient Packard Bell 486 in the late 90s. Since then there’s always been at least one Linux machine in my dorm, apartment or house somewhere. At various times I’ve even run it for my desktop OS, although these days I use macOS for that.

For much of that time, Linux was the choice of hackers, but was definitely not a choice for everyday users and required a significant amount of technical knowledge to run. That’s not true so much anymore, but growing in that environment I learned a lot about how computers and operating systems work.

But every now and then, Linux does something that positively delights me.

I have a large fileserver in my closet that runs Plex digital media library among other things. This machine has an SSD for it’s primary drive, and a 5-disk Linux software RAID array. Because I am a part hoarder, while cleaning out my parts closet one day, I realized I had all the parts to build a near duplicate of this machine.

So I assembled the backup machine. On this ancient Athlon motherboard, the SATA ports weren’t labeled, so I just plugged the drives in what I thought was the right order, with /dev/sda being the OS drive, and /dev/sd(b-f) being the RAID drives. When installing Linux on it (Ubuntu 16.04), it detected them in a seemingly random order, so the OS drive was /dev/sdf and the rest of the drives were the array. Guess I got them reversed. Meh, whatever, I’ll just configure it that way.

So I took it to work to allow it to be an offsite backup in case tornadoes destroy my house. I set up rsync to replicate nightly between the two, and everything was good!

… except that ancient motherboard had some issues. Anytime it lost power for more than a few minutes, it would throw CMOS Checksum Errors on the BIOS. I figured this was a bad CMOS battery, so I replaced the battery, but no dice. And because this board is 10 years old, good luck getting support on it.

So over Black Friday, I scored a good deal on a new motherboard. Added in some memory and a power supply that doesn’t sound like a jet engine (how did I deal with this in 2006?) I had a totally new machine. I intended to just use the existing hard drives with the new machine.

So I took the old motherboard and power supply out, leaving just the drives, and installed the new one. On the newer motherboard, the SATA ports were actually marked, so I installed the SSD on port 0, then the drives in top-top-bottom order in the remaining ports.

I was fully prepared to reinstall, but I decided, what the heck, let’s boot this thing up and see what happens. So I turned it on.

And it booted Linux. With almost no problems. All the way to the login screen. And when I logged in, even the RAID array was there, in a clean state, completely ready. Literally the only thing that didn’t work was the network card, and once I ran dpkg-reconfigure on the linux-image and fixed the /etc/network/interfaces even the network card came up.

Mind = blown. I literally rebuilt this entire machine, and it came back up like nothing happened.

The disks coming up was the coolest part of all. What was /dev/sdf on the old machine was now /dev/sda, but both the system and the RAID array were aware of this change. And, after a bit of research, the reason I concluded was because both don’t use node numbers anymore, but UUIDs or another type of ID. A quick glace at /etc/fstab will show something like this:

# / was on /dev/sdf3 during installation
UUID=baa30826-d0dd-49e0-b3eb-21751accc1bf /               ext4    errors=remount-ro 0       1
# /boot was on /dev/sdf1 during installation
UUID=078a7b64-0b84-4747-a07f-7bb74470385d /boot           ext4    defaults        0       2
# /mnt/storage was on /dev/md0 during installation
UUID=a988ff4c-1489-44d2-ac4d-bd24cdc70829 /mnt/storage    ext4    defaults        0       2
# swap was on /dev/sdf2 during installation
UUID=e22b8588-b9fb-422f-a479-d79e3ae50cba none            swap    sw              0       0

And some research seems to show that Linux mdraid uses metadata and not node numbers to assemble the array, so you can reassemble it in any order. Brilliant.

About the Author

Hi, I'm Rob! I'm a blogger and software developer. I wrote petfeedd, dystill, and various other projects and libraries. I'm into electronics, general hackery, and model trains and airplanes. I am based in Huntsville, Alabama, USA.

About Me · Contact Me · Don't Hire Isaiah Armstrong

Did this article help you out?

I don't earn any money from this site.

I run no ads, sell no products and participate in no affiliate programs. I do not accept gifts in exchange for articles, guest articles or link exchanges. I don't track you or sell your data. The only third-party Javascript on this website is Google Analytics.

In general I run this site very much like a 1990s homepage or early 2000s personal blog, meaning that I do this solely because it's fun! I enjoy writing and sharing what I learn.

If you found this article helpful and want to show your appreciation, a tip or donation would be very welcome. Feel free to choose from the options below.

Comments (0)

Interested in why you can't leave comments on my blog? Read the article about why comments are uniquely terrible and need to die. If you are still interested in commenting on this article, feel free to reach out to me directly and/or share it on social media.

Contact Me
Share It

Interested in reading more?


Creating a Multiboot USB Stick under macOS

Here’s a quick article about how to make a multiboot USB stick under macOS. These are useful in a lot of situations - such as for doing system installs or system rescues - because you can boot a wide variety of live OSs from a single stick. There are a lot of guides out there for doing this on Linux, and a lot of software for automating it on Windows, but not a lot of guides for doing it on macOS. Fortunately, it is pretty straightforward as the instructions will be broadly similar to doing it on Linux.
Read More
Home Assistant

Securing Home Assistant Alexa Integration

One of the big missing pieces from my conversion to Home Assistant was Amazon Alexa integration. It wasn’t something we used a lot, but it was a nice to have. Especially for walking out a room and saying “Alexa, turn off the living room lights.” I had been putting it off a bit because the setup instructions are rather complex. But this weekend I found myself with a couple free hours and decided to work through it. It actually wasn’t as difficult as I expected it to be, but it is definitely not the type of thing a beginner or someone who does not have some programming and sysadmin background could accomplish. But in working through it, there was one thing that was an immediate red flag for me: the need to expose your Home Assistant installation to the Internet. It makes sense that you would need to do this - the Amazon mothership needs to send data to you to take an action after all. But exposing my entire home automation system to the Internet seems like a really, really bad idea. So in doing this, rather than expose port 443 on my router to the Internet and open my entire home to a Shodan attack, I decided to try something a bit different.
Read More
Home Assistant

Migrating from SmartThings to Home Assistant

I have been a SmartThings user for many years. The orginal reason was that, when we bought our current house in 2012, I wanted to turn the eave lights on at sunset and off a few hours later. After a short attempt to use Wifi-based Wemo switches, I settled on SmartThings and GE Z-Wave switches. I was so happy with it that I started putting them in more places. I added Kwikset SmartCode keypad locks and door sensors. I added more switches, like to turn on the garage overhead lights when the doors opened. I added sensors to monitor the temperature in the closet where I keep my server. And for many years this setup worked great. But over the last year, and especially since Samsung acquired SmartThings, I have become increasingly disillusioned with the SmartThings ecosystem. This last week, my disillusionment and frustration finally boiled over, and I migrated to a new platform. So why did I abandon SmartThings?
Read More