Daniel Ouellet wrote:
...
> He put the CD 4.5 in his laptop and booted from it. Then started the 
> install but at the question "do you want to use all the disk space for 
> OpenBSD" he did answer Yes. Right after that even he realize it was 
> wrong and didn't proceed to anything else, just did CTL-C and stop there.

ok, bonus points to him for smarts for stopping.
...
> What he had there before as a boot loader was "refit" that allow him to 
> select either OpenBSD or MAC.
...
> When you answer "YES" to the "Use all drive" at the install step, but do 
> not do anything else, is there a way to restore that?

Yes.  Kinda.

1) STOP.  I think you figured that out already. :)

I take it this is one of the new-fangled Intel-based Macs.  If not,
disregard most of what I say here...

Go find a PC and build yourself a flash boot disk tool (see faq14.html)

A few things you might want to do:
  * Image the entire disk to another, bigger disk.  you can do this by
booting from your above USB flash drive, and dd'ing your entire drive
(/dev/rwd0c) to a file on a USB hard disk. "bs=1M" on the dd command
so you don't have to wait three years.
  * Save the existing MBR to the flash disk. (that's the first sector
of /dev/rwd0c)
  * go buy a new disk. Practice on that before you try anything on
the production disk.  label clearly. :)


the "Use entire disk" question changes no more than 512 bytes on your
disk.  That's the good news.  The significance of that 512 bytes is the
problem.  (and while 512 bytes doesn't sound that bad, that's
2^(512*8) combinations...so we still gotta do somewhat better than
random guessing)

If this were a standard PC (and I have no idea how "standard" an Intel
Mac is), the only trick here is figuring out your partition table.
Think back to the initial install...if you can remember how you
partitioned it originally, merely re-creating the MBR as it was will
save you.

HOWEVER, since you were using a third-party boot tool, this may help
and hurt you, all at once.  IF you can find a machine with a very
similar layout (see "buy new hard disk" and make your own?), you can
probably just copy the first sector of the disk from that one, put
it on yours, alter the partition table to match the original (hint:
you probably said something like "40G OpenBSD" or "120G MacOS"), and
the system will probably Just Work.

You may want to think about where the most valued data is.  IF it is
on the MacOS environment, and that was the first part of the disk,
simply saying, "the entire disk is MacOS" may just bring the thing
back to life (on a standard PC, I'm sure it would..the physical
partition would be wrong, the file system, however, would be fine)

If it is the OpenBSD partition that is the most important
   http://www.openbsd.org/faq/faq14.html#OhBugger
may help.  However, you may want to do the scan_ffs on a copy
of your disk, or maybe even a disk image set up with svnd, as
you don't want to be dropping a disklabel any ol' place on the
hard disk.

I'm guessing refit sets up an MBR, I think that's the only way
OpenBSD could boot on a Intel Mac.  I suspect there is more to
refit than just those 512 bytes...but that's all you need to
restore.

refit may help you here in some way...I'd suggest asking on a
refit list, see if they know of any magic secret extra copies of
the MBR sector of the disk, or any other magic tricks it has.
Just tell them that all that happened is the very first sector
of the disk, the MBR, got clobbered.

Good luck...hopefully, someone with more IntelMac experience can
give you better guidance.

Nick.

Reply via email to