During the installation of PC-BSD, you will be given the option to install the FreeBSD boot manager. If you plan to use or install a Linux distro on the same computer you are installing PC-BSD, be sure to install the FreeBSD boot manager. Even if you don't plan on using this boot manager, this is a necessary step as it will install the boot blocks needed by other boot managers. This section demonstrates both the FreeBSD boot manager as well as other freely available alternatives.

−

−

'''Note:''' if you plan to use the Windows boot manager, do not select the FreeBSD boot manager when installing PC-BSD. If you have already overwritten the Windows boot manager by mistake, see the section on [[#Recovering Windows Boot loader after installing PC-BSD | Recovering Windows Boot loader after installing PC-BSD]]'''.

−

−

The FreeBSD boot manager is a [http://en.wikipedia.org/wiki/Chain_loading chain loader] that typically occupies sector 0 of a disk, which is known as the [http://en.wikipedia.org/wiki/Master_boot_record Master Boot Record] (MBR).

−

−

The FreeBSD Boot Manager is also referred to as boot0 or "boot easy".

−

−

'''Example Boot Menu:'''

−

−

F1 FreeBSD

−

F5 Drive 1

−

−

Default: F1

−

−

Please note that recent versions of Windows have been found not to work with the FreeBSD boot manager as Windows requires the Windows Boot Manager to be installed in the MBR. If you wish to dual boot with Windows, For please refer to the [[#EasyBCD | EasyBCD]] section.

−

−

For information on understanding and using the FreeBSD boot manager, please refer to this section of the [http://www.freebsd.org/doc/handbook/boot.html FreeBSD Handbook].

−

−

For more information regarding the FreeBSD boot process, refer to the following man pages:

−

* [http://www.freebsd.org/cgi/man.cgi?query=boot0cfg boot0cfg]

−

* [http://www.freebsd.org/cgi/man.cgi?query=boot boot]

−

* [http://www.freebsd.org/cgi/man.cgi?query=bsdlabel bsdlabel]

−

* [http://www.freebsd.org/cgi/man.cgi?query=boot.config boot.config]

−

−

==== GAG, The Graphical Boot Manager ====

−

−

[http://gag.sourceforge.net/ GAG] is a versatile boot manager, capable of booting many different operating systems. After downloading and unzipping GAG, burn the cdrom.iso to a CD.

−

−

When you reboot the machine with the GAG CD inserted, select the option to Install GAG. You can then select S to set up GAG and choose to add the PC-BSD operating system to the GAG menu.

−

−

'''NOTE:''' If you are dual-booting with Linux, GAG requires that either grub or lilo be installed in the / or /boot partition of the Linux system.

−

−

==== Grub ====

−

−

Many Linux distros use grub as the boot loader. This section shows you how to add PC-BSD to an existing grub menu. You may also find the PCBSD FAQs on using [http://faqs.pcbsd.org/index.php?action=artikel&artlang=en&cat=16&id=10 Grub in Linux to boot PC-BSD] and [http://faqs.pcbsd.org/index.php?action=artikel&cat=1&id=9 How can I use Grub in PC-BSD to manage several operating systems?] to be helpful.

−

−

While booted into the Linux system, use the grub command line tool to list all devices that can be seen by grub's drivers. This will help you workout what drive options to use when setting the root option in the examples below.

−

−

$ '''sudo grub'''

−

grub> ls

−

grub> quit

−

−

There are two versions of grub that are in use. To see which version your Linux distro is using:

−

−

grub> '''grub --version'''

−

−

If the version number is less than 2, see [[#Adding PC-BSD to Grub Version 1 | Adding PC-BSD to Grub Version 1]]. If the version number is 2 or higher, see [[#Adding PC-BSD to Grub Version 2 | Adding PC-BSD to Grub Version 2]].

−

−

===== Adding PC-BSD to Grub Version 1 =====

−

−

Here is an example of adding PC-BSD to a Linux distro that is using grub version 1:

−

−

title PCBSD 8.1

−

root (hd0,1)

−

kernel /boot/loader

−

−

* '''Title:''' This will be the text that is shown in the boot menu and can be anything that makes sense to you.

−

* '''Root:''' The root of the partition containing PC-BSD. In the above example, PC-BSD is installed on the first hard disk (hd0) and on the first partition (,1). Start counting your hard disk from zero (e.g. disk 0 for the first hard disk, disk 1 for the second hard disk) and your partition from one (e.g. 1 for first partition on that disk, 2 for second partition, etc.)

−

* '''Kernel:''' Used to load the primary boot image. For FreeBSD and PC-BSD, always use /boot/loader.

−

−

For more information on using grub version 1, refer to the [http://www.gnu.org/software/grub/manual/legacy/grub.html Grub Legacy Manual].

−

−

===== Adding PC-BSD to Grub Version 2 =====

−

−

If your Linux distro is using grub version 2, the entry would now look like this:

−

−

title PCBSD 8.1

−

root (hd0,1,a)

−

kernel /boot/loader

−

boot

−

−

Here are some examples of more complex grub version 2 entries:

−

−

'''To set some sysctl values when loading the kernel:'''

−

−

menuentry "PCBSD (FreeBSD) 8.1" {

−

insmod ufs2

−

set root=(hd0,3)

−

kfreebsd /boot/kernel/kernel

−

set KFreeBSD.vfs.root.mountfrom=ufs:dev/label/rootfs0

−

set KFreeBSD.vfs.root.mountfrom.options=rw

−

}

−

−

'''To use the specified drive UUID:'''

−

−

First, at a command prompt in the PC-BSD system, determine the UUID with this command:

−

−

# '''/usr/local/sbin/grub-probe -d /dev/ad4s1 -t fs_uuid'''

−

−

Then, use that UUID in the grub menu entry:

−

−

menuentry "FreeBSD ad4, direct" {

−

insmod ufs2

−

set root=(hd0,1,a)

−

search --no-floppy --fs-uuid --set 4b22f9090565ab77

−

kfreebsd /boot/kernel/kernel

−

kfreebsd_loadenv /boot/device.hints

−

set KFreeBSD.vfs.root.mountfrom=ufs:/dev/ad4s1a

−

set KFreeBSD.vfs.root.mountfrom.options=rw

−

}

−

−

'''To use ZFS on GPT Partition:'''

−

−

zfs set mountpoint=legacy on all datasets on ${ZPOOL} and manage mountpoints in ${ZFSDATASET-INSTALLATION}/etc/fstab

* 3: In the second primary partition install PC-BSD. Don't check the boot loader option. This will prevent the install from interfering with the Windows boot loader.

−

−

* 4: When the install is finished, reboot into Windows.

−

−

* 5: In Windows, download the latest version of EasyBCD.

−

−

* 6: Run EasyBCD. Add an entry for your BSD partition. Go to the Linux/BSD Tab (older version might only read Linux for the tab) and from the dropdown menu options select FreeBSD and the relevant partition / drive.

−

−

==== Recovering Windows Boot loader after installing PC-BSD ====

−

−

Windows users often end up overwriting their Windows boot loader, thus losing access to Windows and only being able to boot into PC-BSD. This happens when the boot loader option is checked during the installation of PC-BSD. It is recommended that you first recover your Windows boot loader and then use the EasyBCD instructions above to setup a boot option for PCBSD.

−

−

If you are using XP, use the [http://www.ehow.com/how_4891476_reinstall-xp-bootloader.html Windows XP instructions]. If you are using Vista, use [http://www.ehow.com/how_5127739_restore-vista-boot-manager.html How to Restore Vista Boot Manager].