dual boot won`t work now

Chris Hafey yellowdog-newbie@lists.terrasoftsolutions.com
Thu, 23 Jan 2003 18:05:10 -0500 (EST)


Hi Ray.


Browse down -- I've set off in carets and vees (you'll see) what I think
you need do next.  The rest of this long message is context!


>Installed YDL from cd on my iBook & all went well until I had to reload OS9
>over the existing install.

OS9 probably reset the nvram to point to itself as your Startup Disk.

> Can now only boot into YDL using the "network disk" on the startup disk
> control panel which takes an awfully long time.

The partition that has yaboot is hidden from Mac OS, but OpenFirmware
can see it.

yaboot is the boot-loader, probably, on any G3 or G4 machine.  OldWorld
machines use BootX or similar (which is controlled from within MacOS);
I think it operates as system extension.

> I've only just installed YDL & never got a chance to shutdown & restart
> before reinstalling OS9 again, so don't know if it is normal NOT to boot
> from the normal startup disk.

Linux usually is booted from the same hard disk, even if dual-booted.
That's preferable to having to insert a CDROM, by a long-shot.  If it's
preferable, and possible, Linux generally tries to make it happen that
way.  In this case it is almost surely preferable and possible, so look
for it!

> I suspect the reinstall may have changed something & would like to know if:
> 1) YDL should boot from the startup disk or the network disk?

>From the hard disk; probably a low partition number.  Usually /dev/hda2;
the partition's type is 'Apple_Bootstrap' and its name, 'bootstrap' (as
seen from within 'fdisk' -- be very careful with fdisk; generally, just
use 'p' to print and 'q' to quit, unless you really want to partition
that disk!  'fdisk /dev/hda' generally invokes it cleanly - then tap
'p' once and then 'q' once.  Read the table *after* you type 'q'.)

> 2) If the former, do I have to reinstall YDL to get dual boot back?


vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
Probably you just want to type 'mkofboot' as root, once Linux is booted.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


Follow any prompts; read every screen carefully, and maybe pratice a few
times before committing changes to disk.  It probably has safeguards to
warn you (if you pay attention) of any gotchas, and probably will let
you back out if you're in over your head (in a panic, control C interrupts
most programs but they do not exit as cleanly as they may've if you
exited normally).

I repeat myself a bit, below .. typed it before the comments interlaced
with yours, above.

On new machines, pressing and holding a key -- O maybe (oh, not zero)
will pop up a menu of destinations -- press and hold it at the chime
when the machine boots, and keep it held down until something interesting
starts to happen (if anything).

If you know the partition number and can access Open Firmware, this
often works:

 boot hd:<n>,\yaboot <cr/lf>

example: my hard disk partition that holds the boot files is /dev/hda5 in
         Linux.  So to boot the yaboot program, I type:

 boot hd:5,\yaboot

 The boot files are on an HFS (not HFS+) partition, visible in Mac OS X.
 They are all in the root directory of that partition.  'yaboot.conf'
 is there, and it points to a linux kernel (vmlinux) that is also in
 that same root directory.

To get an open firmware prompt, Command+Option+O+F (press and hold all
four, simultaneously, during the chime and hold them down until the
OpenFirmware screen pops up).  Proceed very carefully if you've never
seen this screen before; in particular, don't make any typographical
errors (it's rare but if you try, you can (almost?) permanently hose
a Mac from within OpenFirmware).

Generally OpenFirware (it's a Forth implementation) will give you two
prompts; one to shut the mac down ('shut-down' is usual here) and the
other is to keep booting the default OS (which you don't want; does
the same thing as if you hadn't touched the keyboard during power-on
and subsequent booting).  So if you make any typos, you want to use
'shut-down' immediately .. don't take chances, I say.

Assuming you're not making typos, this is where I type:

boot hd:5,\yaboot    <and press ENTER>.
 
There's only one space there; between the 't' in 'boot' and the 'h' in 'hd'.
'5' is the number of the partition (it is the same as the /dev/hda number;
in this case, '5' (above) names /dev/hda5 in Linux.  Only this isn't a
Linux-type (ext2 etc.) filesystem on this partition; it's an HFS (not HFS+)
Mac OS partition.

Basically, there's a good chance you already have yaboot installed and
ready to be called to service, on a partition (one visible in Mac OS or
maybe not).  OpenFirmware is one way to access the yaboot binary (which
is a boot-loader).  Another is to set some parameters into the battery-
backed-up RAM in the machine (the nvram) that do much what I told you
to type by hand in OpenFirmware -- I'm pretty sure that's a viable
option.  Linux definitely has some sort of utility to write directly
to the nvram; one of the things it does is causes you to default to
a Linux boot instead of a Mac OS boot.  Another thing it can do is put
you into a menu of choices (this time controlled by yaboot, I think)
so that when you boot, you get to choose which OS to start (and if you
were away from the keyboard, it picks a default OS and boots that after
some time has passed with no response at the keyboard).

Come to think of it there's a bunch of handy programs in Linux to manage
all this -- you just need to boot off your CDROM or whatever it was you
were doing to boot, and activate them.  Well 'just' is perhaps a bit
oversimplified here -- I'm theorizing since I don't do things this way
myself.  I took great pains to make sure the system does not present
anyone but me with the option to boot Linux .. if you switch my machine
on (from power-off) Mac OS X comes up as usual.

The default on most Linuxes though is to give you some sort of a boot
menu, and as I say, on newer Macs, you don't have to do much since
pressing and holding down one key (I think it's the 'O') gives a decent
boot menu.

In Linux you can learn which partition your yaboot lives on.  Read the
manual pages for yaboot and mkofboot.  Typing 'mkofboot' as root sometimes
works.  On my system, it does.  If for some reason any of this makes your
system too difficult to boot into Mac OS, you can zap the nvram with
Command+Option+P+R (I think that's the right sequence) during the boot
chime.  You can press and hold it through three chimes (reboots) before
letting go the keyboard (once may be plenty, though).  That zaps then
nvram (restores it to reasonable default values) and generally the system
will boot Mac OS from there.  It does zap the Startup Disk choice you
usually make in Mac OS, so you may get a question-mark folder icon or
somesuch first time you boot, and during each boot until you choose a
Startup Disk (you zapped nvram, which stores this variable.)

Christopher W Hafey
Torrington CT USA