Fundamentals 16 min read

Master Linux Storage Management: Disk Types, Partitioning (MBR/GPT) and Mounting

This guide explains Linux storage concepts, covering mechanical and solid‑state disks, hot‑plug options, interfaces, and partitioning methods (MBR and GPT), and provides step‑by‑step commands for creating, formatting, and mounting partitions with examples of fstab configuration.

Liangxu Linux
Liangxu Linux
Liangxu Linux
Master Linux Storage Management: Disk Types, Partitioning (MBR/GPT) and Mounting

Storage Classification

Disks can be classified by technology (HDD vs SSD), hot‑plug capability, interface (IDE/SATA, SCSI/SAS, PCIe, FC), connection type (local, external, network) and partitioning scheme.

MBR Partitioning

MBR (Master Boot Record) supports up to 2 TB disks and a maximum of four primary partitions (or three primary plus one extended). The first 512 bytes contain the boot code (446 bytes) and the partition table (64 bytes). Example commands: fdisk -l /dev/sda Use fdisk to create primary, extended, and logical partitions, specifying start and end sectors or sizes (e.g., +100M).

GPT Partitioning

GPT (GUID Partition Table) removes the primary/extended limitation, allowing up to 128 partitions. It stores a protective MBR, a primary GPT header, and a backup at the end of the disk. Each partition entry is 128 bytes, and LBA0 is used for compatibility. gdisk /dev/sdb Typical steps: n to add a partition, choose partition number, default start sector, and size (e.g., +100M), then w to write the table.

Creating Filesystems

After partitioning, format partitions before storing data. Use mkfs to list supported filesystems; on CentOS 7 the default is XFS. Example for EXT4: mkfs.ext4 /dev/sdb1 Example for XFS:

mkfs.xfs /dev/sdb2

Mounting Partitions

Create mount points and mount partitions temporarily:

mkdir /data01
mkdir /data02
mount /dev/sdb1 /data01
mount /dev/sdb2 /data02

Verify with df -h and mount to see mount options (e.g., rw for EXT4, ro for XFS).

Persistent Mounts via /etc/fstab

Obtain UUIDs with blkid and add entries to /etc/fstab for automatic mounting at boot:

UUID=67e9447b-a6dd-47d2-a738-5598bc3c915 /data01 ext4 defaults 0 0
UUID=570e001f-162e-4ecd-8873-6d2c82c0edfb /data02 xfs ro 0 0

Run mount -a to apply the file.

Verification

Use df -Th to display filesystem types and usage, and mount to check mount options. Test write permissions by copying files to the mount points; read‑only mounts will reject write attempts.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

MBRGPTPartitioningStorage ManagementMounting
Liangxu Linux
Written by

Liangxu Linux

Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)

0 followers
Reader feedback

How this landed with the community

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.