a69e How to install grub2 on FreeBSD - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Miscellaneous > Howtos & FAQs (Moderated)

Howtos & FAQs (Moderated) Would you like to share some of your solutions for certain problems? Tips or tricks? Post here. All new topics are automatically moderated.

Reply
 
Thread Tools Display Modes
  #1  
Old December 20th, 2011, 19:43
Yampress's Avatar
Yampress Yampress is offline
Junior Member
 
Join Date: Aug 2010
Location: PL
Posts: 36
Thanks: 0
Thanked 3 Times in 2 Posts
Default How to install grub2 on FreeBSD

How to install grub2, which may be useful to run multiple systems described below. Of course, previously tested by me like everyone my faq.


THE WORKS
All I do the following as root.
Install grub 2 first. I do it with packages

Code:
pkg_add-r grub2
Prepares the directory structure
Code:
cd /boot
mkdir grub
cd grub
touch grub.cfg
For grub.cfg adds the following entry
Code:
set timeout = 3
set default = "0"
menuentry "FreeBSD 8 Server" {
insmod ufs2
     set root = (hd0, 1)
chainloader 1
}
Code:
set root = (hd0, 1)
This is for disk 1, and freebsd FreeBSD installed on the first slice.

Code:
set root = (hd0, 3)
This is for disk 1, and freebsd installed on the third slice.
And just for themselves similarly change the parameters ...

Now copies the files to the right place to /boot/grub

Code:
cp-Rf /usr/local/lib/grub/i386-pc /boot/grub
Before you install grub in the MBR disk must be allowed to overwrite the MBR freebsd FreeBSD
If we do not, freebsd FreeBSD will not be able to install grub in the MBR.
Code:
sysctl kern.geom.debugflags = 16
And that's it. It remains to install grub
Code:
grub-install /dev/ad0
If a message pops up like this, everything is ok
Code:
freebsdserver # grub-install /dev/ad0
Installation finished. No error reported.
freebsdserver #
After installation, it looks like this



Now you can add other systems. windows, linux and bsd other configuration file.

Last edited by Yampress; February 17th, 2012 at 10:59. Reason: It's "FreeBSD": http://en.wikipedia.org/wiki/FreeBSD - get it right
Reply With Quote
The Following 2 Users Say Thank You to Yampress For This Useful Post:
markfisher (January 26th, 2012), wblock@ (December 20th, 2011)
  #2  
Old December 20th, 2011, 21:26
wblock@'s Avatar
wblock@ wblock@ is offline
Moderator
 
Join Date: Sep 2009
Location: Milky Way galaxy
Posts: 7,850
Thanks: 444
Thanked 1,828 Times in 1,494 Posts
Default

Quote:
Originally Posted by Yampress View Post
Before you install grub in the MBR disk must be allowed to overwrite the MBR freebsd FreeBSD
If we do not, freebsd FreeBSD will not be able to install grub in the MBR.
Code:
sysctl kern.geom.debugflags = 16
That setting actually allows writes to areas of the disk that are in use by geom. Typically that's for the very special case of writing to an important block of a mounted partition. The MBR should not need that, and in fact it should be very rare to need that sysctl at all.

(Some of the misunderstanding is my fault, since I didn't understand it and promoted the misuse in a couple of articles. Sorry about that.)
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 do you install grub2? bigtoque General 13 March 14th, 2011 14:10
[Solved] GRUB2 install fail on FreeBSD 8.1 amd64 epopen Installation and Maintenance of FreeBSD Ports or Packages 4 February 16th, 2011 01:08
FreeBSD accessed via grub2 b7j0c General 31 December 10th, 2010 12:53
entry for FreeBSD for grub2 jalu Installing & Upgrading 6 August 23rd, 2010 13:22
FreeBSD 7.2 LiveCD, FreeBSD 7.2 embedded & GRUB2 for FreeBSD [logical partitions also Panarchy General 24 August 9th, 2009 19:06


All times are GMT +1. The time now is 05:55.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0