Date: Wed, 15 Jun 2011 16:10:12 GMT From: Marcel Moolenaar <marcel@xcllnt.net> To: freebsd-geom@FreeBSD.org Subject: Re: kern/157819: [geom] gpart(8): drop serial from MBR Message-ID: <201106151610.p5FGAC8E009874@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/157819; it has been noted by GNATS. From: Marcel Moolenaar <marcel@xcllnt.net> To: "Andrey V. Elsukov" <ae@FreeBSD.org> Cc: bug-followup@FreeBSD.org, eirnym@gmail.com, Marcel Moolenaar <marcel@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@xcllnt.net
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106151610.p5FGAC8E009874>