mknod minors

Stefan Bethke stb at lassitu.de
Fri Sep 3 11:38:42 PDT 2004


Am 03.09.2004 um 20:03 schrieb Sam:

> OK, I understand the layout of the minor number
> according to sys/disklabel.h, but what's with
> the numbering scheme here?
>
> freebsd# ls -l /dev/ad0*
> crw-r-----  2 root  operator  116, 0x00010002 Nov 17  2002 /dev/ad0
> crw-r-----  2 root  operator  116,   0 Nov 17  2002 /dev/ad0a
> crw-r-----  2 root  operator  116,   1 Nov 17  2002 /dev/ad0b
> crw-r-----  2 root  operator  116,   2 Nov 17  2002 /dev/ad0c
> crw-r-----  2 root  operator  116,   3 Nov 17  2002 /dev/ad0d
> crw-r-----  2 root  operator  116,   4 Nov 17  2002 /dev/ad0e
> crw-r-----  2 root  operator  116,   5 Nov 17  2002 /dev/ad0f
> crw-r-----  2 root  operator  116,   6 Nov 17  2002 /dev/ad0g
> crw-r-----  2 root  operator  116,   7 Nov 17  2002 /dev/ad0h
> crw-r-----  2 root  operator  116, 0x00020002 Nov 17  2002 /dev/ad0s1
> crw-r-----  2 root  operator  116, 0x00020000 Nov 17  2002 /dev/ad0s1a
> crw-r-----  2 root  operator  116, 0x00020001 Nov 17  2002 /dev/ad0s1b
> crw-r-----  2 root  operator  116, 0x00020002 Nov 17  2002 /dev/ad0s1c
> crw-r-----  2 root  operator  116, 0x00020003 Nov 17  2002 /dev/ad0s1d
> crw-r-----  2 root  operator  116, 0x00020004 Nov 17  2002 /dev/ad0s1e
> crw-r-----  2 root  operator  116, 0x00020005 Nov 17  2002 /dev/ad0s1f
> crw-r-----  2 root  operator  116, 0x00020006 Nov 17  2002 /dev/ad0s1g
> crw-r-----  2 root  operator  116, 0x00020007 Nov 17  2002 /dev/ad0s1h
> crw-r-----  2 root  operator  116, 0x00030002 Nov 17  2002 /dev/ad0s2
> crw-r-----  2 root  operator  116, 0x00040002 Nov 17  2002 /dev/ad0s3
> crw-r-----  2 root  operator  116, 0x00050002 Nov 17  2002 /dev/ad0s4
>
> Why is the whole disk slice 1, but partitions within it are
> slice 0?  Why isn't the whole disk slice 0 and slice 1
> is ... slice 1 (ad0s1)?  What makes ad0s2 be partition 3?

I'm by no means an expert in this field, just a long-time user, but 
I'll try to give some answers:

ad0[a-z] are the "compatibility" partitions. I'd guess that that's the 
reason they come first, number-wise. The compatibility partitions will 
access the first FreeBSD slice on the disk, if any. They have been 
depracated long ago (I believe somewhere around 3-current), and I'd 
think you do not need to provide them, since programs having distict 
ideas about what disk devices should be called should long be gone.

Since the MS-DOS partitioning scheme does not provide an entry for the 
entire disk (like the BSD c partition would), it has to go somewhere; 
using another "slice" number-wise seems logical. And that makes ad0s2 
the "third slice" (and so on).


Stefan

-- 
Stefan Bethke <stb at lassitu.de>   Fon +49 170 346 0140



More information about the freebsd-arch mailing list