Active slice, only for a next boot

Dieter BSD dieterbsd at engineer.com
Tue May 31 23:45:17 UTC 2011


Peter writes:

>> A better approach is to be able to boot whatever slice you
>> want without having to change the active slice.
>>
>> NetBSD can do this. The MBR puts up a menu of the bootable
>> slices on the disk being booted. You can allow the timer
>> to time out and boot the default. Or you can enter the number
>> of the slice you want to boot. Or you can type a function key
>> F1 F2 ... to boot a different disk, and it will load the MBR
>> from that disk and run it. There is an alternative for keyboards
>> without function keys.

> So can FreeBSD - though only for MBR

If so, the documentation could use improvement.
Examples would be great.

> - this functionality doesn't seem
> to have made it into the GPT bootcode.

Is anyone working on this?  MBR is only good for 2 TB
and the 3 TB disks are becoming cost competitive.  I've
switched over to GPT for everything except boot disks,
as it is less brain damaged than MBR.

>> And it works great. Except that one of the 27 stages of boot
>> code that FreeBSD uses INSISTS on booting the active slice,
>> so you can tell the MBR to boot slice 3 and slice 3's boot
>> code sees that slice 4 is active and boots slice 4.
>
> Multibooting worked correctly when I last used it (a few years ago).
> Have you raised this as a PR?

No, partly because I haven't had much luck with PRs.  Mainly because
I'd rather spend my time trying to migrate to GPT than improving MBR.
So many bugs/misfeatures so little time,

>> RS-232 console + hardware modem + POTS = remote console
>
> And even that doesn't fully work unless you have a serial-aware BIOS.

Real computers have RS-232 consoles.

If you neglected to specify RS-232 console in the requirements,
there is this thing.  I haven't tried it.
http://www.realweasel.com/

Somebody probably sells a KVM-over-IP box.

You could see if openbios supports your mainboard.

John writes:

>> And it works great.  Except that one of the 27 stages of boot
>> code that FreeBSD uses INSISTS on booting the active slice,
>> so you can tell the MBR to boot slice 3 and slice 3's boot
>> code sees that slice 4 is active and boots slice 4.
>
> There are only 3 stages,

It feels like more.  :-)

> and boot1.S is what looks at the active slice.  
> Unfortunately it doesn't have a better way to do this as the only input it 
> gets from boot0 or any other MBR boot loader is the BIOS drive number in %dl.
> I'm not sure how else you would detect that a non-active slice was booted from 
> when that is your only input.

The NetBSD boot code manages to do it.


More information about the freebsd-hackers mailing list