Ask Your Question

What do major and minor refer in the command 'mknod' ?

asked 2013-08-29 09:54:29 -0500

baptistemm gravatar image


reading the man page of mknod there is 2 optional parameters which are 'MAJOR' and 'MINOR'. What doe these numbers refer to and what are their use ?



edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2013-08-29 11:04:52 -0500

rheldaemon gravatar image


Interesting question and it is already answered at stackoverflow here is the link: and study the first answer which contains all information. IMHO one of the best answers about mknod, IBM's documentation is also great:


edit flag offensive delete link more


Your link answers my other related question (are the ids at each boot or well-defined?) I found what I was looking for on

baptistemm gravatar imagebaptistemm ( 2013-08-29 12:33:57 -0500 )edit

answered 2013-08-29 11:47:03 -0500

Gareth Jones gravatar image

updated 2013-08-29 11:48:55 -0500

There’s plenty on the web, as rheldaemon points out, but as a (simplified) quick summary:

When a device driver is loaded in Linux, it requests a unique ID (number) from the kernel. This is the major number. For each device that the driver provides support for, it allocates a unique (to the driver) ID, the minor number.

The kernel puts that information in virtual files in /sys. The kernel and UDev daemon between them maintain the files in /dev, which are essentially just aliases allowing software to identify and access devices. They’re basically just files containing the major and minor numbers (just like symbolic links contain file-names), and when a device node is opened, the numbers are used by the kernel to identify the driver and device that will handle the I/O.

edit flag offensive delete link more


thanks for the answer

baptistemm gravatar imagebaptistemm ( 2013-08-29 12:32:21 -0500 )edit

Question Tools


Asked: 2013-08-29 09:54:29 -0500

Seen: 2,904 times

Last updated: Aug 29 '13