Incident guide · Storage
Linux storage and filesystem cheat sheet
Inspect mounts, block devices, SMART, RAID, LVM, ZFS, Btrfs, XFS, and ext filesystems with non-destructive checks first.50explained commands3practical sections100%concrete examples
25
Map capacity and devices
Understand filesystems, mount sources, devices, and open deleted files.
Show free disk space in human-readable unitsdf -hRead-only
Show filesystem inode usagedf -iRead-only
Show the block-device tree with filesystemslsblk -fRead-only
Show the filesystem backing a pathfindmnt -T <path>Read-only
Find open files that were deletedlsof +L1Read-only
Find the 20 largest files and folders heredu -ah . | sort -rh | head -20Read-only
Refresh a folder size every two secondswatch -n 2 du -sh <folder>Read-only
Rank the largest directories one level below a pathdu -xhd 1 <path> 2>/dev/null | sort -hr | head -<count>Read-only
Sample per-process disk I/O and rank active writerspidstat -d <seconds> <count> | awk '$4 ~ /^[0-9]+$/ {print}' | sort -k6,6nr | head -<lines>Read-only
Sample extended device latency and utilization statisticsiostat -xz <seconds> <count>Read-only
Rank directories by the number of files they containfind <path> -xdev -type f -printf '%h\n' | sort | uniq -c | sort -nr | head -<count>Read-only
Find deleted files that still consume disk spacesudo lsof -nP +L1 | sort -k7 -nr | head -<count>caution
Verify fstab syntax, mount targets, and referenced devicessudo findmnt --verify --verbosecaution
Export block devices as JSONlsblk -J -o NAME,SIZE,TYPE,MOUNTPOINTSRead-only
Show storage discard and rotational capabilitieslsblk -D -o NAME,ROTA,DISC-GRAN,DISC-MAX,DISC-ZERORead-only
Verify fstab entries without mountingfindmnt --verify --verboseRead-only
Export mounted filesystems as JSONfindmnt -J -o TARGET,SOURCE,FSTYPE,OPTIONSRead-only
Read the SMART overall health resultsmartctl -H <device>Read-only
Read important SMART device attributessmartctl -A <device>Read-only
Read the SMART error logsmartctl -l error <device>Read-only
Scan configured Linux software RAID arraysmdadm --detail --scanRead-only
Inspect a software RAID arraymdadm --detail /dev/md0Read-only
Show kernel RAID synchronization statecat /proc/mdstatRead-only
List logical volumes with deviceslvs -o lv_name,vg_name,lv_size,lv_attr,devicesRead-only
List LVM physical volume allocationpvs -o pv_name,vg_name,pv_size,pv_freeRead-only
18
Check storage health
Read device, array, volume, pool, and filesystem evidence without repairing.
Show ZFS pool health and device statezpool status -xRead-only
Show Btrfs device error countersbtrfs device stats <path>Read-only
Check XFS consistency without modifying itxfs_repair -n <device>Read-only
Show logical volume segment mappinglvs --segments -o lv_name,segtype,stripes,devicesRead-only
List ZFS pool capacity and fragmentationzpool list -o name,size,alloc,free,frag,cap,healthRead-only
Show recent ZFS pool administration historyzpool history -il | tail -10Read-only
List ZFS datasets and space usagezfs list -o name,used,avail,refer,mountpointRead-only
List ZFS snapshots by creation timezfs list -t snapshot -o name,used,creation -s creationRead-only
Show local and inherited ZFS propertieszfs get -s local,inherited compression,quota,reservation <dataset>Read-only
Show Btrfs allocation and free-space estimatesbtrfs filesystem usage -T <path>Read-only
List Btrfs subvolumes below a pathbtrfs subvolume list <path>Read-only
Show XFS geometry for a mounted filesystemxfs_info <path>Read-only
Estimate XFS metadata and data usagexfs_estimate -v <path>Read-only
Show ext filesystem superblock settingstune2fs -l <device> | head -25Read-only
Show ext filesystem check counterstune2fs -l <device> | rg 'Mount count|Check interval|Last checked'Read-only
Show ext reserved block settingstune2fs -l <device> | rg 'Reserved block count|Reserved block percentage'Read-only
List filesystem checkers available to fsckfsck -NRead-only
Check an ext filesystem without writinge2fsck -fn <device>Read-only
07
Find what consumes space
Locate large, recent, duplicate, or unexpectedly numerous files before cleanup.