major & minor number

Hi

Can anyone tell me what is major number and minor number in the mknod command. Also what these numbers mean.

I have gone through the man pages but still I couldn't understand.

Regards

There are several different drivers in a system. For example if your system has a disk drive and tape drive, there would be one driver for the disk and another driver for the tape drive. Each driver gets a number called the major number. The major number just tells the kernel which driver to use.

The minor number is passed to the driver. The driver could ignore it. Or the driver can interpret any way it wants. Usually there are sub fields in the minor number. In the case of a tape driver, one sub field would say which particular tape drive to use. Another sub field might say whether or not to automatically rewind the tape when the file is closed.

You are great. I had that question in my head for months.

Linux has a devices.txt file that lists the standard major and minor number. Check out http://www.lanana.org/docs/device-list/devices.txt . It won't be the same on all *nix but it may help clarify things. I know it helped me the first time I saw it.