Choosing a partitioning scheme
The Sum of the Parts
![](/var/linux_magazin/storage/images/issues/2014/160/command-line-partitioning/78002293_20.png/607230-1-eng-US/78002293_20.png_medium.png)
Despite the popularity of LVM, traditional partitioning is still preferred by some admins. We provide some tips to consider before choosing a partitioning scheme for your setup.
Partitioning a hard disk used to be simple. You had one large partition for the Linux operating system and one swap partition to provide additional virtual memory when your RAM ran out. Today, however, you are often well-advised to consider more complex partitioning schemes.
Especially on networks, traditional partitioning is often replaced today by Logical Volume Management (LVM) [1], an alternative method for dividing hard drives. LVM has several advantages over traditional partitioning, including the ability to hot-swap disks and to create a single logical volume that spans multiple hard disks. In particular, with LVM, the resizing and moving of partitions is much easier and quicker than with traditional partitioning, which can take six or seven hours to resize a 1TB partition.
Both LVM and traditional partitioning help contain runaway processes and applications that might otherwise crash the system. Both, too, work well with disk-oriented backup applications and can help increase system security by marking key directories as read-only for everyday use. However, when LVM goes down, it can make all partitions inaccessible. By contrast, with traditional partitioning, the failure of one partition often leaves the others recoverable. For this reason, many administrators continue to regard traditional partitioning as the preferred way to divide hard disks.
Numerous tools are available for traditional partitioning [2], including cfdisk [3] and fdisk [4], which are useful only for adding or deleting partitions, and GNU Partition Editor (Parted) [5], which also resizes and moves partitions. Other tools, such as Gnome Partition Editor (GParted) [6] give Parted a graphical front end. All these tools are reliable, but none should be used without first making a backup and either unmounting the partitions to be edited or – better still – booting from a Live CD so that all partitions on the system are unmounted.
Before you use any of these tools, however, you need to know which directories you want on separate partitions and the size required for each partition. Installation programs for distributions sometimes suggest partitioning schemes and partition sizes, but check these suggestions against your own needs; for example, I find that the Debian installer consistently underestimates the partition sizes.
In fact, even after you are sure of your needs, you might want to increase the sizes by 25 to 100 percent to allow for future growth. After all, who can know how your needs are going to change in the three to five years you are likely to be using the system?
Mapping Directories to Partitions
New Linux users are often told to make their system consist of one root and one swap partition. However, the size of modern hard drives could make this arrangement inefficient and a waste of space.
Conversely, some directories, such as /etc
and /bin
should generally not be given their own partitions, because putting them anywhere other than on the root partition may make them hard for the system to find. Also, more than about half a dozen partitions could bring its own inefficiencies as the system constantly switches between them.
Whatever partitions you create, use the e2label
command to give them the name of the directory they will carry. The command has the structure
e2label PARTITION LABEL
and returns no input. As you work with your system, labels like /var
and /tmp
will be far more meaningful to you than /dev/sda2
or /dev/sda3
and will free you from having to make deductions based on size.
Exactly which directories go on separate partitions will depend on your own needs and preferences. However, I will outline some of the considerations that should influence your final choice.
/ (root)
For your system to start properly, the root directory must contain /bin
, /dev/
, /etc/
, /initrd
, /lib
, /root
, and /sbin
. Ordinarily, it should also contain /boot
, but on most modern systems you can have a separate /boot
partition.
Under ordinary circumstances, 25GB should be adequate for the root partition. However, increase this size if you regularly add new kernels without deleting old ones, or use plenty of applications like Calibre or LibreOffice's own binaries that install to /opt
.
/boot
The boot partition includes Linux kernels, ramdisks, and bootloaders. By isolating the boot function from the rest of the system, you may be able to minimize corruption to the files necessary to start the system by isolating them from those used to keep the system running. For added security, mark /boot
read only, temporarily changing the permissions when installing new kernels.
Typically, 50-100MB is a reasonable size for /boot
. However, if you have more than half a dozen kernels, consider increasing the size or else be careful to delete unused ones.
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.
![Learn More](https://www.linux-magazine.com/var/linux_magazin/storage/images/media/linux-magazine-eng-us/images/misc/learn-more/834592-1-eng-US/Learn-More_medium.png)
News
-
NVIDIA Released Driver for Upcoming NVIDIA 560 GPU for Linux
Not only has NVIDIA released the driver for its upcoming CPU series, it's the first release that defaults to using open-source GPU kernel modules.
-
OpenMandriva Lx 24.07 Released
If you’re into rolling release Linux distributions, OpenMandriva ROME has a new snapshot with a new kernel.
-
Kernel 6.10 Available for General Usage
Linus Torvalds has released the 6.10 kernel and it includes significant performance increases for Intel Core hybrid systems and more.
-
TUXEDO Computers Releases InfinityBook Pro 14 Gen9 Laptop
Sporting either AMD or Intel CPUs, the TUXEDO InfinityBook Pro 14 is an extremely compact, lightweight, sturdy powerhouse.
-
Google Extends Support for Linux Kernels Used for Android
Because the LTS Linux kernel releases are so important to Android, Google has decided to extend the support period beyond that offered by the kernel development team.
-
Linux Mint 22 Stable Delayed
If you're anxious about getting your hands on the stable release of Linux Mint 22, it looks as if you're going to have to wait a bit longer.
-
Nitrux 3.5.1 Available for Install
The latest version of the immutable, systemd-free distribution includes an updated kernel and NVIDIA driver.
-
Debian 12.6 Released with Plenty of Bug Fixes and Updates
The sixth update to Debian "Bookworm" is all about security mitigations and making adjustments for some "serious problems."
-
Canonical Offers 12-Year LTS for Open Source Docker Images
Canonical is expanding its LTS offering to reach beyond the DEB packages with a new distro-less Docker image.
-
Plasma Desktop 6.1 Released with Several Enhancements
If you're a fan of Plasma Desktop, you should be excited about this new point release.