On Mon, Jun 27, 2011 at 08:57:27AM +0200, Christopher Zimmermann wrote: > On 06/24/11 16:51, Anand Buddhdev wrote: > > Hello list users, > > > > I have a virtual server for testing, on which I have installed OpenBSD 4.8. > > The installation is on wd0a, and there's just a single / partition. > > > > I then did a second installation, and setup OpenBSD 4.9 on wd0d, also with a > > single / partition. > > > > At this point, I can reboot the server, and at the boot prompt, I can > > manually boot into one or the other system as follows: > > > > boot> boot hd0a:/bsd (for OpenBSD 4.8) > > boot> boot hd0d:/bsd (for OpenBSD 4.9) > > > > Next, I wished to make the 4.9 installation the default. Therefore, I did > > the following: > > > > 1. Booted into 4.9 > > 2. Logged in as root > > 3. cd /usr/mdec; ./installboot /boot ./biosboot wd0 > > 4. echo 'boot hd0d:/bsd' > /etc/boot.conf
The boot loader in the MBR is barely intelligent enough to load the /boot program from the first FFS in the bootable OpenBSD partition. Which will be 'a' unless you have worked very hard to make a completely confused disk layout. So it is likely not loading the /boot you think it is, nor looking at the /etc/boot.conf file you think it is. Don't think too harshly of it. It has less than 512 bytes to live in. As Nick says: DON'T DO THIS! 'a' is the root. Period. Feel free to experiment otherwise but such configurations will not ever be supported and will work by accident if at all. .... Ken > > > > My expectation was that after a reboot, the OpenBSD booter would load up, > > look for wd0d:/etc/boot.conf, find the boot command in there, and boot > > automatically into 4.9. This is based on my reading of the boot.conf man > > page, section 5: > > > > 5. If the file */etc/boot.conf* exists on the filesystem *boot* was loaded > > from, open and parse it. This file may contain any commands > > *boot* > > accepts at the interactive prompt. Though default settings > > usually > > suffice, they can be changed here. > > > > However, this didn't happen. Instead, the server booted off hd0a:/bsd, and > > into 4.8. > > > > Is this a bug, or have I missed something? > > > The output of installboot -v (-n) could be helpful. > Then read and understand boot_i386(8). > On i386 BIOS loads MBR, (which maybe loads another MBR, ) which loads > the PBR (biosboot), which loads second stage bootloader (/boot), which > loads kernel (/bsd). > Your problem is possibly that the MBR still loads the PBR/biosboot from > your wd0a disklabel partition. Thats because your MBR only knows one > OpenBSD MBR partition, which starts with your wd0a disklabel partition. > > I see two possible solutions to achieve dualbooting: > > - use only one OpenBSD biosboot and boot bootloader and install both on > wd0a. You can configure this bootloader with /etc/boot.conf on wd0a. > - If you really, really want to load the bootloaders from wd0d, then > create another MBR partition using fdisk having same size and > location as your wd0d disklabel partition. Then you can dualboot by > activating either your real OpenBSD partition, starting at wd0a or > this fake partition starting at wd0d. > > > Christopher