From owner-freebsd-geom@FreeBSD.ORG Wed Jun 15 16:10:13 2011 Return-Path: Delivered-To: freebsd-geom@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 190981065691 for ; Wed, 15 Jun 2011 16:10:13 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 09D218FC24 for ; Wed, 15 Jun 2011 16:10:13 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p5FGACbC009875 for ; Wed, 15 Jun 2011 16:10:12 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p5FGAC8E009874; Wed, 15 Jun 2011 16:10:12 GMT (envelope-from gnats) Date: Wed, 15 Jun 2011 16:10:12 GMT Message-Id: <201106151610.p5FGAC8E009874@freefall.freebsd.org> To: freebsd-geom@FreeBSD.org From: Marcel Moolenaar Cc: Subject: Re: kern/157819: [geom] gpart(8): drop serial from MBR X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Marcel Moolenaar List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2011 16:10:13 -0000 The following reply was made to PR kern/157819; it has been noted by GNATS. From: Marcel Moolenaar To: "Andrey V. Elsukov" Cc: bug-followup@FreeBSD.org, eirnym@gmail.com, Marcel Moolenaar Subject: Re: kern/157819: [geom] gpart(8): drop serial from MBR Date: Wed, 15 Jun 2011 08:43:02 -0700 On Jun 15, 2011, at 2:21 AM, Andrey V. Elsukov wrote: > Hi, > > Yes, you are right. `gpart bootcode` does not keep disk signature. > It just overwrites the whole sector and fills partition table area. > > I see three ways how this can be fixed: > 1. Do not change anything :) > 2. Always keep disk signature for each boot code. > 3. Introduce new option for `gpart bootcode` command, i.e: > # gpart bootcode -b /boot/boot0 -o some,boot,options ada0 I would advise against adding options. That never scales and in this case is even the wrong thing to do. The fundamental question we need to answer is this: Is the serial number a well-defined field in the MBR that is independent and unrelated to the bootcode, or not? If those are entirely independent, then writing the bootcode should not have the side effect of clobbering the serial number and the MBR scheme should "merge" contents. If they are related then what we do is right and no change is to be made. Since the MBR is one of those legacy structures that have grown warts over time, I can see that different definitions would tell us different things. Let's take the definition that is most applicable in today's world. My off the cuff response would be this: If we instructions in our bootcode that occupies the space of the serial number, then we cannot change anything, other- wise we should probably preserve the serial number. HTH, -- Marcel Moolenaar marcel@xcllnt.net