From owner-freebsd-geom@FreeBSD.ORG Fri Feb 9 23:05:04 2007 Return-Path: X-Original-To: geom@FreeBSD.org Delivered-To: freebsd-geom@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E958C16A400 for ; Fri, 9 Feb 2007 23:05:04 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id A195413C48E for ; Fri, 9 Feb 2007 23:05:04 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (critter.freebsd.dk [192.168.48.2]) by phk.freebsd.dk (Postfix) with ESMTP id 992661747B; Fri, 9 Feb 2007 23:05:02 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.13.8/8.13.8) with ESMTP id l19N51B8006782; Fri, 9 Feb 2007 23:05:01 GMT (envelope-from phk@critter.freebsd.dk) To: Marcel Moolenaar From: "Poul-Henning Kamp" In-Reply-To: Your message of "Fri, 09 Feb 2007 11:27:33 PST." Date: Fri, 09 Feb 2007 23:05:01 +0000 Message-ID: <6781.1171062301@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: geom@FreeBSD.org Subject: Re: g_part partition tool -- some logistic questions X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Feb 2007 23:05:05 -0000 In message , Marcel Moolenaar wri tes: >The first question relates to finding and presenting the right >devices/providers to the users. What I don't want is present, >for example, ad0 and ad1 if they are part of a mirror. I'd like >to present the mirror to the user. The same applies to other >GEOM classes. > >Is there a generic or established way to walk the GEOM tree >(obtained by geom_gettree()), and find the real or true virtual >storage providers that takes the hierarchy into account? There are no providers that are more "real" or "true" than others, they are all "just" providers. If you want to add a "desirability" property to the providers, then I'm all for it, provided you explain up front how you expect it to actually work. If you have bsd(mirror(ad0,ad1)), then the BSD parts should be more desirable than the mirror or the disks. If on the other hand you have mirror(bsd(ad0),bsd(ad1)), then the mirror should be more desirable than the bsd's and the disks. It follows from this that just assigning a desirability to a class or an instance is not trivial. In general however, I think we can do a pretty good approximation to "DWIM" by using the rank property, because in general people don't stack things up if they don't want to get upwards. So you may want to try something like pruning everything but the highest ranking leaf providers in each subtree and see where that gets you. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@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.