Operating Systems Concepts & Design
A partition table is essentially the “Map of the World” for your hard drive. It tells the BIOS or UEFI exactly where one partition ends and the next begins. Without it, the computer would see the entire disk as a giant, unorganized pile of raw binary data.
There are two main standards you will encounter: MBR (Master Boot Record) and GPT (GUID Partition Table).
Introduced in 1983, MBR is the “Legacy” standard. It stores the partition table in the very first sector of the disk (Sector 0).
GPT is the modern standard that replaced MBR. it is part of the UEFI (Unified Extensible Firmware Interface) standard.
Regardless of the type, every entry in a partition table contains four vital pieces of information:
83 for Linux, 07 for NTFS, or a long UUID for GPT).You can use several tools to see which “map” your drives are currently using:
lsblk -m: Shows the alignment and basic layout.sudo fdisk -l: Lists all disks. Look for the “Disklabel type” line. It will say either dos (which means MBR) or gpt.sudo parted -l: Provides a very clean view of the “Partition Table” type.| Feature | MBR (Legacy) | GPT (Modern) |
|---|---|---|
| Max Disk Size | 2 TB | 9.4 ZB (Zettabytes) |
| Max Partitions | 4 Primary | 128+ |
| Redundancy | None (Risk of data loss) | Backup header at end of disk |
| Firmware | BIOS | UEFI |
| Identifier | 32-bit Disk ID | 128-bit GUID |
gdisk, fdisk, and partedWhen managing partitions from the CLI, the tool you choose often depends on whether you are dealing with “Legacy” MBR disks or modern GPT disks. While they all perform the same basic task—editing the partition table—their interfaces and safety mechanisms differ significantly.
fdisk is the most famous partitioning tool in the Linux world. For decades, it was strictly for MBR disks, but modern versions (util-linux 2.26+) now have full support for GPT.
n for new, d for delete) and follow the prompts.w (write). If you make a mistake, you can simply quit with q without saving.gdisk (GPT fdisk) was created specifically to handle GPT disks with the same user-friendly menu style as fdisk.
fdisk. If you know one, you know the other.x).w command.parted (Partition Editor) is a more versatile tool that supports many partition table types (MBR, GPT, Sun, Mac, etc.) and is unique because it can resize partitions.
parted writes changes to the disk immediately after you hit Enter on a command. There is no “undo” or “write” step.| Feature | fdisk | gdisk | parted |
|---|---|---|---|
| Primary Table | MBR (now GPT) | GPT Only | Both + others |
| Commit Style | Buffered (Save at end) | Buffered (Save at end) | Live (Immediate) |
| Ease of Use | High (Menu-driven) | High (Menu-driven) | Moderate (CLI-driven) |
| Scripting | Difficult (needs printf) |
Difficult | Excellent |
| Resize Support | No (Delete/Recreate) | No | Yes |
| MBR to GPT Conv. | No | Yes | No |
gparted—the GUI version—is safer for this specific task).The boot partition (often mounted at /boot) is a dedicated section of your storage drive that contains the essential files needed to start the Linux operating system.
While the “root” (/) partition holds your applications and data, the boot partition is the “key” that starts the engine. It must be readable by the bootloader (GRUB) before the full operating system is even loaded.
The /boot directory typically contains four critical types of files:
vmlinuz): The core of the OS. This is the actual executable file that the bootloader runs to start Linux.initrd.img): The temporary RAM-based filesystem that contains the drivers needed to find and mount your real root partition.grub/): The menu settings, themes, and “map” that tell GRUB where the kernels are located on the disk.System.map and config-x.x.x which contain kernel symbol tables and the parameters used when the kernel was compiled.In modern Linux installations, /boot is frequently its own small partition (usually 512 MB to 1 GB) rather than just a folder on the root drive. There are three main reasons for this:
/boot a simple Ext4 or FAT32 partition, the bootloader can easily find the kernel.On modern UEFI systems (almost all computers made after 2012), you will actually see two “boot-related” partitions:
.efi bootloader files./boot or /boot/efi.Because the boot partition is small, it can eventually “fill up” as you update your system. Every time you update your Linux kernel, a new vmlinuz and initrd file are added.
df -h /boot.| Property | Typical Value |
|---|---|
| Mount Point | /boot |
| Recommended Size | 512 MB – 1024 MB |
| File System | Ext4 (Standard) or FAT32 (EFI) |
| Primary Files | vmlinuz, initrd.img, grub.cfg |
To manage your boot partition, you need to identify which kernels are currently installed and which one you are actively using. Deleting the kernel you are currently running will crash your system, so we must be precise.
Before deleting anything, check which kernel version is currently loaded into RAM:
uname -r
Take note of this version. You must never remove the files associated with this number.
You can see exactly how much space each kernel and its associated “initrd” (Initial RAM Disk) is taking up:
du -sh /boot/vmlinuz* /boot/initrd*
/boot).Most modern Linux distributions use a package manager (like apt or dnf) to track kernels. To see all installed kernels (even those you aren’t using):
On Debian/Ubuntu:
dpkg --list | grep linux-image
On RHEL/CentOS/Fedora:
rpm -q kernel
Do not use the rm command to delete files in /boot. If you manually delete the files, the package manager will think the kernel is still there and may cause errors during future updates.
Most systems have a built-in “autoremove” feature that keeps the current kernel and the one previous (as a backup) while deleting everything else.
# For Ubuntu/Debian
sudo apt autoremove --purge
# For Fedora/RHEL
sudo dnf autoremove
If your /boot is 100% full, apt might fail because it can’t write temporary files. In this specific case, you can manually remove a specific old version:
sudo apt purge linux-image-5.15.0-XX-generic
(Replace 5.15.0-XX with an old version number you found in step 3, ensuring it is NOT the one from uname -r).
After removing kernels, you must tell the GRUB bootloader that those options are gone so they don’t appear in the menu when you restart.
sudo update-grub
(On Fedora/RHEL, this is usually sudo grub2-mkconfig -o /boot/grub2/grub.cfg).
| Action | Command |
|---|---|
| Check Active Kernel | uname -r |
| Check Disk Space | df -h /boot |
| Clean Old Kernels | sudo apt autoremove |
| Sync Bootloader | sudo update-grub |