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

QuestionCommand
Which disks and partitions exist?lsblk
… with file systems and UUIDslsblk -f
… with size, model and typelsblk -o NAME,SIZE,TYPE,MODEL,MOUNTPOINTS
How full is each file system?df -h
… ignoring tmpfs noisedf -hT -x tmpfs -x devtmpfs
What is mounted where?findmnt
UUID of a partition (for fstab)sudo blkid /dev/sdb1
Partition table detailssudo parted -l or sudo fdisk -l
LVM: physical volumessudo pvs
LVM: volume groups and free spacesudo vgs
LVM: logical volumessudo lvs
Swap in useswapon --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

NameType
sda, sdbSATA/SCSI/SAS or most virtual disks (VMware, Hyper-V)
vdaKVM/Proxmox virtio disk
nvme0n1NVMe disk; partitions are nvme0n1p1, nvme0n1p2
ubuntu--vg-ubuntu--lvLVM volume (dashes inside names are doubled)
loop0…Snap packages, ignore them

Tip: Names like sdb can change between reboots. Always use the UUID (from blkid or lsblk -f) in /etc/fstab.

Disk full but df says otherwise?

All causes and the safe cleanups: Disk full: find and free space.

§ home
~/knubertus/home/
1,1 Top