56tvmao: How-to instructions you can trust. Linux A Quick Guide to Linux Partition Schemes

A Quick Guide to Linux Partition Schemes

A Quick Guide to Linux Partition Schemes post thumbnail image
A Quick Guide to Linux Partition Schemes

Partition schemes in Linux are the bane of the existence of many new (and experienced) Linux users. What partition setup should you use when dual-booting Windows and Linux? How should I set up my partitions if I just want to boot Linux? Should you have a separate partition for “/home”? Why do some people put “/boot” into its own partition? And do you even need a dedicated boot partition? This quick guide to Linux partition schemes answers all of those questions and more.

Note: this article is not about the “how” of partitioning but the “why.” There are multiple reasons for this. For one, the specifics of “how” will vary widely from system to system, and it all revolves around your use case. If you would like a detailed guide on the “how” aspect, take a look at this article on how to resize and create partitions with gnome partition editor.

Note: for the sake of simplicity, all the charts in this guide will be based on a 100GB drive and will not show the “swap” partition.

Creating a Windows Dual Boot

With the right partition setup, dual booting with Windows is a breeze. When planning a dual-boot setup, note that Windows often expects to be the sole OS and prefers the first partition. To avoid issues, let Windows take that slot before installing Linux.

In this example, we’ve created a 50GB Windows partition as the first partition on the drive. Install Windows first, and once it’s all finished, go ahead and install your Linux of choice on the remaining space. Just about any modern Linux will see the Windows installation and automatically add it to your GRUB boot menu.

Another option is to put Windows on a completely separate drive and let it have a full drive all to itself. If you elect to do that, you can use a full drive for a Linux install, which may look like one of these examples below.

Separating Personal Data

One of the most common setups for Linux is to separate the “/home” directory to its own partition. This approach limits space for user files and keeps your “/home” directory safe, even if system files in “/” are affected. You can reinstall the OS without losing personal documents, profiles, or settings.

For example, let’s say you’re running Ubuntu with your “/home” directory as its own partition. If you have many files saved to it, like family photos and documents, you can reinstall or upgrade and wipe the whole system while leaving your personal data intact. Once the reinstall/upgrade is done, you’ll have all your files and settings just the way you left them.

You can, of course, adjust the sizes of the partitions to meet your needs. Most applications install in “/bin,” “/opt,” or “/usr/bin.” For many apps, keep the example setup. Increase “/” size for minimal personal data (e.g., workstations or servers), or expand “/home” for typical desktop use.

Separating Kernels for Multi-Booting Linux Distros

Many people set up a small “/boot” partition separate from the “/” partition. This is not necessary but can come in handy if you’re running multiple distros on the same machine. The “/boot” partition stores the kernel and GRUB menu, allowing shared boot info between distros. You can also use a custom kernel for both distros from this partition.

The “/boot” partition does not need to be large. Unless you plan on loading tons of kernels, 100MB should probably do the trick just fine.

You may also elect to create a “/boot/efi” partition if you’d like your system to boot using UEFI. That would be an additional ~100 MB on top of the 100 MB “/boot” partition.

What Does a Typical Partition Scheme Look Like?

While “typical” varies, most Linux users seek a good partition scheme for desktops. To keep data secure and optimize disk space on a 100 GB drive, create a 100 MB “/boot” partition (optional for single installations), a 25 GB “/” partition, and a ~75 GB “/home” partition.

This will give you a compact boot partition to keep about three or so kernels on disk at a time, a reasonable “/” partition to store a good amount of programs, and a sizable Home folder for all your personal data. If you have more disk space, you can either create another partition or extend the “/home” partition to store your files.

What You Should Not Partition

There are some parts of the filesystem you want to keep in “/”. Items in “/bin,” “/lib,” and “/etc” are often needed immediately at boot time, and if they’re on separate partitions, they may not be mounted before they’re needed. For example, “/lib” usually contains some kernel modules that will likely be needed immediately upon booting the kernel. If the partition is not yet loaded, things could get nasty.

Now that you know about Linux partition schemes, make sure you also check out zswap, zram, and zcache and how to use them in your system.

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post