Multiboot FreeBSD

I have a FAT32 partition with my GRUB, stages, menu.lst, etc. and I have two installs of FreeBSD on their own primary partitions afterwards. Ideally, I would just chainload each partition, and the first boot sector on the partition would handle booting the operating system on that partition. But FreeBSD (and Solaris) are a bit different.

FreeBSD makes it simple enough. All you need to do is root to the first subpartition of the FreeBSD partition and call boot kernel /boot/loader.

However, GRUB needs to be able to read UFS2 in order to load /boot/loader from that UFS2 filesystem, otherwise partition type 0xa5 will be “unknown”. I updated GRUB on the FAT32 partition to support UFS2 stage1.5, among some other strange filesystem types.

I then reinstalled the FAT32 copy of GRUB to the MBR with the usual install (hd0,0)/boot/grub/stage1 (hd0) (hd0,0)/boot/grub/stage2 p (hd0,0)/boot/grub/menu.lst, and voila, the MBR/booted GRUB could read UFS2.

Here’s a sample of my finished menu.lst:
[root@saratoga16a ~]# cat /mnt/fat32/boot/grub/menu.lst
default 0
timeout 8
title FreeBSD 7.4 i386
    root (hd0,1a)
    kernel /boot/loader
title FreeBSD 7.4 amd64
    root (hd0,2a)
    kernel /boot/loader
title Windows
    root (hd0,0)
    makeactive
    chainloader +1
[root@saratoga16a ~]#

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: