Unix/Linux Go Back    

Solaris The Solaris Operating System, usually known simply as Solaris, is a Unix-based operating system introduced by Sun Microsystems. The Solaris OS is now owned by Oracle.

major & minor number


Thread Tools Search this Thread Display Modes
Old Unix and Linux 07-21-2004   -   Original Discussion by RajaRC
RajaRC RajaRC is offline
Registered User
Join Date: Sep 2003
Last Activity: 7 March 2009, 4:32 AM EST
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
major & minor number


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.

Sponsored Links
Old Unix and Linux 07-21-2004   -   Original Discussion by RajaRC
Perderabo's Unix or Linux Image
Perderabo Perderabo is offline Forum Advisor  
Unix Daemon (Administrator Emeritus)
Join Date: Aug 2001
Last Activity: 26 February 2016, 12:31 PM EST
Location: Ashburn, Virginia
Posts: 9,930
Thanks: 64
Thanked 471 Times in 271 Posts
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.
Sponsored Links
Old Unix and Linux 07-21-2004   -   Original Discussion by RajaRC
izy100 izy100 is offline
Registered User
Join Date: Nov 2002
Last Activity: 9 June 2009, 4:53 AM EDT
Location: Singapore
Posts: 128
Thanks: 0
Thanked 1 Time in 1 Post
You are great. I had that question in my head for months.
Old Unix and Linux 07-21-2004   -   Original Discussion by RajaRC
TioTony's Unix or Linux Image
TioTony TioTony is offline Forum Advisor  
Bit Pusher
Join Date: Oct 2001
Last Activity: 25 December 2016, 8:03 PM EST
Location: Southern California
Posts: 348
Thanks: 0
Thanked 3 Times in 3 Posts
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.
Sponsored Links

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to filter out major and minor? bhaskar_m Shell Programming and Scripting 4 09-01-2009 05:53 AM
Difference between Major and Minor in AIX AIXlearner AIX 5 05-23-2009 08:05 PM
Help with Major and minor number wisdom Solaris 2 03-09-2009 09:13 PM
sort major.minor.release_build_x gurpal2000 Shell Programming and Scripting 4 08-01-2008 10:44 PM
Device Major/Minor numbers zazzybob Programming 1 06-21-2004 10:24 AM

All times are GMT -4. The time now is 05:08 PM.