Fixing a MBR (and more) that ??? trashed

Gayn Winters gayn.winters at bristolsystems.com
Tue Sep 13 12:01:57 PDT 2005


> -----Original Message-----
> From: Alex Zbyslaw [mailto:xfb52 at dial.pipex.com] 
> Sent: Tuesday, September 13, 2005 2:06 AM
> To: gayn.winters at bristolsystems.com
> Cc: freebsd-questions at freebsd.org
> Subject: Re: Fixing a MBR (and more) that ??? trashed
> 
> 
> Gayn Winters wrote:
> 
> >Life was good with my dual boot w2k/fbsd system until 
> >I wanted to add another disk.  The w2k operating
> >system, when booted, saw the new hardware, "installed" it, 
> >and demanded that I reboot.  OK, but when I did, the 
> >FreeBSD boot manager was trashed. Its menu looked like:
> >
> >F1 ???
> >F2 FreeBSD
> >F5
> >Default: F#
> >
> >I could not boot either operating system. In fact the only keys that
did
> >anything were ctrl-alt-del!  I removed the new hardware and using
Fixit
> >on the 5.4 release CD, I tried 
> >	boot0cfg -B ad1  
> >This recovered the boot manager, and allowed me to boot w2k, but FBSD
> >wouldn't boot.  Pressing F2 in the boot menu still did nothing.
> >  
> >
> How far into the disk was FreeBSD?  I had a similar problem until I 
> specified "-o packet"
> i.e.
>     boot0cfg -B -o packet ad1
> 

Ah ha!  FreeBSD started at cylinder 41610.  Looks like I definitely 
needed the packet option.


> You could also try writing the boot manager using sysinstall/boot CD:
> 
http://www.freebsd.org/cgi/getmsg.cgi?fetch=611111+617364+/usr/local/www
/db/text/2005/freebsd-questions/20050626.freebsd-questions

--Alex

You know, I think I tried that, unsuccessfully.  Here are Gary's
thoughts:

> -----Original Message-----
> From: Gary W. Swearingen [mailto:garys at opusnet.com] 
> Sent: Tuesday, September 13, 2005 8:03 AM
> To: gayn.winters at bristolsystems.com
> Cc: freebsd-questions at freebsd.org
> Subject: Re: Fixing a MBR (and more) that ??? trashed
> 
> 
> "Gayn Winters" <gayn.winters at bristolsystems.com> writes:
> 
> > 2.  Was the disk label on the FreeBSD slice ad1s2 really corrupted?
> 
> Unlikely, at least until you ran sysinstall.  I've never figured out
> how it handles existing disklabels.  Badly, in my limited experience.
> Use "bsdlabel" from a rescue CD and see what you have there.  If
> you're concerned about the mount points, mount the "/" device and look
> in /etc/fstab.
> 
> > 3.  I couldn't get sysinstall to fix this mess - even though I
thought
> > it was fixing the FreeBSD partition mount points and applying a new
BSD
> > Boot Manager.  I couldn't get these "fixes" to "commit".  Can
sysinstall
> > fix this mess without reinstalling?
> 
> I'd use a rescue system -- either CD or another hard disk.
> 
> > 4.  How do I avoid this situation when I add another disk? 
> (Other than trash the w2k partition.)
> 
> I don't know about dual-booting MSFT, but you could "dd" the first
> tracks of the HDD and it's primary partitions to files on a formatted
> floppy or two for safe-keeping, before doing anything that could mess
> up the boot records.  You might want to save the first track of your
> FreeBSD primary partition too.  You can then put them (or selected
> sectors) back with "dd" from most unixy rescue OSes.

Regarding repair:

Alex (above) seemed to think sysinstall would do it, 
but I tried a couple times (reloading FreeBSD each time) 
and gave up.  Given Gary's comments, I suspect that I
corrupted the disk label on the FreeBSD partition mis-using sysinstall
somehow.

I like Gary's idea of a spare copy of the MBR saved on a floppy.
Seems like good insurance.

Regarding avoidance:
I would still like to add additional hard drives to my dual boot
systems.
Is there any safe way to do this?  

Thanks!!!

-gayn




More information about the freebsd-questions mailing list