ANTONYFB.COM

I am a FreeBSD Noob (a review of Absolute FreeBSD 3rd Edition by Michael W. Lucas)

23 Jun 2024, 7:57 p.m.

Note: I ramble quite a bit in the first few paragraphs. Skip down to "About the Book" if you're not interested in my personal journey towards FreeBSD. You could even skip down to the summary if you find my review of the book too wordy (I certainly do).

In the Beginning, There Was Linux

In the beginning of my Unix geekery, anyway. I started with an Xubuntu VM in which I'd dutifully work through The Odin Project Foundations while my wife was pregnant, hoping to worm my way into a web dev job to make more money for our growing family. Things haven't worked out that way, but I enjoyed using Linux enough to wipe my Windows 10 install and go full-time Ubuntu. And then Slackware. And then Arch. And then Slackware again, where I've stayed on my main machine. My other computers wander a tad more freely. I've used Void Linux extensively, used Gentoo a little, played with Guix and Fedora Kinoite. I even installed FreeBSD 13.1 on a laptop, though it didn't last long. It was when I got myself an old Thinkpad for very little money at the beginning of this year that I decided to really give other operating systems a solid try.

Beastie Toys

I failed rather conclusively the first time I installed FreeBSD. There were too many little things I could never quite manage to get my head around on version 13.1, too many little missing pieces. Or rather, pieces that needed a level of configuration and knowledge I simply didn't have at the time. So when I got my t430 shortly after getting out of the hospital and knew I'd have a few months off work and needed something to keep me busy, BSD seemed like a strong candidate. I started with OpenBSD on my second attempt and had a pretty straightforward, enjoyable experience. A little tweaking here and there got me a very capable workstation, missing only the virtualisation capabilities I'd ideally have wanted. However, given that the Thinkpad I'd bought had a locked BIOS with virtualisation turned off (as well as legacy boot mode turned on), that was really neither here nore there.


For a while, at least.

Paperclips and Hubris

A little Duck-Duck-Going led me onto the idea that it really wouldn't be that hard to reset the BIOS password on my machine by simply shorting the eeprom chip (whatever that is) at precisely the right moment during boot. I spent far too long repeatedly attempting that, and for good measure threw in some extra RAM and a beefier quad-core processor while I had the case off. For some reason it worked, and I was able to switch to UEFI and turn virtualisation on. Great stuff. Except that my OS installs no longer booted due to expecting legacy boot. I'm sure I could have changed some setting somewhere to make it all work, but being me I decided a couple of new installs were in order. One SSD got Gentoo, and the other got the freshly-released FreeBSD 14.1.

RTFMFFS

I was far more confident going into this install that my earlier aborted attempt. There were several reasons for this: I'd actually read the documentation this time, I'd spent enough time in OpenBSD to be comfortable without some of the extra doodads provided by Linux and Gnu, and I'd had a couple of beers. All went swimmingly and I had a working Xfce desktop with all my usual applications (Firefox, Emacs, Zathura, LibreOffice, various utlities) installed and configured by the end of the afternoon. I'd acquired a digital copy of Absolute FreeBSD 3rd Edition from a Humble Bundle sale recently, and so resolved that I'd use it to get to know my freshly installed FreeBSD system.

About the Book

Introduction

The tome clocks in at about 700 pages with no wasted space. It's really a lovely piece of work. Crisp, characterful prose and clear concise instructions. Michael W. Lucas surely knows his stuff and I'll definitely buy more of his work down the line. He begins by introducing the operating system, charting a course from the original Berkely Software Distribution through the gradual replacement of all AT&T Unix components and the Unix Wars all the way to the open source OS of today. The structure of the project is discussed, as are its siblings (NetBSD, OpenBSD, DragonflyBSD, MacOS) and cousins (Solaris and descendants, AIX, even the adopted stepchild Linux). He argues for the strengths of FreeBSD and urges new users to try running it as a desktop system to get to know it better (way ahead of you, buddy). I'll note here that much of the book is aimed at server admins rather than home users like myself, though that doesn't do much to affect how useful I found it.

First Few Chapters

After the introduction, Lucas spends a chapter basically telling the reader to RTFM and then, if that doesn't fix issues, ask for help in ways that won't provoke murderous rage in otherwise reasonable individuals. He points the reader in the right directions (mailing lists, forums, etc) and gives a few tips on asking good questions. Not a bad choice of first chapter, really. After this, chapter 2 concerns itself with preparing to install FreeBSD. There is a sense that one is supposed to follow along with the book, that it's taking you on a journey with the destination being a functioning FreeBSD server with an admin that won't immediately blow it to hell. It's a nice approach, and a part of me wishes I'd begun the book before installing so I could have followed along as intended. Nonetheless, I still got my money's worth and it's solid as a primer and reference manual even without obeying the follow-along aspect.

Chapter 3 concerns the install itself. It's a solid guide and a good complement to the FreeBSD Handbook's section on the same subject. It covers the various options in the installer pretty well, though I would note that the 3rd edition was written with FreeBSD versions 11 and 12 in mind, so some of the details are slightly out of sync with what you might see installing a more recent version. This is not a problem, really. You just need to keep your eyes open and pay attention. You'll find the same issue with the online Handbook, here and there. That's sort of a fact of life with any form of documentation, no? It's out of date as soon as you stop writing it.

The Fun Begins

Lucas takes us on a fun trip through the boot process in chapter 4, ably explaining the various stages and options and taking the time to explain rc scripts and the like. This was one of my favourite chapters, for some reason. I find booting and shutting down bizarrely interesting and I don't know why. Regardless, this chapter is an excellent primer on the subject. From here, we move on to backing up and restoring with a focus on using tar and tape drives. This is not something I'm likely to do for my laptop but it's good to know for if and when I get a home server up and running. Really though, the next chapter is where the money is for me.

Kernel Games, as chapter 6 is aptly titled, is a thorough explainer of kernel tuning and building. It first covers the various options for tuning the kernel both at boot and during run-time. The various sysctls are touched upon and module loading is thoroughly explained. After this, Lucas takes the reader through the process of building a custom kernel from source (while also noting that there isn't usually any real practical reason to do so in the age of laptops with 16+GB of RAM). A good amount of words are devoted to ensuring the reader doesn't bork their entire system with a clumsy kernel build, which is fantastic considering that I will almost certainly make a right pig's ear of it when I try (assuming my early Linux kernel builds are any indication).

And Here's Where I Feel Stupid

Onto networking. Chapters 7 and 8 concern this, and 9 goes over securing the system. These chapters were a real reminder that not having a formal education or any professional experience definitely limits my tech expertise. Luckily, these chapters serve as a solid introduction to networking by themselves, even outside of the FreeBSD context. It's very apparent that I'll need to study TCP/IP in some depth to really round out my self-education, though reading this book feels like a strong start.

The security chapter focuses largely on user security more than anything else. All of this will be largely familiar to anyone coming from Linux. The more interesting security information lays in chapter 19, which goes over packet filtering, encryption, incident response and various other security topics. In particular, learning a bit about FreeBSD's fork of the OpenBSD-native pf feels like a really good use of time.

And The Rest

Christ, this is getting long, isn't it? Chapter 10 concerns itself with disks, partitioning, and related topics. It's a good introduction to the differences between MBR and GPT in general, if that's something you're interested in. 11 is all about UFS and is an essential read, in my humble opinion. 12 moves on to the wonderful ZFS and includes a lot of actionable information concerning snapshots and boot environments. Don't skip or skim that one. You might be able to skip 12 though, which is all about foreign file systems and mounting removable media.

The rest of the book is shared between packages and ports (these chapters certainly deserve to be read carefully), system configuration in the /etc/ directory, the aforementioned advanced security chapter, system maintenance, jails (which seem great, I'll have to have a play with them before I decide how I like them compared to Docker containers and the like but certainly it doesn't seem like an inferior option), and various other useful topics like what to do after a panic and various unconventional ways to use FreeBSD (cloud, diskless, etc).

By the way, please don't take my drop-off in depth of explanation when we get to the later chapters as any form of criticism; Lucas remains interesting and witty throughout and the information provided is useful, but this post is getting rather long and (for my money) the meat of this book, for a home user like myself, is largely in the first half of the book. I imagine that I'll return to this text periodically as I get to know FreeBSD more and use it in more places. Certainly I can see the merit in the subjects covered even if I don't have an immediate use for them myself.

In Summary

This book is worth picking up for the aspiring BSD sysadmin, the home user, and the Linux user curious about what those beastie boys are doing over there. Michael W. Lucas writes in an approachable style with no small amount of wit and doesn't take himself too seriously. Despite this seemingly casual approach, the book manages to cram in a frankly silly amount of high-quality guidance. I've certainly improved my sysadmin knowledge base and skill-set from reading it, amateur though I may be. Give this one a crack, and just remember to check the man pages on your own system before you do anything risky since this book was written for a slightly older (though by no means ancient) release of FreeBSD.