Skip to main content
RunBook Academy

LinuxXIII · Disks and Block DevicesBlock devices

Block devices, naming, and disk identification

Foundation⏱ ~10 minbashlsblkblkidcat

What you'll learn

  • Identify the major Linux device naming schemes (sd, nvme, vd)
  • Use lsblk to map a kernel device to a partition and a filesystem
  • Distinguish whole-disk, partition, and virtual device naming
  • Find the disk that holds a particular mount point

Prerequisites

Verified against Ubuntu 24.04 LTS · Debian 12 (Bookworm) · RHEL 9.x · Rocky Linux 9.x · AlmaLinux 9.x · Linux kernel 6.1 LTS / 6.6 LTS · systemd 255+ · OpenSSH 8.7p1 (RHEL 9) / 9.6p1 (Ubuntu 24.04) · nftables 1.0.x · chrony 4.x · Pacemaker 2.1.x · Corosync 3.1.x · 2026-08-09

Not yet marked complete on this device.

Every disk on a Linux system has a name. The naming scheme depends on the bus the disk is attached to, the kernel driver, and how the disk is partitioned. Knowing the naming scheme is the first step in any storage diagnostic.

The major naming schemes

Read-only / Safelsblk disks
$ lsblk -d -o name,size,type,tran
NAME    SIZE TYPE TRAN
sda    100G disk
sdb    500G disk
nvme0n1 1.0T disk
vda     20G disk
loop0    1G loop
PatternBusNotes
sda, sdb, …SCSI/SATA/USBMost common on physical hardware. Disk N is sdN; partition M is sdNM.
nvme0n1, nvme1n1, …NVMeNamespace-based naming. nvme0n1 is the first namespace of the first NVMe controller.
vda, vdb, …virtio-blkVirtual disks in KVM/QEMU guests.
xvda, xvdb, …Xen virtioOlder Xen-style virtual disks.
loop0, loop1, …Loop deviceUsed for mount images, snap packages, container overlays.
mmcblk0, …MMC/SDeMMC, SD cards.

The partition naming

Each whole-disk device has partition children. The naming convention is <disk><partition>:

Read-only / Safelsblk tree
$ lsblk -o name,size,type,fstype,mountpoint
NAME          SIZE TYPE FSTYPE MOUNTPOINT
sda          100G disk
sda1          1G part ext4 /boot
sda2         99G part
├─sda2      5G lvm  ext4 /
└─sda2     94G lvm  ext4 /var
sdb         500G disk
sdb1        500G part ext4 /data
nvme0n1   1.0T disk
nvme0n1p1  1.0T part ext4 /opt
vda          20G disk
vda1         20G part ext4 /

Stable identifiers

The stable identifiers that survive reboots and hardware changes:

Read-only / Safeblkid output
$ blkid
/dev/sda1: UUID="1a2b3c4d-..." TYPE="ext4" PARTUUID="..."
/dev/sda2: UUID="5e6f7a8b-..." TYPE="LVM2_member" PARTUUID="..."
/dev/mapper/vg0-root: UUID="9a8b7c6d-..." TYPE="ext4"
/dev/sdb1: UUID="f1e2d3c4-..." TYPE="ext4" LABEL="data"
/dev/nvme0n1p1: UUID="a1b2c3d4-..." TYPE="ext4" PARTUUID="..."
/dev/vda1: UUID="p1p2p3p4-..." TYPE="ext4"

Finding which disk holds a mount point

When a filesystem fills up, the first question is “which disk?”. Three answers, in increasing detail:

Read-only / Safedf
$ df /var/log
Filesystem      Size  Used Avail Use% Mounted on
/dev/mapper/vg0-var 94G  82G  12G  87% /var
Read-only / Safelvs
$ lvs -o+devices vg0
  LV   VG   Attr    LSize   Devices
root vg0  -wi-ao  5.00G  /dev/sda2(0)
var  vg0  -wi-ao 94.00G  /dev/sda2(2048)
Read-only / Safeby-path
$ ls -l /dev/disk/by-path/
pci-0000:00:1f.2-ata-1.0 -> ../../sda
pci-0000:00:1f.2-ata-2.0 -> ../../sdb
pci-0000:01:00.0-nvme-1 -> ../../nvme0n1

Knowledge check

Knowledge check · 3 questions

  1. Q1. A disk appears as /dev/sdc after a reboot but was /dev/sda before. What is the most stable identifier to use in /etc/fstab?

  2. Q2. Which command shows the parent-child relationship between disks, partitions, and logical volumes?

  3. Q3. A filesystem keeps its UUID when it is copied onto a different logical volume.

Passing score: 75%. Answers are checked in this browser.