Understanding GEOM Ranking System

Poul-Henning Kamp phk at phk.freebsd.dk
Thu Feb 10 00:11:31 PST 2005


In message <20050210004305.GA20199 at alzatex.com>, "Loren M. Lang" writes:
>I'm slightly confused on the ranking system use in GEOM as described in
>the geom(4) manpage.  The wording of the description seems a little
>confusing, but the way I understand it is that any geom instance which
>has no consumers attached to anything like a disk or acd geom has a rank
>of 1.  Any geom that does have some of it's consumers attached to a
>provider has a rank of the highest ranked geom providing a service to
>this geom.  For example, a ufs filesystem is running on a raid1
>configuration between partition d on slice 1 on disk ad0 mirrored with
>slice 2 on disk ad1 (no disklabel on second disk).  This makes two disk
>geoms for ad0 and ad1 both with rank 1.  Each disk geom has a mbr geom
>on top of them with rank 2 (max(1)+1).  The bsd geom on slice 1 of disk
>ad0 has rank 3 (max(2)+1).  The mirror geom on top of the bsd geom and
>the mbr geom on disk ad1 has a rank of 4 since max(2, 3)+1 = 4.  Then a
>dev geom on top of the mirror geom has a rank of 5 (max(4)+1).  That dev
>geom is what is mounted as a filesystem on freebsd.  Is this correct?
>
>dev(5) ---> mirror(4) ---> bsd(3) ---> mbr(2) ---> dev(1) ---> ad0
>                       \-------------> mbr(2) ---> dev(1) ---> ad1

Yes.  In practice you should never have to think abou the ranking,
it is only used to detect potential loops.

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.


More information about the freebsd-geom mailing list