major & minor number | Unix Linux Forums | Solaris

  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

Solaris


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 07-21-2004
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

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
Sponsored Links
    #2  
Old 07-21-2004
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon (Administrator Emeritus)
 
Join Date: Aug 2001
Last Activity: 21 December 2014, 9:44 PM EST
Location: Ashburn, Virginia
Posts: 9,930
Thanks: 64
Thanked 440 Times in 261 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
    #3  
Old 07-21-2004
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.
    #4  
Old 07-21-2004
TioTony's Avatar
TioTony TioTony is offline Forum Advisor  
Bit Pusher
 
Join Date: Oct 2001
Last Activity: 21 December 2014, 10:32 PM EST
Location: Southern California
Posts: 332
Thanks: 0
Thanked 1 Time in 1 Post
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
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 06:34 AM.