Questo contenuto non è disponibile nella lingua selezionata.

Chapter 3. Disk partitions


To divide a disk into one or more logical areas, use the disk partitioning utility. It enables separate management of each partition.

3.1. Overview of partitions

The hard disk stores information about the location and size of each disk partition in the partition table. Using information from the partition table, the operating system treats each partition as a logical disk. Some of the advantages of disk partitioning include:

  • Reduce the likelihood of administrative oversights of physical volumes
  • Ensure sufficient backup
  • Provide efficient disk management

3.2. Comparison of partition table types

To enable partitions on a device, format a block device with different types of partition tables. The following table compares the properties of different types of partition tables that you can create on a block device.

Note

This section does not cover the DASD partition table, which is specific to the IBM Z architecture.

Expand
Table 3.1. Partition table types
Partition tableMaximum number of partitionsMaximum partition size

GUID Partition Table (GPT)

128

8 ZiB if using 512 b sector drives 64 ZiB if using 4 k sector drives

Master Boot Record (MBR)

4 primary, or 3 primary and 1 extended partition with 56 logical partitions

2 TiB if using 512 b sector drives 16 TiB if using 4 k sector drives

3.3. GUID partition table

The GUID partition table (GPT) is a partitioning scheme based on the Globally Unique Identifier (GUID).

GPT deals with the limitations of the Mater Boot Record (MBR) partition table. The MBR partition table cannot address storage larger than 2 TiB, equal to approximately 2.2 TB. Instead, GPT supports hard disks with larger capacity. The maximum addressable disk size is 8 ZiB, when using 512 b sector drives, and 64 ZiB, when using 4096 b sector drives. In addition, by default, GPT supports creation of up to 128 primary partitions. Extend the maximum amount of primary partitions by allocating more space to the partition table.

Note

A GPT has partition types based on GUIDs. Certain partitions require a specific GUID. For example, the system partition for Extensible Firmware Interface (EFI) boot loaders require GUID C12A7328-F81F-11D2-BA4B-00A0C93EC93B.

GPT disks use logical block addressing (LBA) and a partition layout as follows:

  • For backward compatibility with MBR disks, the system reserves the first sector (LBA 0) of GPT for MBR data, and applies the name "protective MBR".
  • Primary GPT

    • The header begins on the second logical block (LBA 1) of the device. The header contains the disk GUID, the location of the primary partition table, the location of the secondary GPT header, and CRC32 checksums of itself, and the primary partition table. It also specifies the number of partition entries on the table.
    • By default, the primary GPT includes 128 partition entries. Each partition has an entry size of 128 bytes, a partition type GUID and a unique partition GUID.
  • Secondary GPT

    • For recovery, it is useful as a backup table in case the primary partition table is corrupted.
    • The last logical sector of the disk contains the secondary GPT header and recovers GPT information, in case the primary header is corrupted.
    • It contains:

      • The disk GUID
      • The location of the secondary partition table and the primary GPT header
      • CRC32 checksums of itself
      • The secondary partition table
      • The number of possible partition entries

Figure 3.1. Disk with a GUID Partition Table

Important

To successfully install the boot loader on a GPT disk on BIOS systems or UEFI systems running in BIOS compatibility mode, a BIOS boot partition must be present. For more information on required boot partitions, see Recommended partitioning scheme.

3.4. MBR disk partitions

The partition table is stored at the very start of the disk, before any file system or user data. For a more clear example, the partition table is shown as being separate in the following diagrams.

Figure 3.2. Disk with MBR partition table

As the previous diagram shows, the partition table is divided into four sections of four unused primary partitions. A primary partition is a partition on a hard disk drive that contains only one logical drive (or section). Each logical drive holds the information necessary to define a single partition, meaning that the partition table can define no more than four primary partitions.

Each partition table entry contains important characteristics of the partition:

  • The points on the disk where the partition starts and ends
  • The state of the partition, as only one partition can be flagged as active
  • The type of partition

The starting and ending points define the size and location of the partition on the disk. Some of the operating systems boot loaders use the active flag. That means that the operating system in the partition that is marked "active" is booted.

The type is a number that identifies the anticipated usage of a partition. Some operating systems use the partition type to:

  • Denote a specific file system type
  • Flag the partition as being associated with a particular operating system
  • Indicate that the partition contains a bootable operating system

The following diagram shows an example of a drive with a single partition. In this example, the first partition is labeled as DOS partition type:

Figure 3.3. Disk with a single partition

3.5. Extended MBR partitions

To create additional partitions, if needed, set the type to extended.

An extended partition is similar to a disk drive. It has its own partition table, which points to one or more logical partitions, contained entirely within the extended partition. The following diagram shows a disk drive with two primary partitions, and one extended partition containing two logical partitions, along with some unpartitioned free space.

Figure 3.4. Disk with both two primary and an extended MBR partitions

You can have only up to four primary or three primary partitions and one extended partition. There is no fixed limit to the number of logical partitions. As a limit in Linux to access partitions, a single disk drive allows maximum 60 partitions.

3.6. MBR partition types

The table below shows a list of some of the most commonly used MBR partition types and hexadecimal numbers to represent them.

Expand
Table 3.2. MBR partition types
MBR partition typeValue

Empty

00

Extended

05

Linux swap

82

Linux native

83

Linux extended

85

Win95 FAT32

0b

Win95 FAT32 (LBA)

0c

Win95 FAT16 (LBA)

0e

Win95 Extended (LBA)

0f

3.7. Partition types

There are multiple ways to manage partition types:

  • The fdisk utility supports the full range of partition types by specifying hexadecimal codes.
  • The systemd-gpt-auto-generator, a unit generator utility, uses the partition type to automatically identify and mount devices.
  • The parted utility maps out the partition type with flags. The parted utility handles only certain partition types, for example LVM, swap or RAID.

    The parted utility supports setting the following flags:

    • boot
    • root
    • swap
    • hidden
    • raid
    • lvm
    • lba
    • legacy_boot
    • irst
    • esp
    • palo

On Red Hat Enterprise Linux 10 with parted 3.5, you can use the additional flags chromeos_kernel and bls_boot.

The parted utility optionally accepts a file system type argument while creating a partition. For a list of the required conditions, see Creating a partition with parted. Use the value to:

  • Set the partition flags on MBR.
  • Set the partition UUID type on GPT. For example, the swap, fat, or hfs file system types set different GUIDs. The default value is the Linux Data GUID.

The argument does not modify the file system on the partition. It only differentiates between the supported flags and GUIDs.

The following file system types are supported:

  • xfs
  • ext2
  • ext3
  • ext4
  • fat16
  • fat32
  • hfs
  • hfs+
  • linux-swap
  • ntfs
  • reiserfs

3.8. Partition naming scheme

Red Hat Enterprise Linux uses a file-based naming scheme, with file names in the form of /dev/xxyN.

Device and partition names consist of the following structure:

/dev/
Name of the directory that contains all device files. Hard disks contain partitions, thus the files representing all possible partitions are located in /dev.
xx
The first two letters of the partition name indicate the type of device that contains the partition.
y
This letter indicates the specific device containing the partition. For example, /dev/sda for the first hard disk and /dev/sdb for the second. You can use more letters in systems with more than 26 drives, for example, /dev/sdaa1.
N

The final letter indicates the number to represent the partition. The first four (primary or extended) partitions are numbered 1 through 4. Logical partitions start at 5. For example, /dev/sda3 is the third primary or extended partition on the first hard disk, and /dev/sdb6 is the second logical partition on the second hard disk. Drive partition numbering applies only to MBR partition tables. Note that N does not always mean partition.

For disks that end with a digit, p is added for partitions. For example, the first partition on an NVMe drive nvme0n1 is nvme0n1p1.

Note

Even if Red Hat Enterprise Linux can identify and refer to all types of disk partitions, it might not be able to read the file system and therefore access stored data on every partition type. However, in many cases, it is possible to successfully access data on a partition dedicated to another operating system.

3.9. Mount points and disk partitions

In Red Hat Enterprise Linux, each partition forms a part of the storage, necessary to support a single set of files and directories. Mounting a partition makes the storage of that partition available, starting at the specified directory known as a mount point.

For example, if partition /dev/sda5 is mounted on /usr/, it means that all files and directories under /usr/ physically reside on /dev/sda5. The file /usr/share/doc/FAQ/txt/Linux-FAQ resides on /dev/sda5, while the file /etc/gdm/custom.conf does not.

Continuing the example, it is also possible that one or more directories below /usr/ would be mount points for other partitions. For example, /usr/local/man/whatis resides on /dev/sda7, rather than on /dev/sda5, if /usr/local includes a mounted /dev/sda7 partition.

Torna in cima
Red Hat logoGithubredditYoutubeTwitter

Formazione

Prova, acquista e vendi

Community

Informazioni sulla documentazione di Red Hat

Aiutiamo gli utenti Red Hat a innovarsi e raggiungere i propri obiettivi con i nostri prodotti e servizi grazie a contenuti di cui possono fidarsi. Esplora i nostri ultimi aggiornamenti.

Rendiamo l’open source più inclusivo

Red Hat si impegna a sostituire il linguaggio problematico nel codice, nella documentazione e nelle proprietà web. Per maggiori dettagli, visita il Blog di Red Hat.

Informazioni su Red Hat

Forniamo soluzioni consolidate che rendono più semplice per le aziende lavorare su piattaforme e ambienti diversi, dal datacenter centrale all'edge della rete.

Theme

© 2025 Red Hat