Block device naming-scheme

Red Hat Enterprise Linux 9.2 KVM guest

Applications access block devices through device nodes. The virtio-blk device driver uses 16 device nodes for each block device: one for the block device itself and 15 for partitions.

The standard device nodes are of the form:
  • /dev/vd<x> for the block device
  • /dev/vd<x><n> for partitions
where
<x>
represents one or more alphabetic characters; vd<x> matches the device name that is used by the virtio-blk device driver.
<n>
is an integer in the range 1-15.
All of these nodes use the same major number. You can find the major number by issuing the following command:
# cat /proc/devices | grep virtblk
Table 1. Naming scheme for virtio block devices
Name that is used by the device driver Standard device node Minor number Description
vda
vda1
vda2
...
vda15
/dev/vda
/dev/vda1
/dev/vda2
...
/dev/vda15
0
1
2
...
15
First block device and up to 15 partitions
vdb
vdb1
vdb2
...
vdb15
/dev/vdb
/dev/vdb1
/dev/vdb2
...
/dev/vdb15
16
17
18
...
31
Second block device and up to 15 partitions
vd<x>
vd<x>1
vd<x>2
...
vd<x>15
/dev/vd<x>
/dev/vd<x>1
/dev/vd<x>2
...
/dev/vd<x>15
(<m>-1)×16
(<m>-1)×16+1
(<m>-1)×16+2
...
(<m>-1)×16+15
<m>-th block device with up to 15 partitions

With 1,048,576 (20-bit) available minor numbers, the virtio-blk device driver can address 65,536 block devices and their partitions. For the first 26 devices, <x> is one alphabetic character (vda-vdz). The next devices use first two (vdaa-vdzz) and then more alphabetic characters.

The mapping of standard device nodes to bus-IDs can change when Linux is rebooted or when hotplug events occur. Your distribution might provide udev rules that create other nodes to attain a persistent mapping between device nodes and bus-IDs.