Finding the major and minor numbers for a block device that corresponds to a SCSI disk
![]()
Linux® creates block devices that represent SCSI disks. You can find the major and minor numbers of a SCSI disk block device and its partitions from the device representation in the sysfs SCSI branch.
About this task

In Figure 1, <scsi_device>
represents a SCSI device with a block device as a child. The block device has a
name of the form sd<x>, which is a standard name that the
SCSI stack assigned to the SCSI disk block device. If the disk is partitioned, the block
directory that follows contains directories of the form
sd<x><n> that represent the partitions, where
<n> is a positive integer that identifies the partition.
Both the block device directory and the directories that represent the partitions contain an attribute dev. Read the dev attribute to find out the major and minor numbers for the entire disk or for an individual partition. The value of the dev attributes is of the form <major>:<minor>.
Procedure
# cat /sys/bus/scsi/devices/<scsi_disk>/block/sd<x>/dev
Example
# cat /sys/bus/scsi/devices/0:0:1:1/block/sda/dev 8:0
# cat /sys/bus/scsi/devices/0:0:1:1/block/sda/sda1/dev 8:1 # cat /sys/bus/scsi/devices/0:0:1:1/block/sda/sda2/dev 8:2 # cat /sys/bus/scsi/devices/0:0:1:1/block/sda/sda3/dev 8:3