Solved Adding chainload option to bootloader?

I had this setup in the past. In the bootloader, besides the regular options, I had the option to boot XP instead. Nice and clean dual booting without installing extra bootloaders or anything. It was the equivalent of escaping to the loader prompt and issuing chain disk0s1:. I remember all I had to do was adding a line to /boot/loader.conf, something like "chain=disk0s1", and the option would appear in the bootloader and simply work. Problem is, I can no longer find what the line was supposed to be. I've went through loader.conf's man page but simply couldn't find it. Anyone remember how to set it up?
 
Nowadays dual/multi-boot is usually achieved via UEFI loaders like e.g. rEFInd. EFI is much more robust than boot loaders like e.g. grub which completely fall apart on nearly every change e.g. in the disk setup.
 
My machine doesn't support UEFI. There's no point in installing other bootloaders anyway when our native bootloader can handle dual booting just fine.

I'm not sure if you understood my question. I'm asking about the loader.conf variable that adds the dual boot option to the regular bootloader. You know, the screen with beastie and stuff.

EDIT: To clarify, this wasn't years ago, I had this setup earlier this year in 12.2-RELEASE.
 
In the bootloader, besides the regular options, I had the option to boot XP instead. Nice and clean dual booting without installing extra bootloaders or anything.
That's boot0cfg(8). Still works, but only for MBR partitioned disks and can only boot FreeBSD with UFS.

I remember all I had to do was adding a line to /boot/loader.conf, something like "chain=disk0s1", and the option would appear in the bootloader and simply work.
Not sure where you got that from, but I don't remember it working this way (I've used FreeBSD since 3.0). "Chain" loading is typically done by tools like Grub.
 
That's boot0cfg(8). Still works, but only for MBR partitioned disks and can only boot FreeBSD with UFS.
I know about boot0cfg(8). But it really is not what I'm talking about.

Not sure where you got that from, but I don't remember it working this way (I've used FreeBSD since 3.0). "Chain" loading is typically done by tools like Grub.
I think it's not a very known option. I just shot a video to demonstrate that the stock bootloader is capable of chain loading XP, at least on my setup:


After adding the variable I mentioned to loader.conf, there would be a new option in the menu, it used to be number 7 but with the new "Cons:" option it should now be number 8. Using it would do the same thing as the command I showed in the video. The only problem is that I can no longer find what the variable was supposed to be.

Before anyone goes off-topic telling me not to use XP in the first place, I only use it for some old games.
 
Thanks a lot Jose, the second link you posted contains the variable I was looking for. I'm not sure if I'm using the lua loader or if it defaults to the old loader with BIOS booting, but it works. Here's what it looks like in my /boot/loader.conf:

Code:
chain_disk="disk0s1:"
 
I'm not sure if I'm using the lua loader or if it defaults to the old loader with BIOS booting
Default on 12 and higher is the LUA loader (it has nothing to do with the way it boots). If you want to be sure which one, look at the inodes in ls -ali /boot/loader*.
 
Note. There is one file /boot.config and you can use it to tell boot-stage2 where to load boot-stage3. But it is not chainloading in the strict sense. For that you need to use grub as far as i know
 
I wonder if this command would also work on GPT/UEFI setups. Would be useful for a lot of people.

Another question about the loader which I don't think deserves its own thread. In the menu, it says "press any other key to abort". While that used to be true, since 13.0 "any other key" drops to the loader prompt. There are only a few keys which actually simply abort the timer. Such as "9". I wonder if this is a bug.
 
Back
Top