Operating System - Linux
1823063 Members
3144 Online
109645 Solutions
New Discussion юеВ

major and minor numbers in Linux

 
SOLVED
Go to solution
Rumen Ginev
Frequent Advisor

major and minor numbers in Linux

Hi,

In HP-UX major number of a device file represents the device driver in the kernel and from the minor number one can extracts the hw path of the device.
What do major and minor numbers in Linux mean? What information they can bring for us?

Thanks,
Rumen
4 REPLIES 4
Vincent Fleming
Honored Contributor
Solution

Re: major and minor numbers in Linux

The same.

The major number is the slot in the devsw tables in the kernel that the driver occupies. The two tables b_devsw and c_devsw are the block and character device switch tables. Block device file major numbers are actually an index into the b_devsw table, and similarly, character device major numbers are index into the c_devsw table.

The minor numbers, by definition, are defined by the driver itself. Check the man pages for the particular device driver to find out what the minor numbers mean. Typically they indicate a unique subdevice, such as a bus, id, and lun for scsi devices. Some devices, such as ptys, the devices are simply numbered 1, 2, 3, 4, etc. They can mean anything the device driver writer desires.

Have fun
No matter where you go, there you are.
Kodjo Agbenu
Honored Contributor

Re: major and minor numbers in Linux

Hello,

Just an additional information : in Linux, you can find the list of minor numbers and their meanings in the kernel documentation. If installed in your system, check /usr/src/linux/Documentation/devices.txt. Otherwise :

http://www.linuxhq.com/kernel/v2.4/doc/devices.txt.html

Good luck.

Kodjo
Learn and explain...
Rumen Ginev
Frequent Advisor

Re: major and minor numbers in Linux

Sorry for the late points assignment.

Kodjo, I now about devices.txt document. It is very useful in case of recreating lost device files. In this document one can find major and minor numbers for almost every device file, but can not find the answer of my question.

Regards,

Rumen
Andrea Rossi
Frequent Advisor

Re: major and minor numbers in Linux

cat /proc/devices