From owner-freebsd-geom@FreeBSD.ORG Sun Oct 19 17:44:36 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 DDDF51065674 for ; Sun, 19 Oct 2008 17:44:35 +0000 (UTC) (envelope-from marius@nuenneri.ch) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.182]) by mx1.freebsd.org (Postfix) with ESMTP id BBDD28FC18 for ; Sun, 19 Oct 2008 17:44:35 +0000 (UTC) (envelope-from marius@nuenneri.ch) Received: by wa-out-1112.google.com with SMTP id n4so805618wag.27 for ; Sun, 19 Oct 2008 10:44:35 -0700 (PDT) Received: by 10.115.32.8 with SMTP id k8mr4655307waj.217.1224437046324; Sun, 19 Oct 2008 10:24:06 -0700 (PDT) Received: by 10.115.89.3 with HTTP; Sun, 19 Oct 2008 10:24:06 -0700 (PDT) Message-ID: Date: Sun, 19 Oct 2008 19:24:06 +0200 From: "=?ISO-8859-1?Q?Marius_N=FCnnerich?=" To: "Cyrus Rahman" In-Reply-To: <9e77bdb50810011331y7216eac3yf85907f96f5e8370@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <9e77bdb50810011331y7216eac3yf85907f96f5e8370@mail.gmail.com> Cc: freebsd-geom@freebsd.org Subject: Re: Experiences with Gpart 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: Sun, 19 Oct 2008 17:44:36 -0000 Hello Cyrus, thanks for your experimentation. On Wed, Oct 1, 2008 at 10:31 PM, Cyrus Rahman wrote: > I recently had occasion to set up a system that needed to contain > numerous partitions, and I thought it would be a good occasion to try > gpart to divide the disk. By and large it went very well, with the > exception of bug in 'gpart bootcode' which made it necessary to > manually dd in the bootstrap. > > I did discover a few oddities that I will mention here. > > My intent was to mirror the disks with gmirror. It didn't make sense > to individually mirror each gpart partition and have some 30 > simultaneous restores going should the mirror ever break. My first > idea was to mirror the entire disks (ad4 and ad6) with gmirror and > put gpart over the mirror. > > This sort of works, except that gpart itself if it finds itself at the > beginning of the disk even when it doesn't properly taste itself on > the last block of the disk. As a result, the same gpart partitions > get attached to ad4 and ad6, as well as to the mirror. The gpart > geoms attached directly to the disks complain about the last sector > being incorrect (the backup table) and request that you fix it (which > would not likely go well). But in addition to that, any further geoms > contained within the mirror get attached to the outer gpart geoms on > ad4 and ad6 and not the mirror. They don't work properly, because the > mirror is already attached to ad4 and ad6, so you end up with a > non-functional setup. I don't know of a solution for this. Maybe GEOM itself should be extended with something like a taste priority? So that gmirror always tastes before gpart. But I do not really like this because it adds complexity. > In experimenting, I also discovered that if you directly nest gpart > tables, things work fine until you reboot. Then the internal > partitions vanish because gpart doesn't attach to them. > > Fortunately, if you put the inner gpart inside a gmirror inside the > outer gpart, things do work fine. > > This I did for two reasons: First, to avoid the aforementioned > trouble with an outermost gmirror containing a gpart geom, and second, > so that I could better define how the disk was to be mirrored. I was > able to put a number of smaller filesystems inside a single mirrored > gpart partition, and then most of the really big ones inside a second > mirrored gpart partition. This second partition used the -F option to > gmirror so that it would not need to be re-synchonized in a crash. > The filesystems within it are gjournal'd to make this possible. > > Booting was yet another issue, since the loader objects to nested > gpart partitions. I handled this by simply making a third partition > on the outermost gpt that contained the root. > > Since this is likely confusing, here's a diagram that will help if you > use a fixed font: > > ad4 ad6 > ------ ------ > gpart 1 (ad4p1) gpart 1 (ad6p1) > freebsd-boot freebsd-boot > > gpart 2 (ad4p2) gpart 2 (ad6p2) > gmirror (gm0 = ad4p2 + ad6p2) > root (gm0.p1) > > gpart 3 (ad4p3) gpart3 (ad6p3) > gmirror (gm1 = ad4p3 + ad6p3) > gpart 1 (gm1p1) > gpart 2 (gm1p2 > ... > gpart n (gm1pn) > > gpart 3 (ad4p4) gpart 3 (ad6p4) > gmirror (gm2 = ad4p4 + ad6p4) (mirrored with -F) > gpart 1 (gm2p1) > gjournal (gm2p1.journal) > gpart 2 (gm2p2) > gjournal (gm2p2.journal) > ... > > Despite the intent of gpt's being to make such nesting unnecessary, as > a means of defining the structure of gmirrors, which take up the > entire extent of whatever encloses them, the nesting was very helpful. Maybe nesting simply works if you comment the first if in g_part_gpt_probe() in sys/geom/part/g_part_gpt.c ? I don't get why this is restricted, should be my decision to nest or not imo. Kind regards Marius From owner-freebsd-geom@FreeBSD.ORG Sun Oct 19 21:14:07 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 AD9581065670 for ; Sun, 19 Oct 2008 21:14:07 +0000 (UTC) (envelope-from marius@nuenneri.ch) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.181]) by mx1.freebsd.org (Postfix) with ESMTP id 718D28FC18 for ; Sun, 19 Oct 2008 21:14:07 +0000 (UTC) (envelope-from marius@nuenneri.ch) Received: by wa-out-1112.google.com with SMTP id n4so836947wag.27 for ; Sun, 19 Oct 2008 14:14:06 -0700 (PDT) Received: by 10.114.147.7 with SMTP id u7mr4793110wad.145.1224450846767; Sun, 19 Oct 2008 14:14:06 -0700 (PDT) Received: by 10.115.89.3 with HTTP; Sun, 19 Oct 2008 14:14:06 -0700 (PDT) Message-ID: Date: Sun, 19 Oct 2008 23:14:06 +0200 From: "=?ISO-8859-1?Q?Marius_N=FCnnerich?=" To: "Marcel Moolenaar" In-Reply-To: <7353F23F-F944-47C9-A97D-6DE247F958AE@mac.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <9e77bdb50810011331y7216eac3yf85907f96f5e8370@mail.gmail.com> <7353F23F-F944-47C9-A97D-6DE247F958AE@mac.com> Cc: Cyrus Rahman , freebsd-geom@freebsd.org Subject: Re: Experiences with Gpart 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: Sun, 19 Oct 2008 21:14:07 -0000 On Sun, Oct 19, 2008 at 10:18 PM, Marcel Moolenaar wrote: > > On Oct 19, 2008, at 10:24 AM, Marius N=FCnnerich wrote: > >>> Despite the intent of gpt's being to make such nesting unnecessary, as >>> a means of defining the structure of gmirrors, which take up the >>> entire extent of whatever encloses them, the nesting was very helpful. >> >> Maybe nesting simply works if you comment the first if in >> g_part_gpt_probe() in >> sys/geom/part/g_part_gpt.c ? I don't get why this is restricted, should = be >> my >> decision to nest or not imo. > > Nesting is not allowed as per the GPT specification. OK. It doesn't make much sense for slices too, but is still allowed. From owner-freebsd-geom@FreeBSD.ORG Sun Oct 19 21:18:10 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 4AD94106566B for ; Sun, 19 Oct 2008 21:18:10 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout012.mac.com (asmtpout012.mac.com [17.148.16.87]) by mx1.freebsd.org (Postfix) with ESMTP id 355218FC0C for ; Sun, 19 Oct 2008 21:18:10 +0000 (UTC) (envelope-from xcllnt@mac.com) MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Received: from [192.168.1.95] (209-128-86-226.bayarea.net [209.128.86.226]) by asmtp012.mac.com (Sun Java(tm) System Messaging Server 6.3-7.03 (built Aug 7 2008; 32bit)) with ESMTPSA id <0K9000CFO5Q9L710@asmtp012.mac.com> for freebsd-geom@freebsd.org; Sun, 19 Oct 2008 13:18:10 -0700 (PDT) Message-id: <7353F23F-F944-47C9-A97D-6DE247F958AE@mac.com> From: Marcel Moolenaar To: =?ISO-8859-1?Q?Marius_N=FCnnerich?= In-reply-to: Content-transfer-encoding: quoted-printable Date: Sun, 19 Oct 2008 13:18:09 -0700 References: <9e77bdb50810011331y7216eac3yf85907f96f5e8370@mail.gmail.com> X-Mailer: Apple Mail (2.929.2) Cc: Cyrus Rahman , freebsd-geom@freebsd.org Subject: Re: Experiences with Gpart 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: Sun, 19 Oct 2008 21:18:10 -0000 On Oct 19, 2008, at 10:24 AM, Marius N=FCnnerich wrote: >> Despite the intent of gpt's being to make such nesting unnecessary, =20= >> as >> a means of defining the structure of gmirrors, which take up the >> entire extent of whatever encloses them, the nesting was very =20 >> helpful. > > Maybe nesting simply works if you comment the first if in =20 > g_part_gpt_probe() in > sys/geom/part/g_part_gpt.c ? I don't get why this is restricted, =20 > should be my > decision to nest or not imo. Nesting is not allowed as per the GPT specification. --=20 Marcel Moolenaar xcllnt@mac.com From owner-freebsd-geom@FreeBSD.ORG Sun Oct 19 21:40:54 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 D8950106567E for ; Sun, 19 Oct 2008 21:40:54 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout019.mac.com (asmtpout019.mac.com [17.148.16.94]) by mx1.freebsd.org (Postfix) with ESMTP id C1B838FC39 for ; Sun, 19 Oct 2008 21:40:54 +0000 (UTC) (envelope-from xcllnt@mac.com) MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Received: from [192.168.1.95] (209-128-86-226.bayarea.net [209.128.86.226]) by asmtp019.mac.com (Sun Java(tm) System Messaging Server 6.3-7.03 (built Aug 7 2008; 32bit)) with ESMTPSA id <0K9000LTE9K5R760@asmtp019.mac.com> for freebsd-geom@freebsd.org; Sun, 19 Oct 2008 14:40:54 -0700 (PDT) Message-id: From: Marcel Moolenaar To: =?ISO-8859-1?Q?Marius_N=FCnnerich?= In-reply-to: Content-transfer-encoding: quoted-printable Date: Sun, 19 Oct 2008 14:40:53 -0700 References: <9e77bdb50810011331y7216eac3yf85907f96f5e8370@mail.gmail.com> <7353F23F-F944-47C9-A97D-6DE247F958AE@mac.com> X-Mailer: Apple Mail (2.929.2) Cc: Cyrus Rahman , freebsd-geom@freebsd.org Subject: Re: Experiences with Gpart 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: Sun, 19 Oct 2008 21:40:54 -0000 On Oct 19, 2008, at 2:14 PM, Marius N=FCnnerich wrote: > On Sun, Oct 19, 2008 at 10:18 PM, Marcel Moolenaar =20= > wrote: >> >> On Oct 19, 2008, at 10:24 AM, Marius N=FCnnerich wrote: >> >>>> Despite the intent of gpt's being to make such nesting =20 >>>> unnecessary, as >>>> a means of defining the structure of gmirrors, which take up the >>>> entire extent of whatever encloses them, the nesting was very =20 >>>> helpful. >>> >>> Maybe nesting simply works if you comment the first if in >>> g_part_gpt_probe() in >>> sys/geom/part/g_part_gpt.c ? I don't get why this is restricted, =20 >>> should be >>> my >>> decision to nest or not imo. >> >> Nesting is not allowed as per the GPT specification. > > OK. It doesn't make much sense for slices too, but is still allowed. A nested MBR provides for backward compatibility by presenting a GPT partition as a drive to those legacy OSes or tools. I don't think it was needed, but it was envisioned that way, AFAICT. It makes sense in a weird way. --=20 Marcel Moolenaar xcllnt@mac.com From owner-freebsd-geom@FreeBSD.ORG Sun Oct 19 22:37:47 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 EF4EE1065670 for ; Sun, 19 Oct 2008 22:37:47 +0000 (UTC) (envelope-from marius@nuenneri.ch) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.177]) by mx1.freebsd.org (Postfix) with ESMTP id D206D8FC12 for ; Sun, 19 Oct 2008 22:37:47 +0000 (UTC) (envelope-from marius@nuenneri.ch) Received: by wa-out-1112.google.com with SMTP id n4so848381wag.27 for ; Sun, 19 Oct 2008 15:37:47 -0700 (PDT) Received: by 10.114.148.2 with SMTP id v2mr4818366wad.173.1224455867058; Sun, 19 Oct 2008 15:37:47 -0700 (PDT) Received: by 10.115.89.3 with HTTP; Sun, 19 Oct 2008 15:37:47 -0700 (PDT) Message-ID: Date: Mon, 20 Oct 2008 00:37:47 +0200 From: "=?ISO-8859-1?Q?Marius_N=FCnnerich?=" To: freebsd-geom@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: 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: Sun, 19 Oct 2008 22:37:48 -0000 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? I need that number as an index into the partition table. 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? 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? Thanks for your help Marius From owner-freebsd-geom@FreeBSD.ORG Mon Oct 20 11:06:51 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 C66A41065675 for ; Mon, 20 Oct 2008 11:06:51 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id B3DFE8FC16 for ; Mon, 20 Oct 2008 11:06:51 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id m9KB6phr082662 for ; Mon, 20 Oct 2008 11:06:51 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id m9KB6phc082658 for freebsd-geom@FreeBSD.org; Mon, 20 Oct 2008 11:06:51 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 20 Oct 2008 11:06:51 GMT Message-Id: <200810201106.m9KB6phc082658@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-geom@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-geom@FreeBSD.org 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 11:06:51 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/126902 geom [geom] [geom_label] Kernel panic during install boot o kern/124973 geom [gjournal] [patch] boot order affects geom_journal con o kern/124969 geom gvinum(8): gvinum raid5 plex does not detect missing s o kern/124294 geom [geom] gmirror(8) have inappropriate logic when workin o kern/124130 geom [gmirror][usb] gmirror fails to start usb devices that o kern/123962 geom [panic] gjournal(8): gjournal (455Gb data, 8Gb journal o kern/123630 geom [patch] [gmirror] gmirror doesnt allow the original dr o kern/123122 geom [geom] GEOM / gjournal kernel lock f kern/122415 geom [geom] UFS labels are being constantly created and rem o kern/122067 geom [geom] [panic] Geom crashed during boot o kern/121559 geom [patch] [geom] geom label class allows to create inacc o kern/121364 geom [gmirror] Removing all providers create a "zombie" mir o kern/120231 geom [geom] GEOM_CONCAT error adding second drive o kern/120044 geom [msdosfs] [geom] incorrect MSDOSFS label fries adminis o kern/120021 geom [geom] [panic] net-p2p/qbittorrent crashes system when o kern/119743 geom [geom] geom label for cds is keeped after dismount and f kern/115547 geom [geom] [patch] [request] let GEOM Eli get password fro o kern/114532 geom [geom] GEOM_MIRROR shows up in kldstat even if compile o kern/113957 geom [gmirror] gmirror is intermittently reporting a degrad o kern/113885 geom [gmirror] [patch] improved gmirror balance algorithm o kern/113837 geom [geom] unable to access 1024 sector size storage o kern/113419 geom [geom] geom fox multipathing not failing back p bin/110705 geom gmirror(8) control utility does not exit with correct o kern/107707 geom [geom] [patch] [request] add new class geom_xbox360 to o kern/104389 geom [geom] [patch] sys/geom/geom_dump.c doesn't encode XML o kern/98034 geom [geom] dereference of NULL pointer in acd_geom_detach o kern/94632 geom [geom] Kernel output resets input while GELI asks for o kern/90582 geom [geom] [panic] Restore cause panic string (ffs_blkfree o bin/90093 geom fdisk(8) incapable of altering in-core geometry a kern/89660 geom [vinum] [patch] [panic] due to g_malloc returning null o kern/89546 geom [geom] GEOM error s kern/89102 geom [geom] [panic] panic when forced unmount FS from unplu o kern/87544 geom [gbde] mmaping large files on a gbde filesystem deadlo o kern/84556 geom [geom] GBDE-encrypted swap causes panic at shutdown o kern/79251 geom [2TB] newfs fails on 2.6TB gbde device o kern/79035 geom [vinum] gvinum unable to create a striped set of mirro o bin/78131 geom gbde(8) "destroy" not working. s kern/73177 geom kldload geom_* causes panic due to memory exhaustion 38 problems total. 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 From owner-freebsd-geom@FreeBSD.ORG Mon Oct 20 19:09:39 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 7D4501065674 for ; Mon, 20 Oct 2008 19:09:39 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout014.mac.com (asmtpout014.mac.com [17.148.16.89]) by mx1.freebsd.org (Postfix) with ESMTP id 67B748FC14 for ; Mon, 20 Oct 2008 19:09:39 +0000 (UTC) (envelope-from xcllnt@mac.com) MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp014.mac.com (Sun Java(tm) System Messaging Server 6.3-7.03 (built Aug 7 2008; 32bit)) with ESMTPSA id <0K9100C3KX82D220@asmtp014.mac.com> for freebsd-geom@freebsd.org; Mon, 20 Oct 2008 12:09:39 -0700 (PDT) Message-id: From: Marcel Moolenaar To: =?ISO-8859-1?Q?Marius_N=FCnnerich?= In-reply-to: Content-transfer-encoding: quoted-printable Date: Mon, 20 Oct 2008 12:09:38 -0700 References: X-Mailer: Apple Mail (2.929.2) Cc: freebsd-geom@freebsd.org 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 19:09:39 -0000 On Oct 20, 2008, at 10:55 AM, Marius N=FCnnerich wrote: > A new question popped up: > Is it possible to test the a geom of class PART is of "subclass" GPT? Not easily from the kernel now, but it's always possible to make certain bits of information more readily available for use inside the kernel. It seems to make sense to have GEOMs export label information through g_getattr(). This allows the label to come from every GEOM that possibly can have labels, without the need to add explicit support... --=20 Marcel Moolenaar xcllnt@mac.com From owner-freebsd-geom@FreeBSD.ORG Mon Oct 20 19:45:08 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 B7A571065670 for ; Mon, 20 Oct 2008 19:45:08 +0000 (UTC) (envelope-from marius@nuenneri.ch) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.177]) by mx1.freebsd.org (Postfix) with ESMTP id 5561B8FC31 for ; Mon, 20 Oct 2008 19:45:08 +0000 (UTC) (envelope-from marius@nuenneri.ch) Received: by wa-out-1112.google.com with SMTP id n4so1102561wag.27 for ; Mon, 20 Oct 2008 12:45:07 -0700 (PDT) Received: by 10.114.201.1 with SMTP id y1mr5738614waf.93.1224531907059; Mon, 20 Oct 2008 12:45:07 -0700 (PDT) Received: by 10.115.89.3 with HTTP; Mon, 20 Oct 2008 12:45:07 -0700 (PDT) Message-ID: Date: Mon, 20 Oct 2008 21:45:07 +0200 From: "=?ISO-8859-1?Q?Marius_N=FCnnerich?=" To: "Marcel Moolenaar" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: Cc: freebsd-geom@freebsd.org 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 19:45:08 -0000 Hi Marcel, thanks for your reply. On Mon, Oct 20, 2008 at 9:09 PM, Marcel Moolenaar wrote: > > On Oct 20, 2008, at 10:55 AM, Marius N=FCnnerich wrote: > >> A new question popped up: >> Is it possible to test the a geom of class PART is of "subclass" GPT? > > > Not easily from the kernel now, but it's always possible to make > certain bits of information more readily available for use inside > the kernel. > > It seems to make sense to have GEOMs export label information > through g_getattr(). This allows the label to come from every > GEOM that possibly can have labels, without the need to add > explicit support... That would certainly be a clean thing to do. I'll take a look into g_getattr() now, thanks. From owner-freebsd-geom@FreeBSD.ORG Mon Oct 20 20:21:39 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 4E1B9106566B for ; Mon, 20 Oct 2008 20:21:39 +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 2AD128FC16 for ; Mon, 20 Oct 2008 20:21:39 +0000 (UTC) (envelope-from marius@nuenneri.ch) Received: by wa-out-1112.google.com with SMTP id n4so1109981wag.27 for ; Mon, 20 Oct 2008 13:21:38 -0700 (PDT) Received: by 10.114.39.5 with SMTP id m5mr5750491wam.113.1224534098466; Mon, 20 Oct 2008 13:21:38 -0700 (PDT) Received: by 10.115.89.3 with HTTP; Mon, 20 Oct 2008 13:21:38 -0700 (PDT) Message-ID: Date: Mon, 20 Oct 2008 22:21:38 +0200 From: "=?ISO-8859-1?Q?Marius_N=FCnnerich?=" To: "Marcel Moolenaar" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: Cc: freebsd-geom@freebsd.org 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 20:21:39 -0000 On Mon, Oct 20, 2008 at 9:45 PM, Marius N=FCnnerich wr= ote: > Hi Marcel, > > thanks for your reply. > > On Mon, Oct 20, 2008 at 9:09 PM, Marcel Moolenaar wrote: >> >> On Oct 20, 2008, at 10:55 AM, Marius N=FCnnerich wrote: >> >>> A new question popped up: >>> Is it possible to test the a geom of class PART is of "subclass" GPT? >> >> >> Not easily from the kernel now, but it's always possible to make >> certain bits of information more readily available for use inside >> the kernel. >> >> It seems to make sense to have GEOMs export label information >> through g_getattr(). This allows the label to come from every >> GEOM that possibly can have labels, without the need to add >> explicit support... > > That would certainly be a clean thing to do. > I'll take a look into g_getattr() now, thanks. Hmm, this would not really help for GPT, since I would also like to have the partition uuid, so another attr would be needed. BIO_GETATTR is handled in g_part.c so the specific implementations never see the request. For example MBR has no label or uuid so it doesn't make sense to ask it for one. Is there some documentation why gpart was started and what it's main advantages are over the old style? From owner-freebsd-geom@FreeBSD.ORG Mon Oct 20 20:40:47 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 05FE010656B3 for ; Mon, 20 Oct 2008 20:40:47 +0000 (UTC) (envelope-from marius@nuenneri.ch) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.170]) by mx1.freebsd.org (Postfix) with ESMTP id DB14C8FC1B for ; Mon, 20 Oct 2008 20:40:46 +0000 (UTC) (envelope-from marius@nuenneri.ch) Received: by wf-out-1314.google.com with SMTP id 24so1953712wfg.7 for ; Mon, 20 Oct 2008 13:40:45 -0700 (PDT) Received: by 10.114.241.15 with SMTP id o15mr5768621wah.96.1224535245837; Mon, 20 Oct 2008 13:40:45 -0700 (PDT) Received: by 10.115.89.3 with HTTP; Mon, 20 Oct 2008 13:40:45 -0700 (PDT) Message-ID: Date: Mon, 20 Oct 2008 22:40:45 +0200 From: "=?ISO-8859-1?Q?Marius_N=FCnnerich?=" To: "Max E. Kuznecov" In-Reply-To: <20080901125709.GA26304@syhpoon-portaone.portaone.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080901125709.GA26304@syhpoon-portaone.portaone.com> Cc: freebsd-geom@freebsd.org Subject: Re: raid & label issues 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 20:40:47 -0000 On Mon, Sep 1, 2008 at 2:57 PM, Max E. Kuznecov wrote: > Hi, > I have a RAID1 created with atacontrol. > After installation I create a label, say: tunefs -L root /dev/ar0s1a > and put /def/ufs/root as rootfs into fstab. > So I expect the system will boot from raid (ar0s1a) device, but it > won't. > > It occurs that tunefs create label not only on ar0 device itself but on > the raid components as well, in my case they are ad4 and ad6. > > And after reboot I've got my system booted from ad4, i.e. the first > device with 'root' label on it. I've skimmed through the geom_label > sources and, indeed, it creates /dev/ufs/