Operations 6 min read

Guidelines for Partitioning and Formatting Large Disks on Linux (GPT, XFS, EXT4)

This guide explains how to manage large Linux disks by using GPT partition tables, choosing XFS or EXT4 filesystems, performing partitioning with parted, formatting with appropriate mkfs commands, handling e2fsprogs version requirements, and considerations for lazy init and snapshot impacts.

Practical DevOps Architecture
Practical DevOps Architecture
Practical DevOps Architecture
Guidelines for Partitioning and Formatting Large Disks on Linux (GPT, XFS, EXT4)

For large disks on Linux, it is recommended to use the GPT partition format or treat the whole disk as a single device.

Typically XFS or EXT4 are chosen as the filesystem for big volumes.

Disk Partition Management

Use parted to partition disks. The command fdisk -l can list disks, but for large disks fdisk is not suitable and parted should be used instead.

Example to create a GPT partition table on /dev/vdb :

parted /dev/vdb

EXT4 Filesystem Formatting

Assuming the large data disk is /dev/vdb , you can format it with the following command (adjust parameters as needed):

/sbin/mke2fs –O 64bit,has_journal,extents,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize /dev/vdb1

When formatting disks larger than 16 TB, the e2fsprogs version must be at least 1.42; older versions (e.g., 1.41.11) produce errors such as "Size of device /dev/md0 too big to be expressed in 32 bits using a blocksize of 4096."

Check the e2fsprogs version and upgrade if necessary:

wget https://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v1.42.8/e2fsprogs-1.42.8.tar.gz
tar xvzf e2fsprogs-1.42.8.tar.gz
cd e2fsprogs-1.42.8
./configure
make
make install

Impact of EXT4 Lazy Init on IOPS

EXT4’s lazy init feature delays metadata initialization, which can cause reduced IOPS performance shortly after formatting. To obtain accurate performance measurements immediately after formatting, disable lazy init:

/sbin/mke2fs –O 64bit,has_journal,extents,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize -E lazy_itable_init=0,lazy_journal_init=0 /dev/vdb1

Disabling lazy init significantly increases formatting time (e.g., formatting a 32 TB disk may take 10–30 minutes).

XFS Filesystem Formatting

Formatting an XFS filesystem is simpler; the default command is:

mkfs –t xfs /dev/vdb1

Adjust XFS parameters as needed.

Important Considerations

Do Not Use Small Disk Snapshots to Create Large Disks

Although possible, creating a large disk from a small‑disk snapshot is not recommended because the snapshot only expands the block device without converting partition tables or filesystems. If the snapshot uses MBR, you cannot convert to GPT without data loss.

Impact of Disk Snapshots

Snapshot speed is proportional to data volume; larger disks result in longer snapshot times, and the amount of dirty data directly affects snapshot performance.

operationslinuxgptext4disk partitioningXFS
Practical DevOps Architecture
Written by

Practical DevOps Architecture

Hands‑on DevOps operations using Docker, K8s, Jenkins, and Ansible—empowering ops professionals to grow together through sharing, discussion, knowledge consolidation, and continuous improvement.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.