kern/157819: [geom] gpart(8): drop serial from MBR

Marcel Moolenaar marcel at xcllnt.net
Wed Jun 15 16:10:13 UTC 2011


The following reply was made to PR kern/157819; it has been noted by GNATS.

From: Marcel Moolenaar <marcel at xcllnt.net>
To: "Andrey V. Elsukov" <ae at FreeBSD.org>
Cc: bug-followup at FreeBSD.org, eirnym at gmail.com,
        Marcel Moolenaar <marcel at FreeBSD.org>
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 at xcllnt.net
 
 


More information about the freebsd-geom mailing list