Subject: Re: Removing i386 Bootloader
To: None <netbsd-help@NetBSD.org>
From: Jeff_W <jgw@tx0.org>
List: netbsd-help
Date: 08/28/2006 10:26:29
David Laight <david@l8s.co.uk> wrote:

> On Sun, Aug 27, 2006 at 06:36:28PM -0700, Jeff_W wrote:
> > Removing i386 Bootloader. How does one do this?
>
> What are you trying to do, removing a bootloader would (typically) overwrite
> part of the disk with zeros, thus making it unbootable.
>
> > I tried installboot -c /dev/rwd0c but get the following:
> > 
> > # installboot -v -c /dev/rwd0c
> > installboot: Opening file system `/dev/rwd0c' read-only: Device not configured
>
> Well, wd0c is a reference to the NetBSD 'mbr' partition (that is split
> into the netbsd partitions by the netbsd label).  installboot operates
> on a filesystem partition.....

So, I need to not use (on i386) "c" "d" and whatever swap is ?  I was going
by the example in the installboot(8) man page which is listed under "common",
as in common to all machine plateforms.  Guess that isn't the case...

> > The Windows parrtition is actually /dev/rwd0e so I tried that:
> > 
> > # installboot -v -c /dev/rwd0e
> > File system:         /dev/rwd0e
> > File system type:    raw (blocksize 8192, needswap 0)
> > Primary bootstrap:   (to be cleared)
> > installboot: i386: bootstrap removal is not supported
> > installboot: Clear bootstrap operation failed
>
> You are lucky - if it had done anything that windows partition would be toast!
>  

LOL - I actually stuck the -n switch in there first so I could see what it _might_
do.

> > Is there some other method to remove the NetbSD boot selector/loader thing?
>
> Removing it would leave you with a completely unbootable disk.
> You could use different mbr boot code, but I don't suspect it would help you.
>
> > I recently had to reinstall windozeXP and I'm getting an "Error 3" when
> > selecting XP.
>
> Presumably this is the problem you are actually trying to solve!
> "Error 3" means that the first sector of (in this case) your XP partition
> doesn't contain any boot code.
> The XP installation needs to write this, although sometimes it only
> seems to write its boot code to sector zero of the disk.

So, if XP is writing it's boot code to the zero sector then having the NetBSD
boot code there might be the problem, no?  I really don't think it is a problem
as the system worked previously.  Unfortunately, a memory upgrade seems to have
been too much for XP to handle and it crapped out, hence the reinstall attempt.

>
> > I though maybe installing a different boot manager would fix things so I
> > installed GAG-4.6,
>
> I don't know anything about that, one advantage of the netbsd bootselect
> code is that it sits entirely within the space (in sector 0 of the disk)
> that is allocated for the bootstrap code.  Almost everything else has
> a lot of code squirrelled away somewhere else on the disk.

I don't know where GAG installs it's code but at least it's easy to unistall... 
I opted to try it because it provides the option of hiding the primary partitions
on the fly and I've got 3.

>
> > however selecting XP still dumping me into the NetBSD boot
> > selector so I think I just need to clear it out.
>
> Possibly you've managed to get the netbsd bootselect code written to the
> start of your XP partition.
>
> You need to replace it with the correct code, not delete it.

Any suggestions as to tools for this?  I'd rather not wipe the entire disk
if I don't have to. 

-Jeff