Master Linux Disk Structure, Partitioning, and File System Management
This guide explains Linux disk physical and data structures, partitioning reasons and types, key file systems like XFS and swap, essential commands such as fdisk, mkfs, mount, umount, and df, and how to configure automatic mounting with /etc/fstab.
1. Disk Structure
Physical Structure
Plates: A disk contains multiple platters, each with two surfaces.
Heads: Each surface has a read/write head; the number of heads equals the number of platter surfaces.
Data Structure
Sectors: Each platter is divided into sectors, each storing 512 bytes (the minimum storage unit; partial sectors are rounded up to 512 bytes).
Tracks, Cylinders:
Disk Interface Types
HDD vs. SSD
2. Disk Partitioning
Why Partition?
Optimize I/O performance
Implement space quotas and improve recovery speed
Isolate system and applications
Install multiple operating systems
Use different file system types
Partition Types
Extended partitions cannot be used directly; they must be divided into logical partitions.
Partition Structure
Only four primary partitions are allowed.
Primary and extended partition numbers range from 1 to 4.
Logical partitions start numbering from 5.
3. File Systems
XFS File System
Stores files and directory data
High‑performance journaling file system
Default on CentOS 7 (supports data recovery)
SWAP (Swap File System)
Creates a swap partition for Linux
Other Linux‑Supported File Systems
FAT16, FAT32, NTFS
EXT4, JFS
disk Command
View or manage disk partitions fdisk -l [disk_device] or
fdisk [disk_device]fdisk -l Output Explanation
Device: partition device name
Boot: indicates bootable partition (marked with "*")
Start: starting cylinder
End: ending cylinder
Blocks: size in 1024‑byte blocks
Id: system ID (e.g., 83 for Linux EXT4, 8e for LVM)
System: partition type
Interactive Mode Commands
m, p, n, d, t, w, q
mkfs Command
Make Filesystem – creates (formats) a file system
Boot partition: used for system boot; "*" marks a bootable partition.
Scan SCSI bus without reboot:
echo "- - -" > /sys/class/scsi_host/host2/scan
Change partition type, delete partition, etc. (illustrated with images).
Typical workflow: partition → format → create mount point → mount.
4. Mounting and Unmounting File Systems
mount Command
Mount a file system or ISO image to a directory
mount [-t type] device mount_point
mount -o loop iso_image_file mount_pointumount Command
Unmount a mounted file system
umount device_path
umount mount_pointThese are temporary mounts.
Automatic Mounting via /etc/fstab
The /etc/fstab file lists mount configurations, each line containing six fields separated by spaces or tabs: /dev/sdb1 / xfs defaults 0 0 Field 1: device name or label
Field 2: mount point directory
Field 3: file system type (e.g., xfs, swap)
Field 4: mount options (e.g., defaults, rw, ro, noexec)
Field 5: dump backup flag (1 = backup, 0 = ignore)
Field 6: fsck order (0 = no check, 1 = first, 2 = later)
Adding an entry for /dev/sdb1 enables automatic mounting at boot.
5. Checking Disk Usage
df Command
df [options] [file] # df -hT
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/VolGroup-Lv_root ext4 6.7G 4.1G 2.3G 65% /
/dev/sda1 ext4 99M 11M 83M 12% /boot
tmpfs tmpfs 252M 0 252M 0% /dev/shm
/dev/sdb1 ext4 19G 173M 18G 1% /mailboxSigned-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
