DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 28th May 2008
Sunsawe Sunsawe is offline
Port Guard
 
Join Date: May 2008
Posts: 39
Thanked 0 Times in 0 Posts
Question How to modify the boot loader?

Hi,

I have a multi FreeBSD boot on my box. I noticed that the boot loader can "remember" the last system that has been started.
I would like to know how i could, within the system, modify this.

How to select which system would be started by default at next reboot?

Thanks
Reply With Quote
  #2   (View Single Post)  
Old 28th May 2008
ephemera's Avatar
ephemera ephemera is offline
Knuth's homeboy
 
Join Date: Apr 2008
Posts: 537
Thanked 49 Times in 43 Posts
Default

Quote:
Originally Posted by Sunsawe View Post
Hi,

I have a multi FreeBSD boot on my box. I noticed that the boot loader can "remember" the last system that has been started.
I would like to know how i could, within the system, modify this.

How to select which system would be started by default at next reboot?

Thanks
use fdisk -a to make the partition from which you want to boot the active partition.
Reply With Quote
  #3   (View Single Post)  
Old 28th May 2008
Sunsawe Sunsawe is offline
Port Guard
 
Join Date: May 2008
Posts: 39
Thanked 0 Times in 0 Posts
Default

maybe i was not clear, i don't want to modify any slice thing.

I just want to modify the boot loader to choose which system would be started. I could as well have a linux or a windows system on and I would like to be able to choose them as well.
Reply With Quote
  #4   (View Single Post)  
Old 28th May 2008
tuck's Avatar
tuck tuck is offline
Shell Scout
 
Join Date: May 2008
Posts: 99
Thanked 14 Times in 6 Posts
Default

boot0cfg(8)
To boot slice 2 on the next boot:

boot0cfg -s 2 ad0

Since "-o update" is default the change should be written to MBR until you change it again.
But I didn't test it so I don't know if it's just for the next boot.
Reply With Quote
  #5   (View Single Post)  
Old 28th May 2008
robbak's Avatar
robbak robbak is offline
Real Name: Robert Backhaus
VPN Cryptographer
 
Join Date: May 2008
Location: North Queensland, Australia
Posts: 366
Thanked 40 Times in 39 Posts
Default

The FreeBSD Boot manager (the bootloader is a different beast that ocours just before the kernel is loaded) is very simple, and is this way by design. FreeBSD's boot Manager is contained within the MBR (Master Boot Record of "Boot Sector"- most others use a boot sector to simply locate and call another executable stored elsewhere.

While this makes FreeBSD's more robust - You can wipe and replace all partitions on a drive without killing it - it does mean that the space for the boot manager is very limited - 446 Bytes to be precise - So it cannot be very intelligent. I hope you will now understand why this step seems so primitive.

However, you can configure it, using the boot0cfg program. From my reading of man boot0cfg(8), it is limited. You can usethis command to set the default boot slice for the next boot:
Code:
boot0cfg -s3
. This should set the third slice (the third entry in the boot list) to be the default. The man page seems to suggest that this is only for the next boot, and default-to-last takes over from there: Other references suggest that this does set a default, but, significantly, there is no command mentioned to unset a default. Note that this is soley from reading the man page - I have not tried it, or read it anywhere.

If that fails, your options are to let well enough alone, or install some other, more complex boot loader, like grub or lilo, which are all-singing and dancing boot loaders. There are even fully graphical boot loaders for true WIMPs.

edit: thanks tuck! try
Code:
boot0cfg -s 4 -o noupdate
should set the default permanently, and
Code:
boot0cfg -o update
should set it back to default-to-last.
__________________
The only dumb question is a question not asked.
The only dumb answer is an answer not given.

Last edited by robbak; 28th May 2008 at 11:41 PM.
Reply With Quote
  #6   (View Single Post)  
Old 29th May 2008
ephemera's Avatar
ephemera ephemera is offline
Knuth's homeboy
 
Join Date: Apr 2008
Posts: 537
Thanked 49 Times in 43 Posts
Default

Quote:
Originally Posted by Sunsawe View Post
maybe i was not clear, i don't want to modify any slice thing.

I just want to modify the boot loader to choose which system would be started. I could as well have a linux or a windows system on and I would like to be able to choose them as well.
the boot0 loader "remembers" the partition you chose for boot last time by making it the active partition.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to boot from a CD with the FreeBSD BTX Loader? Turquoise88 FreeBSD General 6 25th August 2009 04:16 PM
How to disable FreeBSD boot loader? Turquoise88 FreeBSD General 2 17th July 2009 03:11 PM
How to modify the ls command? bsdnewbie999 OpenBSD General 9 16th May 2009 08:20 AM
FreeBSD boot loader menu is missing PeterSteele FreeBSD Installation and Upgrading 0 26th November 2008 06:08 PM
Deleted my /boot/loader enpey FreeBSD General 16 10th June 2008 10:02 PM


All times are GMT. The time now is 12:25 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick