Disk and storage management is a core sysadmin discipline that spans everything from querying free space to building redundant RAID arrays. Linux exposes a rich, layered toolkit β starting with read-only observation commands like df and lsblk, through partitioning tools such as fdisk and parted, on to filesystem creation with mkfs, persistent mounting via /etc/fstab, and flexible logical-volume abstraction through LVM. The key mental model is the storage stack: raw block devices β partition tables β filesystems β mount points β and every command in this cheat sheet operates at one of those layers.
What This Cheat Sheet Covers
This topic spans 18 focused tables and 183 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
Table 1: Disk Space and Usage Observation
These are the commands you reach for first when diagnosing storage issues or auditing capacity. df reports filesystem-level free/used blocks while du digs into directory trees; together they answer "how full is the disk?" and "what is taking up space?"
| Command | Example | Description |
|---|---|---|
df -h | Reports free and used space on all mounted filesystems in human-readable units (K, M, G, T). | |
df -hT | Adds a filesystem type column (ext4, xfs, tmpfs) alongside usage data; useful to distinguish local vs. network mounts. | |
df -ih | Shows inode usage instead of block usage; critical when writes fail despite df -h showing free space. | |
df -hT /home | Checks space and type for the filesystem hosting a specific path. | |
df -t ext4 -h | Filters output to only the specified filesystem type. | |
df -x tmpfs -h | Excludes a filesystem type from output; removes tmpfs/devtmpfs clutter for a cleaner view. | |
df -h --total | Appends a grand-total row summing all listed filesystems. | |
df --output=source,size,used,avail,pcent | Selects specific columns to display, useful for scripting. |