sodcalculator

10 Tech How-To

How to Choose a Partition Scheme for Linux

Guide 10-60029 · Updated · Step by step

Choosing a partition scheme for your Linux PC determines how your storage is organized, affecting system performance, data safety, and upgrade flexibility. This guide walks you through the key decisions—from partition table type (MBR vs. GPT) to layout options like separate /home or swap—so you can pick a setup that fits your hardware and usage. You’ll need to know your disk size, whether your system uses UEFI or BIOS, and how many operating systems you plan to install.

What You’ll Need

  • Your computer’s firmware type: UEFI or legacy BIOS (check in your system setup or by searching online for your model).
  • Disk size and type (HDD or SSD) of the drive you’ll install Linux on.
  • An understanding of how much storage you need for the OS, your files, and any other OSes.
  • A Linux live USB or DVD for the installer (most distributions include a partitioning tool).
  • Optional: a backup of any existing data on the target disk.

Step-by-Step

  1. Identify your firmware type. If your PC is from 2012 or later, it likely uses UEFI. In the BIOS/UEFI setup, look for a “Boot Mode” or “UEFI/Legacy” setting. If you see UEFI, you’ll use GPT; if it’s legacy BIOS, you can use MBR (though GPT also works on some BIOS systems with certain bootloaders).
  2. Decide on the partition table type. For UEFI systems, choose GPT. GPT supports disks larger than 2 TB, allows more than four primary partitions, and is required for Windows dual-boot on UEFI. For legacy BIOS with a disk under 2 TB, MBR is simpler and works fine. If you’re unsure, GPT is the modern default and works with both firmware types if your distribution supports it.
  3. Plan the number of partitions. At minimum, you need a root partition (/) and a swap partition (or swap file). For UEFI, you also need an EFI System Partition (ESP). Consider adding a separate /home partition to keep your personal files intact during OS upgrades or reinstalls. A separate /boot is rarely needed unless you use full-disk encryption or have specific boot requirements.
  4. Calculate sizes. Root (/) should be at least 20-30 GB for a typical desktop install, but 50 GB is safer if you install many applications. Swap: for hibernation, it should equal your RAM size; otherwise, 2-4 GB is enough for most workloads, or you can use a swap file. /home: allocate the rest of your disk, or a dedicated partition if you want isolation.
  5. Choose filesystems. For root and /home, ext4 is the most common and reliable choice. Btrfs and XFS are also options—btrfs offers snapshots and compression, while XFS excels with large files. For the ESP, use FAT32 (required by UEFI). Swap uses its own format, or you can use a swap file on ext4 or btrfs.
  6. Consider dual-boot. If you’re installing alongside Windows, first shrink the Windows partition using Windows’ Disk Management, then create Linux partitions in the free space. For UEFI, both OSes share the same ESP—don’t format it during Linux installation; just select it as the boot loader location.
  7. Use the installer’s guided partitioning. Most distributions offer an “Erase disk and install Linux” option that automatically creates a sensible layout (ESP, root, and swap). If you want a custom layout, choose “Manual” or “Something else” and create partitions according to your plan.
  8. Set mount points. In manual partitioning, assign the root partition to ‘/’, the ESP to ‘/boot/efi’ (if UEFI), and any data partition to ‘/home’ or other directories. Ensure the boot loader is installed to the correct disk (usually /dev/sda or /dev/nvme0n1).
  9. Apply changes and install. Review the partition table, confirm your choices, and let the installer format and write the partitions. After installation, reboot and verify that Linux boots correctly.

Common Mistakes

  • Using MBR on a UEFI system, which can prevent booting or require legacy mode.
  • Not creating an ESP when installing on UEFI, leading to a “no bootable device” error.
  • Making root too small (e.g., 10 GB) and running out of space after a few updates.
  • Formatting the existing ESP during dual-boot, which wipes Windows’ bootloader.
  • Forgetting to set the boot loader installation device, resulting in the bootloader going to the wrong disk.
  • Using a filesystem that doesn’t support the features you need, like needing snapshots but choosing ext4.

Tips

  • If you’re unsure, go with the distribution’s default guided partitioning—it’s designed to work for most users.
  • Use a separate /home if you plan to upgrade or change distributions frequently; it preserves your documents and settings.
  • For SSDs, enable TRIM (most modern distros do this automatically) and avoid filling the disk completely.
  • Consider using LVM (Logical Volume Manager) if you want flexibility to resize partitions later, but it adds complexity.
  • Always back up important data before partitioning, as mistakes can erase everything.

Troubleshooting

  • System won’t boot after installation: Check that the ESP is mounted at /boot/efi and that the boot loader was installed to the correct disk. Reboot into the live USB and use tools like efibootmgr to verify or fix the boot entries.
  • Windows disappears from boot menu: If you formatted the ESP, you’ll need to repair Windows’ bootloader using Windows recovery media. If you didn’t format it, update GRUB with update-grub on Debian/Ubuntu or grub-mkconfig on Arch.
  • Disk not recognized: If using an old BIOS with GPT, you may need to enable “CSM” or “Legacy” mode in the firmware, or use MBR instead.
  • Swap not enabled: If you used a swap file, ensure it’s activated via swapon and added to /etc/fstab. For a swap partition, check that it’s formatted and listed in fstab.
  • Partition table error when installing: If the installer complains about a corrupt or unrecognized partition table, use gdisk or fdisk to write a new one, but be aware this erases all data.

Frequently Asked Questions

Do I need a separate /home partition?

Not strictly, but it’s recommended if you want to reinstall or upgrade your OS without losing personal files. It also isolates your data from system corruption.

What’s the difference between MBR and GPT?

MBR (Master Boot Record) is older, supports up to 2 TB disks and 4 primary partitions. GPT (GUID Partition Table) is modern, supports larger disks and unlimited partitions, and is required for UEFI boot.

Can I use a swap file instead of a swap partition?

Yes, modern Linux distributions support swap files, which are easier to resize and don’t require a dedicated partition. They work well on both ext4 and btrfs.

How much space should I allocate for root?

For a typical desktop, 30-50 GB is sufficient. If you plan to install many large applications or games, consider 70-100 GB.

Can I change my partition scheme after installation?

Yes, but it’s risky. You can resize partitions with GParted from a live USB, but moving data can take time and may fail. Back up first.

What is the EFI System Partition for?

It stores boot loaders and drivers that UEFI firmware reads to boot your OS. It must be FAT32 and typically 100-500 MB.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →