LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-20-2008, 09:15 AM   #1
raj_hcl1986@rediffma
LQ Newbie
 
Registered: Oct 2008
Posts: 21

Rep: Reputation: 15
Major and Minor numbers with partitions


HI

Pls tell me what are major and minor nos given with different partitions in /proc/partitions.
 
Old 10-20-2008, 09:56 AM   #2
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
The info you seek is on the Documentation/devices.txt file on your kernel source tree.

A little fragment as an example:

Code:
  8 block SCSI disk devices (0-15)
      0 = /dev/sda    First SCSI disk whole disk
     16 = /dev/sdb    Second SCSI disk whole disk
     32 = /dev/sdc    Third SCSI disk whole disk
        ...
    240 = /dev/sdp    Sixteenth SCSI disk whole disk

    Partitions are handled in the same way as for IDE
    disks (see major number 3) except that the limit on
    partitions is 15.
Mine are:

Code:
brw-rw---- 1 root disk 8,  0 oct 18 17:11 /dev/sda
brw-rw---- 1 root disk 8,  1 oct 18 15:11 /dev/sda1
brw-rw---- 1 root disk 8,  2 oct 18 17:11 /dev/sda2
brw-rw---- 1 root disk 8, 16 oct 18 17:11 /dev/sdb
brw-rw---- 1 root disk 8, 17 oct 18 15:11 /dev/sdb1
brw-rw---- 1 root disk 8, 18 oct 18 17:11 /dev/sdb2
brw-rw---- 1 root disk 8, 32 oct 18 17:11 /dev/sdc
brw-rw---- 1 root disk 8, 33 oct 18 17:11 /dev/sdc1
brw-rw---- 1 root disk 8, 42 oct 18 15:11 /dev/sdc10
brw-rw---- 1 root disk 8, 43 oct 18 17:11 /dev/sdc11
brw-rw---- 1 root disk 8, 34 oct 18 15:11 /dev/sdc2
brw-rw---- 1 root disk 8, 35 oct 18 17:11 /dev/sdc3
brw-rw---- 1 root disk 8, 37 oct 18 17:11 /dev/sdc5
brw-rw---- 1 root disk 8, 38 oct 18 15:11 /dev/sdc6
brw-rw---- 1 root disk 8, 39 oct 18 17:11 /dev/sdc7
brw-rw---- 1 root disk 8, 40 oct 18 17:11 /dev/sdc8
brw-rw---- 1 root disk 8, 41 oct 18 17:11 /dev/sdc9
You can see that the disks are numbered with major 8, which is the number for scsi drives (SATA disks are seen as SCSI drives) as said on the header of that section (8 block SCSI disk devices). There are several numbers for IDE drives, grep that file to see them.

Minor numbers are as specified. The whole device is numbered as 0, 16, 32.. (n-1)*16. The partitions are numbered with the minor number for the drive + the number of partition. Thus, if sdb is 16, sdb1 is 17. Note that it's the partition number which counts, and not the order. For example, if sdc is 32, sdc3 is 35, and sdc5 is 37 even if sdc4 doesn't exist.

For more complete info look at that file and/or the kernel source code.
 
Old 10-20-2008, 10:15 AM   #3
raj_hcl1986@rediffma
LQ Newbie
 
Registered: Oct 2008
Posts: 21

Original Poster
Rep: Reputation: 15
Gr8. It was useful. Thanks
 
Old 05-12-2013, 06:07 PM   #4
fmillion
Member
 
Registered: Nov 2006
Posts: 93

Rep: Reputation: 27
incorrect post replied to, please ignore

Last edited by fmillion; 05-12-2013 at 06:08 PM. Reason: incorrect post replied to
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to find major and minor device numbers Steve Riley Red Hat 2 03-25-2008 06:46 PM
special device node minor and major numbers crash88 Linux - General 1 06-22-2006 12:17 PM
Where can i find major and minor numbers yugandhar Linux - Software 1 06-02-2006 03:30 AM
Mouse mknod major/minor numbers? BlurredWeasel Linux - Hardware 2 11-06-2003 02:22 PM
devfs max major/minor numbers devershetty Linux - Newbie 1 06-17-2003 09:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration