Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

Block Devices

Direct answer

A block device is a device the kernel reads and writes in blocks: whole disks, partitions, RAID arrays (md), LVM logical volumes (dm), loop devices and encrypted volumes.

When to use this

Use it to understand what a /dev entry is and how storage layers stack.

First 30 seconds

1. lsblk — tree of the device.

2. findmnt -S /dev/<dev> — mounted?

3. pvs, cat /proc/mdstat, cryptsetup status — used by LVM/RAID/LUKS?

4. Size: blockdev --getsize64 /dev/<dev>.

5. Act only on unused devices.

Operational verification

physical disk → partition → optional md/dm layers → block device used by a filesystem or LVM

Evidence · next step

For Disks & Block Devices → Block Devices, continue with the first unproven Topic check: Match /dev name to major/minor, sysfs device path, model/serial where available and size. If that boundary is healthy, advance to the adjacent check: Confirm whether the node is whole disk, partition or stacked device before acting. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.

Continue only after interpreting the current observation.
Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
linux
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformlinux
Key commandlsblk
Scope / prerequisiteUse it to understand what a /dev entry is and how storage layers stack.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

5 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Operational evidence path Verify boundary

device discovery → major/minor identity → /sys block object → /dev node → queue/I/O path → partition or device-mapper consumer → workload

Healthy evidence: major/minor, sysfs path, capacity and expected hardware/virtual identity agree, I/O errors are absent and all consumers map to the intended device.

Step 2 Verification and output interpretation Verify boundary

Existing fast checks for this Topic. - Match /dev name to major/minor, sysfs device path, model/serial where available and size.

  • Confirm whether the node is whole disk, partition or stacked device before acting.
  • Review kernel I/O errors, resets, timeouts and read-only transitions around the incident.
  • Trace consumers such as PVs, filesystems, mounts or swap before any write operation.

Verification chain. device discovery → major/minor identity → /sys block object → /dev node → queue/I/O path → partition or device-mapper consumer → workload

Step 3 Commands Verify boundary
lsblk
cat /sys/block/sda/queue/rotational
blockdev --getsize64 /dev/sda
Step 4 Failure modes and next checks Narrow the fault

Suspicious evidence: the /dev name points to a different major/minor or device path than expected, the device repeatedly resets, becomes read-only or has unexpected consumers.

Step 5 Common mistakes Narrow the fault
  • Writing to a device that is in use.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points

lsblk shows the tree of layers (disk → part → lvm/crypt/raid). A busy device cannot be repartitioned or removed — find what uses it with lsblk, findmnt and pvs.

Key checks
  • lsblk -f — disks, partitions, filesystems, UUIDs and mount points
  • blkid — UUIDs, labels and types
  • fdisk -l / parted -l — partition tables
  • udevadm info /dev/<dev> — device properties
ReferenceWhat it is1 section · depth on demand

Core model

Identify the exact kernel block device by major/minor, sysfs path, size and parent hierarchy rather than relying only on a mutable /dev name. Distinguish whole-disk devices from partitions and stacked devices such as device-mapper. Confirm read/write capability, queue state and kernel errors before assuming filesystem corruption.

ReferenceImportant terms & boundaries5 sections · depth on demand

What this shows and what it does not

Block-device identity shows the kernel object being addressed, but it does not show persistent naming, partition correctness, filesystem integrity or workload safety.

udev owns userspace naming/events; partitions, LVM and filesystems own their respective metadata.

In depth

Block devices: identification and properties

A block device is storage that the kernel reads and writes in fixed-size blocks: disks, partitions, RAID arrays, logical volumes and loop devices. The lsblk(8) manual page describes how to see their properties:

  • Topology columns (-t) show alignment, minimum and optimal I/O size, and physical and logical sector sizes.
  • --discard shows whether TRIM or UNMAP is supported.
  • -d restricts output to the top-level devices, and -S to SCSI devices.

Kernel device names

NameDevice
sda, sdbSCSI, SATA, SAS and USB disks
nvme0n1, nvme0n1p1NVMe namespace and its partitions
vda, xvdaVirtio (KVM) and Xen virtual disks
md0, md127Software RAID
dm-0device-mapper (LVM, LUKS, multipath)
loop0A file used as a block device

Properties that matter

PropertyWhereWhy
Rotationallsblk -d -o NAME,ROTA; /sys/block/<dev>/queue/rotationalSSD or HDD; scheduler and tuning
Logical and physical sector sizelsblk -t; blockdev --getss --getpbsz512e versus 4Kn; alignment
Discard supportlsblk --discardTRIM via fstrim
Read-onlylsblk -o NAME,RO; blockdev --getroWrite-protected or failed devices
Size in bytesblockdev --getsize64Exact capacity

After adding or resizing a virtual disk

When a hypervisor grows a disk or adds a new one, the kernel may not notice straight away. A SCSI rescan, or echo 1 > /sys/class/block/<dev>/device/rescan, makes it reread the size.

host$ lsblk -d -t -o NAME,ROTA,LOG-SEC,PHY-SEC,MIN-IO,OPT-IO,DISC-GRAN
NAME    ROTA LOG-SEC PHY-SEC MIN-IO OPT-IO DISC-GRAN
nvme0n1    0     512     512    512      0      512B
sda        1     512    4096   4096      0        0B
host$ sudo blockdev --getsize64 /dev/sdb
2000398934016
host$ echo 1 | sudo tee /sys/class/block/sdc/device/rescan
host$ for h in /sys/class/scsi_host/host*/scan; do echo "- - -" | sudo tee "$h" >/dev/null; done
host$ dmesg | tail -3
sd 2:0:0:2: [sdc] 209715200 512-byte logical blocks: (107 GB/100 GiB)
sdc: detected capacity change from 104857600 to 209715200

Reading the topology

sda reports 512-byte logical sectors but 4096-byte physical sectors: a "512e" disk. Partitions and file systems on it must start on 4 KiB boundaries. Otherwise every write turns into a slower read-modify-write. Modern partitioning tools align to 1 MiB, which covers this.

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

How it works at runtime

Block Devices is part of Disks & Block Devices → Block Devices. Block Devices are kernel-managed random-access storage endpoints represented by major/minor device numbers and commonly exposed through /dev, including disks, virtual disks, multipath mappings and partition devices.

Topic-specific state model. Block Devices are kernel-managed random-access storage endpoints represented by major/minor device numbers and commonly exposed through /dev, including disks, virtual disks, multipath mappings and partition devices.

Interpretation rule. - Device name such as /dev/sdb ≠ stable hardware identity across every boot.

  • Block device open succeeds ≠ media and transport are error-free.
  • Correct capacity ≠ correct device selected for destructive work.
  • Partition child present ≠ whole-disk metadata and upper mappings are coherent.

Quick reference

Block devices are accessed in fixed-size blocks through the kernel block layer (multi-queue, I/O schedulers).

lsblk -t                          # logical/physical sector sizes, alignment, scheduler
cat /sys/block/sda/queue/scheduler
cat /sys/block/nvme0n1/queue/rotational
blockdev --getsize64 /dev/sda; blockdev --getss --getpbsz /dev/sda
iostat -xz 1

Schedulers: none for NVMe and fast SSD arrays, mq-deadline for SATA SSD/HDD servers, bfq for desktops. Change persistently with a udev rule (ACTION=="add|change", KERNEL=="sd*", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="mq-deadline").

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Limits and how it fails

Primary failure point. Block-device identity shows the kernel object being addressed, but it does not show persistent naming, partition correctness, filesystem integrity or workload safety.

ReferenceConfiguration & state1 section · depth on demand

Configuration, persistence and lifecycle

Distribution/platform context. Block Devices owns the kernel block abstraction and device identity. udev owns userspace naming/events; partitions, LVM and filesystems own their respective metadata.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor doclinux current

Authoritative/upstream documentation reviewed for bounded claims in Disks & Block Devices → Block Devices. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://docs.kernel.org/filesystems/index.html · confidence 94%
Technical changelog & impact

What changed and what may be affected

Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
linux block devicemajor minor linux diskdev block devicesysfs block
Embedded reference data

Quick lookup tables

Block Devices operational reference

Topic-specific lookup boundaries, proof limits and next-step Evidence for Block Devices.

Lookup boundaryTopic-specific referenceOperational use
Scope / effective stateBlock Devices are kernel-managed random-access storage endpoints represented by major/minor device numbers and commonly exposed through /dev, including disks, virtual disks, multipath mappings and partition devices.Establish exactly what this Topic owns before crossing into another subsystem.
Fast verificationPin host + incident/change time → capture block topology and stable identities → validate partition/device metadata → validate filesystem identity/integrity and effective mount namespace/options → validate PV/VG/LV/device-mapper state where used → make one controlled change at the first failed boundary → re-read effective storage state → repeat original workload I/O/acceptance test.Use the shortest evidence path first; a fast check is a boundary test, not blanket proof.
Verification chaindevice discovery → major/minor identity → /sys block object → /dev node → queue/I/O path → partition or device-mapper consumer → workloadTrace requested/configured state through effective state to the observed workload result.
Failure boundaryBlock-device identity proves the kernel object being addressed; it does not prove persistent naming, partition correctness, filesystem integrity or workload safety.Stop broad troubleshooting at the first boundary that is not supported by evidence.
Positive evidenceCorrelated Linux storage evidence can establish this proof path: device discovery → major/minor identity → /sys block object → /dev node → queue/I/O path → partition or device-mapper consumer → workloadUse this observation only for the specific claim it actually supports.
Evidence limitIt does not independently prove behavior outside the captured device, metadata, mapping, mount or workload scope. Block-device identity proves the kernel object being addressed; it does not prove persistent naming, partition correctness, filesystem integrity or workload safety.Do not promote a local success signal into end-to-end or adjacent-dependency proof.
Next troubleshooting checkContinue from the first unproven boundary: prove backing identity, then on-device metadata, then filesystem/LVM mapping and effective mount/device state, and finally repeat the original workload I/O before any additional storage change.Continue to the next unresolved boundary while preserving the original test condition.

Block Devices · operational reference

Compact Linux state, persistence, verification and boundary reference for fast lookup.

Reference boundaryBlock Devices
Topic pathDisks & Block Devices → Block Devices
Runtime stateBlock Devices are kernel-managed random-access storage endpoints represented by major/minor device numbers and commonly exposed through /dev, including disks, virtual disks, multipath mappings and partition devices.
Fast checks- Match /dev name to major/minor, sysfs device path, model/serial where available and size. - Confirm whether the node is whole disk, partition or stacked device before acting. - Review kernel I/O errors, resets, timeouts and read-only transitions around the incident. - Trace consumers such as PVs, filesystems, mounts or swap before any write operation.
Verification chaindevice discovery → major/minor identity → /sys block object → /dev node → queue/I/O path → partition or device-mapper consumer → workload Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return path or regression → explicit Evidence boundary.
Failure boundaryBlock-device identity proves the kernel object being addressed; it does not prove persistent naming, partition correctness, filesystem integrity or workload safety. Boundary chain: process/context → userspace configuration → kernel subsystem/resource → device/network/filesystem dependency → effective state → original workload.
Persistence ruleProve which configuration source owns the state, then prove that the running consumer loaded or generated the intended state.
Confirmation

Confirm action

Continue?