From owner-freebsd-geom@FreeBSD.ORG Mon Oct 20 17:55:35 2008 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 228E01065681 for ; Mon, 20 Oct 2008 17:55:35 +0000 (UTC) (envelope-from marius@nuenneri.ch) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.176]) by mx1.freebsd.org (Postfix) with ESMTP id 0204B8FC1E for ; Mon, 20 Oct 2008 17:55:34 +0000 (UTC) (envelope-from marius@nuenneri.ch) Received: by wa-out-1112.google.com with SMTP id n4so1079342wag.27 for ; Mon, 20 Oct 2008 10:55:34 -0700 (PDT) Received: by 10.114.241.15 with SMTP id o15mr5641877wah.96.1224525334319; Mon, 20 Oct 2008 10:55:34 -0700 (PDT) Received: by 10.115.89.3 with HTTP; Mon, 20 Oct 2008 10:55:34 -0700 (PDT) Message-ID: Date: Mon, 20 Oct 2008 19:55:34 +0200 From: "=?ISO-8859-1?Q?Marius_N=FCnnerich?=" To: freebsd-geom@freebsd.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: Subject: Re: How to get the partition number of a GPT partition from the geom? 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: Mon, 20 Oct 2008 17:55:35 -0000 Time for an update :) On Mon, Oct 20, 2008 at 12:37 AM, Marius N=FCnnerich w= rote: > Hi all, > > I'm currently experimenting with adding a geom_label for the GPT > labels and uuid's. I'm not sure how to proceed because it's different > to FS labels. I added g_label_gpt_taste() and changed some files > according to the comment in g_label.c. > > Can I somehow determine which partion number cp->provider has? I > already check that cp->provider->geom->class->name is equal to "PART". > cp->provider->name is "md0p1" for example, do I really need to parse > that string for the number? No > I need that number as an index into the partition table. It's cp->provider->index :) > Another thing: Can I call g_part_read() which is provided by the PART > class to get the partition table of the geom or would I need to read > and parse it on my own? I don't need to, because the whole table is stored in cp->provider->geom->s= oftc. > Another idea: geom_part already provides a mechanism to get/set the > label from userspace, would it be possible to use that mechanism from > inside the geom_label? Wouldn't help, seems like userland gpart parses the dumpconf xml. A new question popped up: Is it possible to test the a geom of class PART is of "subclass" GPT? - Marius