Skip to main content
In this lesson, we explore disk partitions, file systems (including the EXT series and NFS), external storage devices (DAS, NAS, and SAN), and the Logical Volume Manager (LVM) in action. Each section is enhanced with hands-on labs to reinforce your learning.
The image outlines "Storage Basics," covering topics like disk partitions, Linux filesystems, external storage devices, logical volume manager, and related labs.

Block Devices

Before diving into partitions, it’s essential to understand some basic storage concepts. A block device is typically represented as a file in the /dev directory and denotes a hardware component used for data storage. Devices such as traditional spinning hard disks and solid-state disks (SSD) are common examples. Data on these devices is accessed in fixed-size blocks. You can list the block devices on your system using the lsblk command. Additionally, using ls -l in the /dev directory and filtering for lines starting with “b” helps you identify block files.
In the above lsblk output, the device sda represents the entire disk (approximately 119GB), while sda1 through sda3 indicate the individual partitions. Each block device is assigned a major and minor number:
  • The major number (8 in this case) identifies the type of block device (commonly associated with SCSI devices, hence the “sd” prefix).
  • The minor numbers differentiate among individual physical or logical devices, such as the whole disk and its partitions.

Disk Partitions

Disk partitions allow you to subdivide an entire disk into smaller segments. In our example, the SSD disk is divided into three partitions:
  • sda3 is used as the root partition.
  • sda2 (72.5GB) is mounted at /media/MM/Data and is typically used for storing backup data.
  • sda1 is mounted at /boot/efi to store boot loader files needed during system startup.
It is possible to use a disk without partitioning; however, partitioning is generally recommended because it offers improved flexibility and organization. The partition table, which holds the partition details, can be viewed using tools like lsblk or fdisk.
Another useful command is fdisk, which not only lists the partition table but also allows you to create or delete partitions. Running fdisk -l /dev/sda provides detailed information such as partition type, disk size in bytes, and sector details.
The disk label type in this example is GPT (GUID Partition Table), which offers improvements over the older MBR (Master Boot Record) scheme such as support for larger disk sizes and more partitions.

Partitioning Schemes

There are three primary types of disk partitions:
  • Primary Partition: Used for booting an operating system. Traditionally, disks could have a maximum of four primary partitions.
  • Extended Partition: Acts as a container for logical partitions; it cannot be used directly.
  • Logical Partition: Created within an extended partition to bypass the four primary partition limitation.
The image illustrates partition types on physical disks: primary, extended, and logical partitions, with diagrams showing their arrangement.
A partitioning scheme, or partition table, defines how these partitions are organized on a disk. The older MBR partitioning scheme permits only four primary partitions and limits disk sizes to 2TB (unless using an extended partition). In contrast, GPT (GUID Partition Table) supports an almost unlimited number of partitions—often limited only by the operating system, such as RHEL’s limit of 128 partitions per disk—and eliminates the 2TB disk size restriction.
The image illustrates an MBR partition scheme on a 2TB physical disk, showing primary and extended partitions with local partitions.
The image compares GPT and MBR partition schemes, highlighting GPT's unlimited partitions and no size limit, versus MBR's 2TB limit and extended partitions.
Unless your operating system requires MBR, GPT is generally the preferred choice due to its enhanced capacity and flexibility.

Creating a New Partition with GPT

For practical experience, Mohan grants Bob access to a lab machine. Bob’s system contains two disks: one (SDA) with existing partitions and another (SDB) that is unpartitioned. Running lsblk clearly indicates the unpartitioned state of SDB:
Since SDB is unpartitioned, Mohan instructs Bob to create a new partition using the gdisk command—an improved alternative to fdisk that supports GPT.
Within the gdisk interface, type ? to view all available commands. To add a new partition, press n and follow the interactive prompts:
After providing the partition details and confirming with the default hex code (8300 for Linux filesystem), finalize the changes by writing the new partition table to disk. Press W at the prompt:
The new partition (/dev/sdb1) is now available. Verify the partition creation using lsblk or fdisk -l.

Conclusion

This article covered the fundamentals of block devices, disk partitions, partitioning schemes (MBR and GPT), and demonstrated how to create a new partition using gdisk. For more detailed exercises and troubleshooting—such as addressing why Bob’s system might not display the full physical disk size—please consult the hands-on labs. For additional resources, consider exploring the following: Happy partitioning!

Watch Video

Practice Lab