Choosing a partitioning scheme
/usr
The /usr
directory stores the binary files, documentation, libraries, and head files of third-party applications. Some articles advise keeping /usr
on the root directory in case using a separate partition interferes with the boot process, but that is rarely a problem on modern Linux systems. Some prefer instead to mount /usr/local
separately instead, which places most of /usr
on its own partition. The contents of /usr
are reasonably stable, which means that you can gain extra security by setting its permissions as read-only. However, if you do this, you will need to add write permissions when you upgrade. Allocate 50-100GB for the /usr
directory, and you should never need to worry about it again, even if you are constantly adding applications.
/var
Spools, logs, internal mail, and other frequently used files are stored in the subdirectories of /var
. This content can change quickly depending on what happens on your system. Left on the root directory, it could sometimes quickly fill the disk, causing a system crash. Putting /var
on its own partition limits the amount of space these files can take over. Allocating 4GB for it should be more than enough for a workstation, but double or triple that recommendation for any kind of server.
Other Considerations
How you use your system can also affect how you partition. For example, if you are installing multiple distributions on the same system, you might want a separate boot partition, plus a minimum of 12GB per distribution – more for the ones on which you are doing serious work. You may have to edit the bootloader manually to include all the distributions.
To simplify the setup, you should use a single partition for each distribution, because having a half dozen partitions for each distribution seems guaranteed to cause confusion, to say nothing of reducing performance.
A similar setup may be useful for dual-booting with Windows or any other operating system. Additionally, consider using mkdir
to create a directory on which you can store data that will be used with all operating systems. You can also mount the Windows partition from within Linux, but that risks accidental writing to Windows, which may cause problems. Watch, too, for other custom partitioning schemes, including those for different RAID configurations, which are too detailed to be explained here.
After you have created partitions and installed, you can check how they are filling up by running the df
command or the free
command for swap space (Figure 1). If any partition seems to approach 100 percent usage on a regular basis, you can probably steal a few gigabytes more from the /home
directory.
In the end, the partitioning scheme you choose will reflect not only your computing needs but also how security conscious you are and how much effort you are willing to make to obtain the degree of security you prefer.
Regardless of your chosen configuration, the easiest time to realize it is when you are first setting up your system. Take the time to figure out the partitioning scheme that works best for you and allow for generous margins of errors before you start Parted or GParted. That way, you will save yourself the trouble of having to resize or move partitions to get a setup that works.
Infos
- LVM: http://en.wikipedia.org/wiki/Logical_Volume_Manager_%28Linux%29
- Partitioning software: http://en.wikipedia.org/wiki/List_of_disk_partitioning_software
- cfdisk: http://ss64.com/bash/cfdisk.html
- fdisk: http://en.wikipedia.org/wiki/Fdisk
- Parted: https://www.gnu.org/software/parted/
- GParted: http://gparted.sourceforge.net/
« Previous 1 2 3
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Canonical Bumps LTS Support to 12 years
If you're worried that your Ubuntu LTS release won't be supported long enough to last, Canonical has a surprise for you in the form of 12 years of security coverage.
-
Fedora 40 Beta Released Soon
With the official release of Fedora 40 coming in April, it's almost time to download the beta and see what's new.
-
New Pentesting Distribution to Compete with Kali Linux
SnoopGod is now available for your testing needs
-
Juno Computers Launches Another Linux Laptop
If you're looking for a powerhouse laptop that runs Ubuntu, the Juno Computers Neptune 17 v6 should be on your radar.
-
ZorinOS 17.1 Released, Includes Improved Windows App Support
If you need or desire to run Windows applications on Linux, there's one distribution intent on making that easier for you and its new release further improves that feature.
-
Linux Market Share Surpasses 4% for the First Time
Look out Windows and macOS, Linux is on the rise and has even topped ChromeOS to become the fourth most widely used OS around the globe.
-
KDE’s Plasma 6 Officially Available
KDE’s Plasma 6.0 "Megarelease" has happened, and it's brimming with new features, polish, and performance.
-
Latest Version of Tails Unleashed
Tails 6.0 is based on Debian 12 and includes GNOME 43.
-
KDE Announces New Slimbook V with Plenty of Power and KDE’s Plasma 6
If you're a fan of KDE Plasma, you'll be thrilled to hear they've announced a new Slimbook with an AMD CPU and the latest version of KDE Plasma desktop.
-
Monthly Sponsorship Includes Early Access to elementary OS 8
If you want to get a glimpse of what's in the pipeline for elementary OS 8, just set up a monthly sponsorship to help fund its continued existence.