List block devices as a tree
Show disks, partitions, loop devices, and mountpoints.
lsblkShow disks, partitions, loop devices, and mountpoints.
Disk inventory, partitions, formatting, and capacity analysis for Linux systems.
Inspect block devices, filesystems, and space usage.
Show disks, partitions, loop devices, and mountpoints.
lsblkShow disks, partitions, loop devices, and mountpoints.
Display filesystem type, label, UUID, and mountpoint.
lsblk -fDisplay filesystem type, label, UUID, and mountpoint.
Useful when you want clean inventory output for documentation or scripts.
lsblk -o NAME,SIZE,FSTYPE,TYPE,MOUNTPOINTS,UUID,MODELUseful when you want clean inventory output for documentation or scripts.
Read known filesystem, RAID, and partition metadata.
blkidRead known filesystem, RAID, and partition metadata.
Display the live mount tree with source, target, and options.
findmntDisplay the live mount tree with source, target, and options.
findmnt -S /dev/sda1Filter the mount table by source device.
Display used and available capacity in human-readable units.
df -hDisplay used and available capacity in human-readable units.
Check inode exhaustion when space looks free but writes fail.
df -iCheck inode exhaustion when space looks free but writes fail.
Estimate disk usage for the current directory tree.
du -sh .Estimate disk usage for the current directory tree.
Great first pass for finding where storage is going.
du -xh --max-depth=1 /var | sort -hGreat first pass for finding where storage is going.
Inspect block size, available blocks, and filesystem ID for a mounted path.
stat -f /varInspect block size, available blocks, and filesystem ID for a mounted path.
Read magic signatures from a block device or image.
file -s /dev/sdbRead magic signatures from a block device or image.
Create, inspect, and label partitions.
Show disks, sector sizes, partition tables, and partitions.
sudo fdisk -lShow disks, sector sizes, partition tables, and partitions.
Interactive MBR/GPT partitioning for a specific disk.
sudo fdisk /dev/sdbInteractive MBR/GPT partitioning for a specific disk.
Display partition table details using parted.
sudo parted /dev/sdb printDisplay partition table details using parted.
sudo parted /dev/sdb mklabel gptInitialize a disk with a GPT partition table.
sudo parted -a optimal /dev/sdb mkpart primary ext4 1MiB 100%Create a partition aligned for modern disks.
Refresh partition table changes without rebooting.
sudo partprobe /dev/sdbRefresh partition table changes without rebooting.
Useful for backups and repeatable partition layouts.
sudo sfdisk -d /dev/sdb > sdb.partitionsUseful for backups and repeatable partition layouts.
Replay a previously exported partition layout.
sudo sfdisk /dev/sdb < sdb.partitionsReplay a previously exported partition layout.
See what signatures exist before repurposing a disk.
sudo wipefs /dev/sdbSee what signatures exist before repurposing a disk.
Remove existing filesystem, RAID, or partition signatures.
sudo wipefs -a /dev/sdbRemove existing filesystem, RAID, or partition signatures.
blkid -o export /dev/sdb1Good for preparing stable fstab entries.
Wait until udev finishes processing newly created partitions.
sudo udevadm settleWait until udev finishes processing newly created partitions.
Create filesystems and inspect or tune metadata.
sudo mkfs.ext4 /dev/sdb1Format a partition as ext4.
sudo mkfs.xfs /dev/sdb1Format a partition as XFS.
sudo mkfs.vfat -F 32 /dev/sdb1Useful for EFI partitions or removable media.
sudo mkswap /dev/sdb2Initialize a partition or file as swap.
Assign a human-readable label to an ext filesystem.
sudo e2label /dev/sdb1 dataAssign a human-readable label to an ext filesystem.
sudo xfs_admin -L data /dev/sdb1Assign a label to an XFS filesystem.
Inspect features, UUID, mount count, and reserved blocks.
sudo tune2fs -l /dev/sdb1Inspect features, UUID, mount count, and reserved blocks.
Lower reserved space on large non-root data volumes.
sudo tune2fs -m 1 /dev/sdb1Lower reserved space on large non-root data volumes.
Show ext superblock and journal settings.
sudo dumpe2fs -h /dev/sdb1Show ext superblock and journal settings.
sudo xfs_info /mnt/dataDisplay XFS geometry and feature flags.
sudo swapon /dev/sdb2Turn on swap after creating it.
swapon --showInspect active swap devices and priorities.