Not quite, you don't need a specific partition for grub.Grub only needs to be installed
on the BIOS first boot device.
Which can be a hard drive, a floppy, a cdrom, an usb key...

On a hard drive with only OpenBSD slices, grub will usually be installed on the
first slice, the one with the largest volume label. The BIOS boot one.

At boot, the mbr jumps to the /grub directory, loads some stages and reads the
menu.lst.
Grub has the ability to mark partition types (keyword parttype) and
mark a partition active (define root(x,y) and keyword makeactive)
just as any fdisk would do (you eventually can partition a disk from within grub).

There is some info, even without the need to install it first:
/usr/ports/sysutils/grub/files/README.OpenBSD and a menu example
/usr/ports/sysutils/grub/files/menu.lst

As you will see, the trick is to mark unused OpenBSD slices with another
identifier.

Would you want to by-pass the grub's choices menu, (no intervention)
you only would have to write different menu.lst.xxx files and mv the one
you need at next reboot.

Fwiw, my default menu is on the hard drive, simple entry.
When messing around I boot from an usb key.

Raimo Niskanen wrote:
On Tue, Apr 08, 2008 at 01:00:04AM -0700, Andrei wrote:
Josh Grosse wrote:
On Mon, 7 Apr 2008 11:04:41 -0700 (PDT), Andrei wrote

I have PC with two OpenBSD 4.2 - bootable harddisks. Clearly I can
boot from either of them by setting a boot sequence in BIOS or by
typing "boot hdXa:/bsd" in the boot prompt (X = 0 or 1).

What I want is to specify a boot hdd without boot-time user
intervention. Thus, imagine I run OpenBSD on hd0, I want to specify
what hd1 shell be used as bootable on the next reboot.
See boot.conf(5), set image may be what you are looking for.

I'd say "set device ..." is what you are looking for.
I have a bootable USB pen drive that only contains
        /boot
        /etc/boot.conf
that boots OpenBSD from the hard drive when I have not
wanted to touch the MBR code. It contains:
        set device hd1a
        set howto -c
the last line to push the boot into UKC> since I need
to disable acpi. And it is hd1a since boot(8) see
the USB pen drive as first hard disk.

Thanks Josh, this works fine. The reason I did not consider boot.conf at the
beginning is that it concerns second-stage bootstrap, while I was trying to
find a solution first-stage bootstrap.

OpenBSD's MBR does no fancy tricks. It only boots the first
partition on the hard drive marked as bootable.

You may be able to get the BIOS to boot the second hard drive,
but not from a running OS for the next boot.

GRUB installed to MBR can do it, but needs a partition
to exist in. So then it will be its second stage bootloader
that does the selection. And you will have to modify
menu.lst in the GRUB installation, so the GRUB installation
will have to be writable from OpenBSD.

As you found out OpenBSD's boot(8) can do it.
You will have to modify /etc/boot.conf on the hard drive the BIOS boots.

And there are of course other bootloaders out there...



 Andrei

--
View this message in context: 
http://www.nabble.com/Dual-boot-problem-tp16538144p16548546.html
Sent from the openbsd user - misc mailing list archive at Nabble.com.

Reply via email to