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. (You can learn more about it here.)
Creating a Windows Dual Boot
With the right partition setup, dual booting with Windows is a breeze. The most important thing to note when planning a dual-boot setup is that many versions of Windows expect to be the one and only OS on the system. Often, Windows doesn’t like being on anything other than the first partition of the drive and will not hesitate to wipe out anything in its way. You’ll save yourself much trouble by knowing this ahead of time and allowing Windows to occupy 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. There are several advantages for this: the first is that it lets you limit the amount of space that can be taken up by user files. More importantly, keeping these files separate means whatever may happen to your system files (in the “/” directory) your “/home” directory will be left alone. This means you could reinstall your entire OS but leave personal documents, profiles, and some application and desktop settings exactly the way they were.
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 will be installed in “/bin,” “/opt,” or “/usr/bin,” so if you like to have lots of applications, you can keep it similar to the example above. You can also increase the size of the “/” partition if you don’t plan to have much personal data on the system, like a workstation or server. However, if you plan to use your system like many desktop users, you can increase the size of your “/home” directory.
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. Since the “/boot” partition is where Linux stores the kernel and GRUB menu, this lets you share boot information across both distros. If you like to build custom kernels, you can place your custom kernel in the boot partition and let both distros run off a single custom kernel.
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?
There are tons of different definitions of “typical,” but I’m going out on a limb to say that most Linux users are looking for a good partition scheme for their desktop system. You want to make sure that you can keep your data safe and secure, and you want to use your disk space in a way that makes the most sense. You’ll generally want a 100 MB “/boot” partition (this can be omitted on a single Linux installation), a 25 GB “/” partition, and a ~75 GB “/home” partition, assuming a 100 GB disk.
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.
Our latest tutorials delivered straight to your inbox