ubuntu, updated
List disks and volumes
See every disk, partition, LVM volume, mount and how full they are.
The one command to remember
lsblk -f
Shows every disk, its partitions and LVM volumes as a tree, with file system, UUID, free space and mount point.
NAME FSTYPE FSUSE% MOUNTPOINTS
sda
├─sda1
├─sda2 ext4 18% /boot
└─sda3 LVM2_member
└─ubuntu--vg-ubuntu--lv ext4 41% /
sdb ← new, empty disk
Cheat sheet
| Question | Command |
|---|---|
| Which disks and partitions exist? | lsblk |
| … with file systems and UUIDs | lsblk -f |
| … with size, model and type | lsblk -o NAME,SIZE,TYPE,MODEL,MOUNTPOINTS |
| How full is each file system? | df -h |
| … ignoring tmpfs noise | df -hT -x tmpfs -x devtmpfs |
| What is mounted where? | findmnt |
| UUID of a partition (for fstab) | sudo blkid /dev/sdb1 |
| Partition table details | sudo parted -l or sudo fdisk -l |
| LVM: physical volumes | sudo pvs |
| LVM: volume groups and free space | sudo vgs |
| LVM: logical volumes | sudo lvs |
| Swap in use | swapon --show |
| Which folders use the most space? | sudo du -xh --max-depth=1 / | sort -h |
Disk health (needs smartmontools) | sudo smartctl -H /dev/sda |
Reading the names
| Name | Type |
|---|---|
sda, sdb | SATA/SCSI/SAS or most virtual disks (VMware, Hyper-V) |
vda | KVM/Proxmox virtio disk |
nvme0n1 | NVMe disk; partitions are nvme0n1p1, nvme0n1p2 |
ubuntu--vg-ubuntu--lv | LVM volume (dashes inside names are doubled) |
loop0… | Snap packages, ignore them |
Tip: Names like
sdbcan change between reboots. Always use the UUID (fromblkidorlsblk -f) in/etc/fstab.
Disk full but df says otherwise?
- Inodes used up (many tiny files):
df -i - A deleted file is still held open by a process:
sudo lsof +L1, then restart that process.
All causes and the safe cleanups: Disk full: find and free space.