Logo
Command Palette

Search for a command to run...

~/ cd ..

Linux Isn't the Problem, You Are

A beginner-friendly guide to Linux, distros, live USBs, bootloaders, partitioning, and Secure Boot.

33 min read

Linux Isn't the Problem, You Are

okay so as the name suggests, we'll be discussing more about linux in general, as i've seen a lot of people getting scared at the thought of installing linux.

i'll be writing this blog in such a way that you can digest the information as easily as possible.

so linux, which is named after linus torvalds, the goat

Blog illustration

. in this one we'll go through a computer's lifecycle in general, mostly focused on linux, and we'll be shooting crazy shots at windows 🤣 cuz windows are best when they are closed

Blog illustration

Disclaimer: this isn't for normies (sorry windows fam) (rome wasn't built in a day, neither was my hate for windows 🤣). this is solely for users who wanted to try linux but didn't know where to start or what to do.....

what linux actually is

so before asking about the in-depth stuff, let's clarify our main agenda: what is this linux, why are peeps obsessed over it, and why does it power most of the cloud and its workloads?

linux is a free and open-source operating system based on the linux kernel, which was first released by linus torvalds in 1991. it functions as the core software that manages a computer's hardware resources, such as the cpu, memory, and storage, while allowing users to run applications and interact with the device.

hold up

Blog illustration

wait, so you are saying linux and the linux kernel are two different things? (this is the most common misconception people have, they assume linux and the linux kernel are the same thing. to be precise, let us first know what a kernel actually is and what its relation with linux is?)

a kernel is the core component of an operating system that acts as a critical interface between computer hardware and software processes, managing system resources like memory and cpu time. the linux kernel is a free, open-source, unix-like kernel created by linus torvalds in 1991, serving as the foundation for linux distributions, android, and many embedded systems.

Here's a oversimplified version :

Blog illustration

so when people say linux, they are usually talking about one of two things:

  • either they are talking about the kernel strictly (out of 10, there are 0 cases), cuz none of them are talking about kernels, and i think most of us are aware of kernels but we don't know jack shit about them, so we'll do a small deep dive on kernels as well, as you are here to understand kernels.
  • and second is linux loosely, basically kernel + gnu tools.
Blog illustration

and you might ask, mister, what is gnu? and i'm glad you asked

gnu in a nutshell

gnu stands for gnu's not unix (yes, the name literally contains itself, nerds are built different ). back in 1983, richard stallman started the gnu project with a crazy goal: build a complete operating system that is totally free, where anyone can use it, read the code, change it, and share it.

and they pulled off almost all of it. they built pretty much everything around the kernel:

  • the shell (bash), the thing you type your commands into
  • the core tools like ls, cp, cat and grep. every time you type a command in a linux terminal, odds are it's a gnu tool
  • the compiler (gcc) that turns code into programs
  • a bunch of libraries and editors

but there was one big problem: gnu didn't have a working kernel. they were building their own (it's called hurd) but it wasn't ready. so they had a whole house with no foundation.

and then in 1991, a student in finland named linus torvalds released a kernel as a hobby project. it was the missing piece. gnu tools + linux kernel = a complete free os. that combo is why some people insist on calling it gnu/linux.

so it's pretty much this

before linus graced us with Da KERNEL!!!!!!

so when someone says linux, they usually mean the kernel plus the gnu tools plus a bunch of other stuff bundled together. spoiler: that bundle is called a distro, and we'll get there.

Blog illustration

fun fact: linus also created git, years later, because he needed a way to manage the kernel's code. the man changed computing twice. the goat strikes again

Blog illustration

what the kernel actually does

so as we now know what a kernel actually is, let us see what it is actually used for.

the kernel has only 4 jobs and i've described them below in a pretty diagrammatic format.

Blog illustration

where the kernel fits within the os: to put the kernel in context, you can think of a linux machine as having 3 layers:

  1. the hardware: the physical machine, the bottom or base of the system, made up of memory (ram) and the processor or central processing unit (cpu), as well as input/output (i/o) devices such as storage, networking, and graphics. the cpu performs computations and reads from, and writes to, memory.
  2. the linux kernel: the core of the os. (see? it's right in the middle.) it's software residing in memory that tells the cpu what to do.
  3. user processes: these are the running programs that the kernel manages. user processes are what collectively make up user space. user processes are also known as just processes. the kernel also allows these processes and servers to communicate with each other (known as inter-process communication, or ipc).

so now we have a pretty basic idea of what the kernel is and what linux is, right? right??? right???

Blog illustration

distros: the flavours

now, as i have said, i'll be making this blog in such a way that if someone wants to shift to linux today, he/she will have a clear idea of what is what and what needs to be done.

so our point which stated that linux + gnu is usually cli based, in order to make it cream of the crop we have something known as a distro, and they are flavors of it, just like how we have different types of chocolate flavours, right?

Blog illustration

this is an extreme rabbit hole of which distro you need to use, but i'll just say it out loud: fedora is the best flavour. it's just like that chocolate that is topped off with nutella and dipped in ice cream, sweet, right? that's what fedora gives you, one bite of this and you feel full, that's what fedora makes you do

Blog illustration

so as you know, the linux kernel is open source (and so are the gnu tools), so linux distributions differ primarily due to this open-source nature, which allows anyone to modify the code and create a customized operating system. this freedom leads to a wide variety of distros tailored to different user needs, philosophies, and technical preferences. that's the reason we have a plethora of distros and obviously their flavours, and different flavours mean different experiences

Blog illustration

now let's move on to the actual linux onboarding. now that we have a clear understanding of what linux is, its kernel and distro...

isos and the live usb: your first hands-on step

so you went to a distro's website, hit download, and got a file ending in .iso. what even is that?

Blog illustration

an iso is a byte-for-byte copy of a whole disc, the same structure a cd or dvd ( the thing that our old folks used ) would hold (the name comes from iso 9660, the old standard for optical discs). think of it as a sealed box with a whole operating system inside: a bootable mini-system, the installer, and the packages it needs.

modern linux isos are hybrid images, which just means one file that can boot on both old and new machines (we'll see why in a bit).

why you can't just drag and drop it

now you'd think: copy the file to the usb, done, right? right?

Blog illustration

nope. a normal copy puts the iso on the stick as one ordinary file, and your computer looks at it and sees nothing bootable. so we use tools like rufus, balenaetcher, or the dd command (whose gui usually looks like this),

Blog illustration

which write the image straight onto the device sector by sector, so the stick's layout matches the iso

and then there's ventoy, which is the lazy genius option. it installs its own small bootloader on the stick once, and after that you just drop isos onto it like normal files and pick one from a menu.

the live usb: a car test drive with freedom

once the stick is ready, you restart the laptop and boot from it instead of your hard drive. what you get is a live environment: a fully working linux desktop running straight from the usb, without touching your disk. think of it as a test drive. you can poke around, check whether your wi-fi, graphics and sound work, and when you shut down nothing is saved.

Blog illustration

and when you're happy, you launch the installer from inside that live session and install it for real. so the order is: live boot first, install second.

but wait. how does a computer even know to boot from a usb? and what is it doing between you pressing the power button and showing you that desktop?

Blog illustration

that's exactly the juicy part, so buckle up. (we'll come back to this usb at the end and crack it open fully)

your pc has a secret life before the desktop

okay according to the topic your pc indeed has a secret life just like bruce wayne as he is bruce in the morning and batman at night

Blog illustration

so this is the juiciest topic and i believe 95% of developers don't know about this (i was one of them until i tried to understand more about it). it covers firmware, bootloaders and utilities related to them.

what happens when you open your laptop

so let us start by understanding what actually happens when you open up your laptop. whenever you open a laptop, before anything happens (before your rgb lights up, before external devices connected to the computer start working), a secret handshake has to happen. this is done by the firmware: a small program coded into your motherboard that powers on whenever you start your computer. and as the name suggests, the motherboard is the most crucial part of a computer system

Blog illustration

quick detour: what even is a motherboard?

so what even is a motherboard?

Blog illustration

. it's the biggest circuit board inside your computer, and literally everything plugs into it or sits on it: the cpu, the ram, your ssd or hard drive, the graphics card, the wi-fi, the ports you plug your stuff into. none of these can talk to each other without the motherboard's wiring, plus a set of chips called the chipset that act like the traffic police.

on a desktop, it's a big board you can swap out. on a laptop, it's one custom board squeezed into the body, and it's not really meant to be replaced (so don't spill your water on it

Blog illustration

).

why does this matter for us? because one tiny chip on this board stores the firmware. so the very first code that runs when you press the power button isn't on your ssd at all, it lives on the motherboard itself. there's also a small battery on the board that keeps the clock and your firmware settings alive while the laptop is off.

firmware: the first one to wake up

firmware is code stored on a chip on the motherboard. it runs first (always first)

Blog illustration

, checks that the hardware is alive, then it goes hunting for the ghost on your drive

and you might think: do we see the firmware, or is it something that is abstracted away just like the motherboard? and the answer is yes, you see it, but not all of us (only the ones who are curious). when you open up your laptop, press f2 or f12 (it depends on your laptop brand, we'll cover the keys later) in order to enter a mode that is known as bios/uefi.

what is bios/uefi?

what is bios/uefi, you ask? excellent question my friend

bios stands for basic input output system, and it is the firmware that we have been talking about. older computers use bios, and newer ones use uefi (unified extensible firmware interface), a modern upgrade: it handles huge disks (gpt, more on that soon), boots faster, and brings things like secure boot, which we'll meet later. but here's the funny part: nobody says uefi. we still say bios out of habit, this façade is just like the twitter / x dispute. nobody says 'did you see my post on x', that sounds weird, and by that logic nobody says uefi, we say bios.

the ghost of the computer

after the firmware starts, it looks for the missing piece, and this one piece is what it requires

Blog illustration

and that is the bootloader. the bootloader is responsible for getting your os started, and it is the first point where the user gets real power, because it is where you can select your operating system.

why is the bootloader called the ghost of the computer?

Blog illustration

it's called that because as soon as the bootloader boots up, it loads the kernel into memory, passes control to it, and then it disappears, as its job is done...

disks and partitions: the rooms inside your drive

okay so by now we know what firmware is and why it is firm 🤣 and now you might get a fleeting thought: i said firmware (shit off), let's call it bios, looks for something, that one piece, and the answer is the bootloader on your drive, but a valid question is: where on the drive? cuz a drive can be big, and what even is a drive, and what does a drive look like?

Blog illustration

A drive is a hardware component or storage location that stores and retrieves digital data on a computer, like your operating system, software, and user files. ⁠ These devices retain data even when power is removed (non-volatile) and ram is volatile that means as soon as your laptop dies down it loses the data

there are different types of drives, like HDD, SSD and USB sticks etc etc. an HDD is the old school one with spinning metal platters inside (a tiny record player basically), an SSD has no moving parts and is way faster (it's just flash chips, same family as your pen drive), and the NVMe ones you see in modern laptops are SSDs that plug straight into the motherboard.

but no matter which one you have, from the computer's point of view a drive is just a big pile of empty storage space. and a big pile of space with no structure is hard to use, right? so what do we do? we divide it. and that's where partitions come in.

Blog illustration

a disk partition or partition is a section of the hard drive that is separated from other segments. partitions enable users to divide a physical disk into logical sections. for example, allowing multiple operating systems to run on the same device.

Blog illustration

the firmware hunts for a bootloader on your drive, but a drive is not one big blob. it is split into partitions, like dividing one big hall into smaller rooms. each room can hold a different operating system, your files, or a special boot file (we'll come to what a special boot file is in a bit, but bear with it for the time being). (there are different types of files that are needed by bootloaders during boot) the drive keeps a partition table, a map that says where each room starts and ends. there are two kinds, and they match the two firmware eras:

Blog illustration
  • mbr (master boot record): the old bios-era map. it lives in the first 512 bytes of the disk, along with the first stage of the bootloader. only about 446 of those bytes are code, and the rest is the partition table. it supports up to 4 primary partitions and disks up to about 2 tb.
  • gpt (guid partition table): the modern uefi-era map. it supports huge disks, allows around 128 partitions, and keeps a backup copy of the map at the end of the disk. not our gippity

so to sum it up, we can say a modern laptop with uefi uses gpt, and an old bios machine uses mbr. mixing them up is one of the classic reasons an install will not boot.

now there might be a question: why am i saying this technically mind-boggling jargon? and you might think gpt was better, when i thought about that gpt, now this is something different

i can ramble a lot of GPT and it's table also but it would then become a very big as* blog so we won't delve deeper into but for the curious mind you could have a look over here https://recoverit.wondershare.com/partition-tips/what-is-gpt.html

file systems: how each room stores its stuff

  • a partition is just an empty room, and we can't keep the room space empty, right? right?
Blog illustration
  • so before keeping anything in the room, we clean it, right? just like our house, and in computer language, in order to make a room clean we format it with a specific file format (cleaner), this is done as different oses support different types of file systems

okay so what are these cleaning methods? they're called file systems. a file system is the set of rules for how files are named, stored and found inside a room. different oses speak different languages, so a room formatted by one can look like gibberish to another. here are the ones you'll meet:

Blog illustration

a few things worth knowing:

  • linux does not mainly use fat32! linux's usual file system is ext4 (or btrfs). fat32 shows up on a linux machine mostly as the efi partition, and keep that in your head, cuz it's coming up very soon.
  • fat32 can't store a single file bigger than 4 gb, that's why your old pen drive refuses that one big movie file.

the rooms you'll actually see

okay so now we know there are different rooms and different formats (cleaning methods), so now we'll bounce back to our topic: linux, right?

so what rooms will you actually see when you install linux? the installer creates them, and it varies from user to user, but here's the usual cast. each room has exactly one job.

  • root (written as /): the main room. the whole linux system lives here: programs, settings, everything. no root, no linux.
  • home (/home): your stuff, like documents, downloads, configs and wallpapers. as a separate room this one is optional, by default most installers just keep home as a plain folder inside root. so why would anyone make it separate? so you can reinstall or switch distros, wipe root, and keep all your files untouched. big brain move
  • swap: the overflow room. when your ram fills up, linux can park less-used stuff here. it can be a partition or just a file, and a lot of modern installs skip it or use compressed ram instead.
  • efi (/boot/efi): the special room we're getting to in a second. small, fat32, and the firmware cares about it a lot.
Blog illustration

and if you're dual booting, you'll also spot some rooms on the windows side in the installer:

  • windows (c: drive): ntfs, the big one.
  • recovery: a small partition windows keeps for repairs and resets. don't touch it.
  • msr (microsoft reserved): a tiny hidden one. ignore it, don't delete it.
  • the efi room: usually already there, created by windows, and linux just reuses it (more on this in the dual boot diagram below)

i ain't gonna bother drawing a diagram for windows cuz we know

Blog illustration

and then *unallocated space**. remember when you shrink your windows partition from disk management? that freed space isn't a room yet, it's just empty floor with no walls. the linux installer builds its rooms (root, maybe swap, maybe home) on that empty floor.

Blog illustration

a typical dual boot disk, after install, looks something like this (order and sizes are different on every machine, so treat it as an example):

Blog illustration

efi: the special room where you keep your stash (indians would know lol :lilaugh:)

okay so out of all these rooms, there is a special one known as the efi partition, and it shows up in linux at /boot/efi. it's a small partition of its own (it just appears at that spot in the file tree), and it is the main thing our firmware looks for, as it holds the boot files. (i'll also show below a representation of how dual booting actually works in a while)

now you might think: so what are boot files, huh?

Blog illustration

i say hol up

Blog illustration

lemme cook again

boot files are the files the firmware and bootloader need in order to get your os started.

inside the efi partition are the bootloader programs, the dot-efi files. for linux that's usually grubx64.efi, plus shimx64.efi if secure boot is in play. for windows it's bootmgfw.efi, the windows boot manager. there's also a fallback file at a standard path, efi/boot/bootx64.efi, which the firmware tries when it has no saved boot entry. that's how a freshly made live usb boots on any machine. a tiny grub config usually sits nearby too, pointing to the real menu config over in /boot. ( you might not understand this much but just image a special file that is veryy veryy important and always needed by firmware )

inside the root room (or a separate boot room), in the /boot folder, sit the kernel and the initramfs, but that's a story for a bit later.

and regarding what grub is? grub (short for gnu grand unified bootloader) is a widely used bootloader and boot manager, primarily for linux and other unix-like systems. it is the first program the firmware hands control to, sitting between the bios/uefi firmware and the operating system kernel.

Blog illustration

disclaimer: this is the bootloader that is generally used for linux, and it's usually installed automatically by the installer when you install from a live usb. and you might say, then what bootloader does windows use initially? it's the windows boot manager, which mainly boots windows, while grub can load n number of distros etc.

okay so let's have a quick recap on what efi and all is in a nutshell?

the efi system partition (esp) is the small partition you see in disk tools. it is usually 100 to 500 megabytes, formatted as fat32, and it holds the bootloader files, like grubx64.efi for linux or the windows boot manager.

it uses fat32 for one reason: the firmware is deliberately simple, and fat32 is simple enough for every uefi firmware to read. the firmware looks inside this partition, finds the bootloader file, and runs it.

this is also why dual booting works. windows and linux can both drop their bootloaders into the same efi partition, so one shared room offers both systems on the boot menu.

why doesn't the firmware start the os directly?

a question that might have emerged but you might have neglected to ask, it is what it is

the firmware is deliberately simple and small, so it cannot understand every file system or every operating system. it only knows enough to find a bootloader file on the efi partition and run it.

an operating system is huge and varies a lot: different kernels, different file systems, different setups. so the bootloader acts as a translator in the middle. it is smart enough to read your linux partitions, show you a menu, and load the right kernel, which the firmware cannot do by itself. that is also why dual booting works at all, since one bootloader can offer both windows and linux.

the reason behind it is a division of concern. the firmware belongs to the hardware side, written by the motherboard maker and stored on a chip that is risky and awkward to update. the operating system belongs to the software side and changes constantly. the bootloader sits between them as a standard handoff point. because uefi just says find the boot file on the efi partition and run it, any os can plug in without the motherboard maker knowing anything about it. one mistake here and you laptop goes kaboom!

Blog illustration

how dual booting actually works

Blog illustration

this is how dual booting works on a higher level

the handoff: kernel and initramfs

okay so the ghost (grub) is now running. it's shown you the menu (or auto-picked an option if you didn't touch anything), and you chose linux. now what?

Blog illustration

two files are involved, and both live in the /boot folder (remember, grub is smart enough to read linux file systems, the firmware isn't, that's why they can sit there):

  • vmlinuz: the linux kernel itself, in a compressed form (the z means compressed)
  • initramfs (sometimes called initrd): a tiny temporary mini-system. more on this below

grub loads both into ram, passes control to the kernel, and then vanishes. that's the ghost's whole job.

Blog illustration

the chicken and egg problem

now the kernel wakes up and has one big task: find your real root room on your real drive, so it can load the rest of the system. but to read the real drive, it needs the right drivers (nvme, sata, encryption, whatever you use)... and those drivers live on the real drive.

Blog illustration

so what do we do? we cheat.

initramfs: the temporary mini-system

initramfs (initial ram file system) is a tiny temporary system that grub drops into memory right beside the kernel. it carries just enough drivers and tools to get the real drive found and mounted. the kernel runs it first, and its startup script goes through a checklist:

  1. load the drivers for your storage
  2. if your drive is encrypted, ask for the password and unlock it
  3. find the real root room and mount it
  4. switch over to the real system, and the initramfs gets thrown away
Blog illustration

fun detail: on some distros, if you ever see a scary black screen with a tiny (initramfs) prompt, that's this guy telling you he couldn't find the real drive. now you know what it means.

Blog illustration

and then?

once the real root room is mounted, the kernel starts the very first process on your system. on most distros that's systemd, the manager that brings up everything else: networking, services, and finally your login screen and desktop.

the whole boot journey in one go

  1. you press the power button, the firmware wakes up and checks that the hardware is alive
  2. it finds the boot file (the .efi file) in the efi room and runs it, that's the bootloader (grub)
  3. grub shows the menu, loads the kernel and initramfs from /boot, then disappears
  4. the kernel starts and runs the initramfs, which finds and mounts your real root room
  5. the kernel starts systemd
  6. systemd brings up your services, and finally your desktop

remember that live usb?

remember the usb we left hanging earlier? now that you know the whole boot journey, you're finally ready to understand it, because it's the same story with a twist.

Blog illustration

what happens when you boot it

  1. the firmware scans the stick and finds a bootloader ( usually grub ) on its efi partition. ( that's the hybrid part from earlier: the same stick can also boot old bios machines )
  2. the bootloader loads the kernel and an initramfs into ram
  3. the kernel runs the initramfs, the same helper as before, but with a bigger job: it has to find the iso's main system image on the stick and mount it
  4. that image is a compressed read-only file system called squashfs
  5. an overlay is stacked on top so the system feels writable, and then the live desktop starts

two new words showed up there, so let's cook them one at a time.

squashfs: the zipped system

squashfs is a compressed, read-only file system. think of it like a zip file that linux can browse directly, without unzipping everything first. the whole system (desktop, apps, tools) is packed into one big squashfs file on the iso. that's why a 6GB system fits in a 2-3GB download. when the live session needs a file, linux decompresses just that piece on the fly.

the catch is it's read-only. nothing can be written into it, which is exactly what you want from an install medium, because it keeps the original clean.

but wait, if it's read-only, how does the live session feel like a normal system where i can open apps and save stuff?

Blog illustration

overlay: the plastic sheet trick

An **overlay file system* is the bottom layer and it is read-only squashfs, and the top layer is a writable space, which in a live session is just **ram**. when you open a file, linux checks the top layer first, and if it's not there, it falls through to the book underneath. when you save or change something, it lands on the plastic.

so the live session feels fully writable, but it's really the book plus a sheet of ram. shut down, the ram empties, the plastic gets thrown away, and you're back to the clean book. your laptop's disk is never touched unless you ask for it. that's why the live environment is a safe test drive.

fun fact: the same idea powers docker containers, so you've basically learned a bit of that too.

Blog illustration

some live usbs also support persistence, which reserves a spare partition on the stick to keep your changes between boots. cool trick, but it's not the same thing as installing.

and then the installer

the installer is just a program running inside the live session. you boot the live usb first, check that wi-fi, graphics and everything work, and only then launch it. it does the real work:

  • partitions the free space (our unallocated empty floor from before)
  • formats the rooms with ext4 or btrfs
  • copies the system image onto your disk
  • generates a fresh initramfs tailored to your hardware (the live usb's one was generic, built to work on many machines, but yours only needs your own drivers)
  • installs grub into the efi partition

and that's the full circle: everything we've talked about so far, in one install.

Blog illustration

for the curious (optional)

  • initramfs is a compressed archive (cpio format, squeezed with gzip, xz or zstd). the kernel unpacks it into ram as its temporary root.
  • squashfs compresses in blocks (often 128 kb), so linux can decompress just the blocks it needs. it also dedupes identical files and keeps permissions, so the system inside behaves like a normal install.
  • the installed system's initramfs is built by tools like dracut (fedora) or update-initramfs (ubuntu). rebuilding it is a classic fix after you change disk setups or encryption.
  • I spent around 10-15 fine days understanding about dracut and initramfs and i still remember those vivdly . this was in 2024 ahhh those nostalgic days
  • exact details vary by distro, this is the common pattern on the mainstream ones.

secure boot: the thing that scares everyone

now there is a problem that most new laptop users who are installing linux for the first time face and are scared to do it, and that is secure boot

now we'll know what secure boot is and does: does the word secure actually deal with security? or wut? or is it just a word? as i've seen my known ones get scared when secure boot needs to be turned off, so let's understand

as the bootloader is the first thing that gets loaded, security matters a lot here. someone could use a malicious bootloader to load a fake or compromised operating system and compromise the user's security. that is why there is secure boot.

Blog illustration

( In higher level terms this is what i'm talking about .....)

how does it actually work?

so how does it actually work, you ask? let's see below:

  • the bootloader is signed with the vendor's private key.
  • the firmware holds a matching public key in a trusted list.
  • at boot, the firmware checks the signature. if it matches, the bootloader runs. if not, you get blocked.

vendors and keys, in plain words

now you might think: what is a vendor now? and what the hell is a private key? and what is a public key? is it something that we insert publicly or wut? 🤣 so now let's know what a vendor is, who are vendors, and how many of them are currently there?

so as you know, there will be a manufacturer for whatever we buy, right? like if i own a samsung s32 ultra, its manufacturer is the samsung company, so by following that logic, vendors are just companies or groups that make, sell, or give away a product. in this case the product is an operating system or its bootloader.

"the bootloader is signed with the vendor's private key" just means the company that made that bootloader puts its secret digital stamp on it. for windows, the vendor is microsoft. for ubuntu, it's canonical. for fedora, it's red hat.

the authorized ones are whoever's key the firmware already trusts. motherboards ship with a trusted list, mostly microsoft's keys plus the motherboard maker's own. linux distros get in through shim, which microsoft signs on their behalf.

and regarding what a private key and a public key are? a private key is the vendor's secret stamp, which only they own and never share. a public key is a copy of the stamp's pattern that everyone can see. the vendor stamps the bootloader with the private key, and the firmware checks that stamp against the public pattern. anyone can verify it, but only the vendor can create it, so a fake bootloader can't pass.

so why do i have to turn it off for arch?

so by using this they provide a safe, secure way of using oses, but the question still remains: why do i have to disable it if i want to download arch btw, or nix? or does mint fix this, or any others?

linux install tutorials often say to disable secure boot first, because smaller distros or custom kernels are not signed. mainstream distros like ubuntu and mint often work with it on.

here's the actual deal. think of the firmware as a bouncer at a club door, and the guest list is mostly microsoft's keys. to get in, your bootloader needs a signature that traces back to a name on that list.

  • ubuntu and fedora (and mint, since it's built on ubuntu) did the paperwork. they ship that small program called shim, which microsoft has signed, so the bouncer waves it in. shim then vouches for grub, and grub vouches for the kernel. a whole chain of trust.
  • arch doesn't ship an install image with a signature your firmware trusts. the official arch iso simply doesn't support secure boot, so the bouncer says no and you get an error or a black screen.
  • nixos is a similar story. secure boot there is a separate project called lanzaboote, still marked as in development, that you set up after installing, so the standard installer isn't built for it either.

that doesn't mean arch or nix are unsafe, they're just not on the guest list.

so what are your options?

  1. turn secure boot off for the install (the easy way)
  2. install first, then set up secure boot yourself with your own keys, so you can turn it back on (tools like sbctl on arch, lanzaboote on nixos). this is advanced, a rabbit hole for another blog
  3. or pick a distro that already plays nice with secure boot: ubuntu, mint, fedora

one more thing you might see on ubuntu-family distros: after installing something like the nvidia drivers, a blue screen shows up on reboot asking you to enroll a key and set a password. that's called mok (machine owner key). it's just you telling the bouncer this one's with me, so don't panic, follow the prompts. Don't panik. Kalm down ( pun intended )

Blog illustration

caution for the dual-boot section

if windows 11 is installed, changing secure boot settings can trigger things like bitlocker recovery prompts. readers should back up their recovery key first. (it's saved in your microsoft account, search for bitlocker recovery key there and write it down before you touch anything)

how to actually reach the setting

okay so you're convinced and you need to flip the switch. how do you even get there?

Blog illustration

two ways:

way 1: the key mashing method. restart and tap the key again and again right as the logo shows up. the key depends on your laptop brand:

the settings key is where you flip secure boot, the boot menu key is where you pick your usb. keys vary by model and year, so if none of these work, search your exact laptop model plus bios key.

way 2: from inside windows (the less painful one). windows can fast-boot past the moment where you tap the key, so this one saves headaches: settings, then system, then recovery, then advanced startup, then restart now. after it restarts, go to troubleshoot, then advanced options, then uefi firmware settings, then restart.

once you're in, look for the security or boot tab (the name changes per brand), find secure boot, and set it to disabled. some laptops want you to set an admin password first, or to make sure the boot mode is uefi and not legacy. save and exit (usually f10).

the gamer note: anti-cheat will snitch

if you're dual booting and you also play games on the windows side, listen up. some competitive games use anti-cheat that wants secure boot to be on (valorant, battlefield 6 and the recent call of duty titles are the usual examples, but check your game's requirements, cuz this changes). so if you turn secure boot off to install arch, your windows games may refuse to launch until you turn it back on.

so gamers, the safest path is a distro that works with secure boot ON (Ubuntu, Mint, Fedora), so you never have to touch the switch. and if you do want Arch, remember option 2 from above: install first, then set up your own keys and turn secure boot back on.

Tip: I recently got to know when you linux crashes or by some reason it isn't opening you could just plug your Live USB in your OS and then perform fixes ( a really handy thing )

So that's what this blog about y'all I hope you might have been bored but for those of you who made it this far bye bye see you in the next one

Blog illustration