Loading FreeBSD from grub2
  Apr 19, 2010

Never edit /boot/grub/grub.cfg directly! You have to make changes in a special file under /etc/grub.d so that your changes will not get overwritten every time you update kernels, etc.

I am using my disk device name here. Make sure you use the one that fits your system.

  • hd0       hard drive number
  • 3           partition of FreeBSD partition (indexed from 1)
  • a           slice of /boot partition
  1. # vi /etc/grub.d/40_custom
  2. #!/bin/sh
  3. exec tail -n +3 $0
  4.  
  5. menuentry "FreeBSD 8.0-RELEASE" {
  6.     insmod ufs2
  7.     set root=(hd0,3,a)
  8.     chainloader +1
  9. }

Run update-grub2 to merge the changes in /etc/grub.d/40_custom. You should also be able to verify that the new entry will be seen next time grub2 is loaded.

  1. # update-grub2
  2. # cat /boot/grub/grub.cfg | grep FreeBSD

Reboot and give it a try!




Post a New Comment

Name

Message

Security
Code

        (case insensitive & space between words)