Block device naming-scheme
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
- <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
Name that is used by the device driver | Standard device node | Minor number | Description |
---|---|---|---|
|
|
|
First block device and up to 15 partitions |
|
|
|
Second block device and up to 15 partitions |
|
|
|
<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.