SadServers
  • Scenarios
  • Labs
    All Labs Linux & Bash Web Servers Databases Data Processing Docker Kubernetes CI/CD Infrastructure as Code Tooling / Applications
  • Dashboard
  • Solutions
    For Individuals For Businesses
  • Ranking
  • Newsletter
  • Documentation
    FAQ Support Pro Accounts Pro+ Accounts Business Accounts Gift API CLI/TUI Privacy Troubleshooting Interviews
  • Blog
  • Pricing
  • Gift
    Gift Purchase Gift Redeem
  • About
Log In - Sign Up
  1. Labs
  2. Disk volumes
  3. Cheatsheet

Guide

Concepts and learning path

Troubleshooting

Failure modes and fixes

Cheatsheet

Commands to keep handy

Disk volumes cheatsheet

Inspection

CommandDescription
df -hTFilesystem usage and types (human-readable)
df -iInode usage per filesystem
du -sh /path/*Directory sizes one level deep
du -xhd1 /varStay on one filesystem, human sizes
lsblk -fBlock devices, FS type, UUID, mount points
blkidUUID and filesystem labels
findmntActive mounts (tree or table)
mount | column -tCurrently mounted filesystems

Mount & unmount

CommandDescription
mount /dev/sdb1 /mnt/dataMount a partition
mount UUID=xxx /mnt/dataMount by UUID
umount /mnt/dataUnmount (not busy)
mount -o remount,rw /Remount root read-write
mount -aMount everything in fstab (test after edits)

Partitions & formatting

CommandDescription
fdisk -lList partition tables
parted /dev/sdb printPartition info (GPT/MBR)
mkfs.ext4 /dev/sdb1Create ext4 filesystem
mkfs.xfs /dev/mapper/vg-lvCreate xfs filesystem
fsck -f /dev/sdb1Check/repair (unmounted FS only)

LVM

CommandDescription
pvs / vgs / lvsPhysical / volume / logical volume summary
pvdisplay / vgdisplay / lvdisplayDetailed LVM info
pvcreate /dev/sdbInitialize disk for LVM
vgextend myvg /dev/sdbAdd PV to volume group
lvextend -L +10G /dev/myvg/mylvGrow logical volume by 10G
lvextend -l +100%FREE /dev/myvg/mylvUse all free space in VG
resize2fs /dev/myvg/mylvGrow ext4 to fill LV
xfs_growfs /mount/pointGrow xfs (mount point, not device)

Finding what uses space

CommandDescription
ncdu /Interactive disk usage browser
lsof +L1Deleted files still held open
find /var -xdev -type f -size +100MLarge files on one filesystem
journalctl --disk-usagesystemd journal size

Example /etc/fstab line

# device mount type options dump pass UUID=abc-123-def /data ext4 defaults,nofail 0 2 /dev/mapper/vg-lv /var xfs defaults 0 0

Cloud disk resize (typical flow)

# 1. Grow volume in cloud console, then on the VM: lsblk # confirm larger disk growpart /dev/nvme0n1 1 # grow partition (cloud-utils) pvresize /dev/nvme0n1p1 # if LVM on partition lvextend -l +100%FREE /dev/vg/lv resize2fs /dev/vg/lv # ext4 — or xfs_growfs /mount

Pro tips

  • Always use UUID= in fstab — /dev/sdX names can change across reboots
  • Run mount -a after editing fstab before rebooting
  • Check inode usage with df -i when df -h shows free space but writes fail
  • Grow the LV before the filesystem — order matters

Practice scenarios

Hands-on Disk volumes scenarios on live Linux VMs: disk volumes

SadServersSadServers

Real-world Linux and DevOps scenarios for hands-on learning and technical assessment.

Uptime Robot ratio (30 days)
Product
  • Scenarios
  • For Individuals
  • For Businesses
  • Pricing
Resources
  • FAQ
  • Blog
  • Newsletter
Company
  • About Us
  • Support
  • Privacy Policy
  • Terms of Service
  • Contact
Connect With Us
info@sadservers.com

Made in Canada 🇨🇦
Updated: 2026-06-13 16:06 UTC – 2d2950a