[Edit: Thanks to adrianmonk for correcting my math]
It’s surprisingly hard to find a definitive answer to the question of what happens with Linux block device names when you get past drive 26 (ie. counting from one, the first disk is
/dev/sda and the 26th disk is
/dev/sdz, what comes next?) I need to find out because libguestfs is currently limited to 25 disks, and this really needs to be fixed.
Anyhow, looking at the code we can see that it depends on which driver is in use.
For virtio-blk (
/dev/vd*) the answer is:
|Drive # —||Name|
For SATA and SCSI drives under a modern Linux kernel, the same as above applies except that the code to derive names works properly beyond
sdzzz up to (in theory)
sd followed by 29
z‘s! [Edit: or maybe not?]
As you can see virtio and SCSI/SATA don’t use common code to name disks. In fact there are also many other block devices in the kernel, all using their own naming scheme. Most of these use numbers instead of letters: eg:
/dev/mmcblk0 and so on.
If disks are partitioned, then the partitions are named by adding the partition number on the end (counting from
1). But if the drive name already ends with a number then a letter
p is added between the drive name and the partition number, thus: