Device Names
100%

Devices · Lesson 3

Device Names

Learn how Linux names common storage devices, partitions, logical devices, and persistent device links.

Linux device names reflect the kernel subsystem and driver presenting an interface, not always the physical connector printed on the hardware. Learn the common patterns, but discover the actual mapping on the current system before making storage changes.

SCSI-Layer Disk Names

Disks presented through the SCSI disk layer commonly use sd names. This includes many SCSI, SATA, USB-storage, and virtual disks:

  • /dev/sda: one whole disk
  • /dev/sdb: another whole disk
  • /dev/sda3: partition 3 on /dev/sda
  • /dev/sdb1: partition 1 on /dev/sdb

Letters reflect enumeration, not a durable identity. Adding a controller, changing firmware order, or attaching a device can change which disk receives a particular letter.

Under the sd naming pattern, which path denotes partition 1 on /dev/sdb?

Names That End in Digits

Some whole-device names already contain digits, so their partition names use p as a separator:

  • /dev/nvme0n1: NVMe namespace 1 on controller 0
  • /dev/nvme0n1p2: partition 2 on that namespace
  • /dev/mmcblk0: an MMC block device
  • /dev/mmcblk0p1: partition 1 on that device

NVMe devices are not normally named /dev/sdX; they use the NVMe subsystem's naming convention.

Which path denotes partition 2 of /dev/nvme0n1?

Logical and Virtual Block Devices

Linux also creates block devices that do not map one-to-one to a physical disk:

  • /dev/dm-N for device-mapper devices, often accompanied by descriptive links under /dev/mapper/
  • /dev/mdN for Linux software RAID arrays
  • /dev/loopN for regular files attached as loop block devices

Partitions, encryption layers, RAID, logical volumes, and filesystems form a stack. Use tools such as lsblk to see parent-child relationships instead of inferring the stack from a name alone.

Which location commonly provides descriptive links for device-mapper devices?

Persistent Storage Links

User-space device management creates links under /dev/disk/, commonly grouped as:

  • by-id for hardware or transport identifiers
  • by-uuid for filesystem UUIDs
  • by-label for filesystem labels
  • by-partuuid for partition-table UUIDs
  • by-path for topology-dependent paths

Choose an identifier that matches what must remain stable. A filesystem UUID identifies a filesystem, not necessarily the physical disk beneath it. Cloning a filesystem can duplicate its UUID, so verify uniqueness before relying on it.

Why are /dev/disk/by-id/ links often preferable to /dev/sdX in device-specific configuration?

Pseudo-Device Names

Names such as /dev/null, /dev/zero, and /dev/urandom describe kernel pseudo-devices rather than physical storage. /dev/null discards writes and returns end-of-file on reads; /dev/zero supplies zero bytes; /dev/urandom supplies bytes from the kernel random-number generator.

What does reading from /dev/zero produce?

Lesson complete

You finished Device Names

You can now decode common Linux storage names without treating them as permanent identity.

  • Read sdXNUMBER as an sd disk partition.

  • Use pNUMBER when the whole-device name already ends in a digit.

  • Recognize logical devices such as device mapper, RAID, and loop devices.

  • Prefer persistent links chosen for the identity you need.

  • Distinguish storage names from kernel pseudo-devices.

Keep your learning progress

Create a free account to save this lesson and continue learning on any device.

Create a free account
Next Lesson
Back to Devices