wblock@
Developer
A quick overview of how to create a multiboot disk with sysutils/grub2 for FreeBSD and some other operating system.
On boot, GRUB2 displays a multiboot menu.
- Create the partitioning:
gpart create -s gpt ada0
- Add a freebsd-boot partition for FreeBSD bootcode:
gpart add -t freebsd-boot -a4k -s512k ada0
- Add a special partition for GRUB2:
gpart add -t \!21686148-6449-6E6F-744E-656564454649 -a4k -s1m ada0
- Add a FreeBSD UFS partition for the filesystem and a swap partition. The sizes are arbitrary. A real installation must leave enough room for additional partitions. Other operating systems could conceivably use the freebsd-swap partition for swap, but might resist due to the partition type.
gpart add -t freebsd-ufs -a4k -s80g ada0
gpart add -t freebsd-swap -a4k ada0
- Format the filesystem partition and install FreeBSD:
newfs -U /dev/ada0p3
(required to keep bsdinstall(8) from failing)
(install FreeBSD) - Install sysutils/grub2.:
- Edit /boot/grub/grub.cfg
Code:menuentry "FreeBSD" { set root="(hd0,gpt3)" # GPT partition 3 kfreebsd /boot/loader }
- Update the GRUB2 bootcode:
grub-install /dev/ada0
On boot, GRUB2 displays a multiboot menu.