I recently finished building my own Linux-based operating system from scratch by following the book Linux From Scratch (LFS). This all started after a conversation with an experienced system administrator who was clearly passionate about Linux. At some point in our discussion, he mentioned this book and suggested I give it a try. I was already searching for a proper source to understand how Linux actually works under the hood, from boot-up to shutdown. That curiosity alone was enough to pack my bags and begin a two-week journey I wasn’t fully prepared for, but definitely excited about. Along the way, I’ll also share the do’s and don’ts, what I learned, and what you can gain from this experience.

Expectations Before Starting

Before beginning, I had already researched LFS and asked around. It didn’t take long to realize this wouldn’t be a short or casual project. LFS itself only builds a foundational CLI system with basic binaries. It doesn’t give you a polished desktop or a riced Arch system, btw. And beyond LFS, there are further continuations like BLFS (the main extension), ALFS, GLFS, and so on. I haven’t started BLFS yet, but it’s definitely on my list.

My expectations were simple: I wasn’t expecting a slick desktop environment, just a working CLI. Even with that in mind, I was excited because I felt productive by simply attempting it.

Learning Through Typing Everything Manually

During the build, I surprisingly didn’t encounter any major errors except for occasional typos. And yes, I typed out the commands manually instead of copy-pasting. Not the entire config files, of course, but most of the commands. My logic was that it would build some muscle memory and force me to understand what I was doing. It worked well, and I overcame some laziness around understanding and performing source code installations.

The Problem: A GRUB Mystery

Here’s where things got interesting.

The build itself went smoothly, but at the very end, when I rebooted, the GRUB menu did not show any Linux From Scratch entry. I assumed my host system’s GRUB (Debian 12) wasn’t detecting LFS, so I edited /etc/grub.d/40_custom to add a manual menu entry. After that, I ran:

shell
sudo update-grub

On reboot, I could finally see the LFS entry. But selecting it threw this error:

text
error: hd1 cannot get C/H/S values

I checked the LFS troubleshooting page, changed the disk from VirtIO to SATA, and did the usual virtual machine experiments that people do when sleep-deprived. Nothing worked. At some point, I even managed to mess up my host’s GRUB configuration, which sent me down a rabbit hole of recovering Debian 12 just to get back to troubleshooting LFS again.

The Solution: Hidden in Plain Sight

Remember that sudo update-grub command I mentioned earlier? I must have typed it 25–30 times during troubleshooting, and yet I completely ignored the warning it kept printing:

shell
Warning: os-prober will not be executed to detect other bootable partitions. Systems on them will not be added to the GRUB boot configuration. Check GRUB_DISABLE_OS_PROBER documentation entry.

This os-prober turned out to be the imposter. By the mercy and grace of God, I eventually noticed the warning. I opened /etc/default/grub and found that the variable GRUB_DISABLE_OS_PROBER was uncommented. This causes GRUB to ignore other operating systems on connected disks entirely.

I disabled the variable, removed the manual entries I had added to 40_custom, ran update-grub once more, rebooted, and LFS finally appeared automatically in GRUB.

There was one more small issue: networking. I had named the file /etc/sysconfig/ifconfig.eth0 as eth0 instead of the actual interface, enp0s3. Fixing that and rebooting solved it.

When the system booted up perfectly, I felt an enormous sense of relief. I had sacrificed sleep trying to make this thing run, and the exhaustion hit me only after it worked.

What I Learned

It’s honestly difficult to list everything I learned because the experience covers so much. Beyond configuration, compilation, and installation, I got a much clearer understanding of:

  • Udev and how it handles device management

  • The Linux file hierarchy

  • Cross-compilation concepts

  • Better usage of chroot

  • Source-based software installation

  • The startup and shutdown flow of a Linux system

For this project, I used a Debian 12 machine on a QEMU/KVM virtualization hypervisor, which feels as close to bare-metal as you can get in a VM.

Do’s

  • Take snapshots after each chapter or after large builds like GCC or Binutils.

  • If you’re using QEMU/KVM like me, use a SATA disk instead of VirtIO.

  • If you encounter errors, take your time to understand them.
    Don’t rely on AI for troubleshooting, but it’s fine to use it for learning concepts. I used Gemini to help explain Udev through an analogy, and that helped a lot.

  • Get proper sleep, because debugging while half-asleep is never fun.

Don’ts

  • Don’t feel overwhelmed if you don’t understand everything in the book. That’s not the goal. As the LFS preface says:

The goal of Linux From Scratch is to build a complete and usable foundation-level system. If you do not wish to build your own Linux system from scratch, you may nevertheless benefit from the information in this book.

  • Don’t stop at just building LFS. Once it boots, consider using it for something real, like hosting an Apache web server using source installation instead of the usual sudo apt install apache2.

  • Don’t ignore BLFS. I’ll be working on it soon.


Final Thoughts

This journey was genuinely valuable for me. It helped me grow technically and understand Linux systems more deeply. But there’s one thing I can say with complete confidence.

You will walk away from LFS with a new level of respect for the real nerds out there — the people who built entire Linux distributions, designed package managers, maintained repositories, and crafted all the tools we casually install and “rice up” before declaring ourselves nerds.

After building even the most basic system from scratch, you start to realize just how much invisible effort goes into the Linux world behind the scenes. And trust me, once you experience that firsthand, you won’t look at your favorite distro the same way again.