Pages

July 11, 2010

How I Got PC-BSD Into The GRUB2 Menu of Ubuntu

Long story short -- I followed a guide for this; CLICK ME and I will take you there.

Long story long, this is how I did it personally.

I went into Terminal and typed:

riclags@nix:~$ sudo fdisk -l
[sudo] password for riclags:

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00095910

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        2432    19530752   83  Linux
/dev/sda2            2432       15076   101561345    5  Extended
/dev/sda3           15076       19458    35195737+  a5  FreeBSD
Partition 3 does not end on cylinder boundary.
/dev/sda5            2432       14590    97654784   83  Linux
/dev/sda6           14590       15076     3905536   82  Linux swap / Solaris

I took note that FreeBSD, the base of PC-BSD, is in /dev/sda3 device.

Ubuntu 10.04 LTS comes installed with GRUB2 so doing changes to the menu is a bit different.

Next up, change the GRUB2 menu by adding custom entries to /etc/grub.d/40_custom file.

riclags@nix:~$ sudo gedit /etc/grub.d/40_custom

When this file opens in GEdit, or other preferred text editor, add the entry to the menu. In this case, PC-BSD.

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

menuentry "PC-BSD 8.0 (on /dev/sda3)" {
        insmod ufs
        set root='(hd0,3)'
    search --no-floppy --fs-uuid
        chainloader +1
}

Note that you SHOULD NOT change or remove the exec tail -n +3 $0 from the file. Add the new entry after the comments.

The next step is important. It's not in the tutorial I linked above and may cause severe misery when you reboot and find no PC-BSD entry in the GRUB2 menu. So do:

riclags@nix:~$ sudo chmod +x /etc/grub.d/40_custom

Yup, need to make the file executable.

Then lastly, do:

riclags@nix:~$ sudo update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.32-21-generic
Found initrd image: /boot/initrd.img-2.6.32-21-generic
Found memtest86+ image: /boot/memtest86+.bin
done
riclags@nix:~$

And you're done!

Notes:

No comments:

Post a Comment