Comment 10 for bug 495423

Revision history for this message
Colin Watson (cjwatson) wrote : Re: [Bug 495423] Re: update to grub-pc writes MBR without checks, prompt or backup

On Fri, Feb 04, 2011 at 12:36:31PM -0000, Ronan Mooney wrote:
> There's no reliable way to tell whether GRUB is installed in an MBR or
> not-
> This seems unlikely. I am sure a "best Guess" could be made, at which
> point a confirmation question could be asked.

Unlikely or not, it's my assessment that it's true. Matching binary
code would be very fragile, would have to detect all old versions of
GRUB, would be liable to break any time GRUB is changed, and there's no
way I can think of to tell which of the many other MBR implementations
would share some of that code. Matching text strings suffers from the
problem that the GRUB-specific text strings in the MBR are relatively
close to the end of the MBR, and it's entirely possible that an MBR
implementation that didn't use the whole available space wouldn't
overwrite them. Thus I believe any such check would be unreliable in
both directions.