Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Sep 2004 20:38:39 +0200
From:      Stefan Bethke <stb@lassitu.de>
To:        Sam <sah@softcardsystems.com>
Cc:        freebsd-arch@freebsd.org
Subject:   Re: mknod minors
Message-ID:  <794C3F76-FDD8-11D8-A251-000A95C893E4@lassitu.de>
In-Reply-To: <Pine.LNX.4.60.0409031256140.16299@athena>
References:  <Pine.LNX.4.60.0409031256140.16299@athena>

next in thread | previous in thread | raw e-mail | index | archive | help
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@lassitu.de>   Fon +49 170 346 0140



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?794C3F76-FDD8-11D8-A251-000A95C893E4>