How To Identify Major and Minor Number For Block Devices

How to identify major and minor device number?

Now, if you want to know the major and minor number of these devices, cd to /dev directory and do ls -l as shown below, which will show both major and minor number

$ cd /dev

/dev$ ls -l sda2
brw-rw—- 1 root disk 8, 2 Jan 7 22:11 sda2

[Note: Major for /dev/sda1 is 8 and minor is 2]

The major numbers for SCSI and IDE doesn’t change and has the following hard-coded value.

* SCSI (/dev/sd?) Major Number is 8
* IDE (/dev/hd?) Major Number is 3

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.