Dual Booting/9.2

From PC-BSD Wiki
Revision as of 05:08, 6 February 2012 by Vater (Talk | contribs)

Jump to: navigation, search

(Sorry for the inconvenience)

A PC-BSD installation assumes that you have an existing primary partition to install into. If your computer has only one disk and PC-BSD will be the only operating system, it is fine to accept the default partitioning scheme. However, if you will be sharing PC-BSD with other operating systems, care has to be taken that PC-BSD is installed into the correct partition; otherwise, you may inadvertently overwrite an existing operating system.

If you wish to install multiple operating systems on your computer, you will need the following:

  • a partition for each operating system. Many operating systems, including PC-BSD, can only be installed into a primary partition. This means that you will need to use partitioning software as described in Partitioning the Hard Drive.
  • a boot loader that allows you to select which operating system you wish to boot. Depending upon the choice of boot loader and the operating systems that you install, you may or may not have to configure the boot loader to list all of the installed operating systems. Also, depending upon the order that you install the operating systems, the existing MBR data may be overwritten. This section will describe the configuration of several different boot loaders and how to restore an overwritten MBR.
  • a backup of any existing data. This backup should not be stored on your computer's hard drive but on another computer or on a removable media such as a USB drive or burnt onto a DVD media. If you are careful in your installation, everything should go fine. However, you'll be glad that you made a backup should something go wrong.


Choosing the Installation Partition

When installing PC-BSD onto a computer that is to contain multiple operating systems, care must be taken to select the correct partition in the Disk Setup screen of the installation. On a system containing multiple partitions, each partition will be listed. Highlight the partition that you wish to install into and make sure that you do not select a partition that already contains an operating system or data that you wish to keep.

DANGER: Make sure that the "Use Entire Disk" box is not checked. If you check this box, the installer will overwrite all of the partitions that exist on the selected disk! Also, do not use the "Use default layout" button in the Advanced Mode tab as it will instead layout the entire disk. If you wish to customize the layout of a specific partition , highlight that partition in Basic Mode and use the "Add" button in Advanced Mode to customize its layout.

If you install PC-BSD on a computer that already contains an operating system, the first time you reboot, your computer will automatically boot into the previous operating system. You will need to configure a boot loader utility to recognize all of the operating systems that are installed and to provide you with a boot menu where you can select which operating system to boot into. The rest of this section will demonstrate how to configure the GAG, GRUB, and EasyBCD boot loaders. Select the boot loader that best suits your needs or which is already installed on the computer.

GAG, The Graphical Boot Manager

GAG is a versatile boot manager, capable of booting many different operating systems. Once you have finished installing all of your operating systems, you can configure GAG to present you with a boot menu containing an entry for each operating system.

After downloading and unzipping GAG, burn the cdrom.iso file to a CD. Insert the CD and reboot the system to configure GAG. You will be presented with the initial GAG screen, shown in Figure 4.5.2a:

Figure 4.5.2a: Initial GAG Screen


NOTE: Your mouse won't work in GAG. Instead, use the key representing the number or letter of the option that you wish to select.

Press 4 in order to "Install GAG". The next screen will prompt you to choose your keyboard type by pressing the associated number key. The next screen will prompt you to choose your language by pressing the associated number or letter key. Once your selections have been made, you will see a screen similar to Figure 4.5.2b:

Figure 4.5.2b: Press the S Key to Configure GAG


Press S to "Setup GAG" and see the screen shown in Figure 4.5.2c:

Figure 4.5.2c: GAG's Main Configuration Menu


Press A to "Add a new Operating System". GAG will display an entry for each operating system installed on the computer.

NOTE: If you are dual-booting with Linux, GAG will not find the Linux installation unless GRUB or lilo is installed in the / or /boot partition of the Linux system.

Press the letter associated with the operating system name. Your PC-BSD entry will probably be displayed as "A5h FreeBSD". When you press the associated letter, a pop-up menu will prompt you to type a description which will be shown in the boot menu. Type in something that is useful to you, such as "PC-BSD 9.0". When you press enter, you will be prompted to type in a password or to press return for no password. If you decide to type in a password, you will need to input this password whenever you wish to boot into that operating system.

Once you press enter, you will see the screen shown in Figure 4.5.2d.

Figure 4.5.2d: Selecting an Icon for the Boot Menu Entry


Press the letter representing the icon that you wish to associate with the operating system--it will be displayed next to the description in the boot menu. For example, you could press F to associate the FreeBSD Beastie icon next to the "PC-BSD 9.0" description. Once you press enter, you will be returned to the main menu. Press A again to add another operating system and repeat this process for each operating system that you wish to boot.

When you are finished, press H to "Save in Hard disk". You should receive a pop-up message indicating that "GAG installed successfully". You can now press R to "Return to main menu". You'll note that the screen shown in Figure 4.7.2b now contains the entries for the operating systems that you added. Remove the CD and press the key associated with the operating system you wish to boot.

Now, whenever you reboot your system, this same menu will appear. It will always contain the S option so that you can add or delete operating system entries, set the boot passwords, or set the boot timer.


Many Linux distros use GRUB as the boot loader. This section shows you how to add PC-BSD to an existing GRUB menu.

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 determine which drive options to use when setting the root option in the examples below.

sudo grub
grub> ls  (output will be specific to your system)
grub> quit  (when you are finished using grub)

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

grub> grub --version

Adding PC-BSD to Legacy GRUB

If the version number is less than 1, you are using legacy GRUB. Here is an example of adding a PC-BSD entry to a Linux distro that is using legacy GRUB:

title  PCBSD 9.0
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 the first partition on that disk, 2 for the second partition, etc.)
  • Kernel: Used to load the primary boot image. For FreeBSD and PC-BSD, always use /boot/loader.

For more information about legacy GRUB, refer to the GRUB Legacy Manual.

Adding PC-BSD to GRUB Version 2

If you installed PC-BSD on the first hard drive, in the 3rd primary partition, the entry would look something like this:

menuentry "PCBSD 9.0" {
set root=(hd0,3)
chainloader +1

If you installed PC-BSD onto a second hard drive and did not check the box to partition disk with GPT, the entry would look something like this:

title PC-BSD 9.0
map (hd0) (hd1)
map (hd1) (hd0)
map --hook
chainloader (hd0,0)/boot0

If you installed PC-BSD onto a second hard drive and checked the box to partition disk with GPT, the entry would look something like this:

title PC-BSD GPT
map (hd0) (hd1)
map (hd1) (hd0)
map --hook
chainloader (hd0,0)/pmbr

If you installed ZFS on a GPT Partition, your entry would look something like this:

menuentry "PC-BSD 9.0" {
         insmod zfs
         search -s -l freepool
         kfreebsd /freebsd@/boot/kernel/kernel
         kfreebsd_module_elf /freebsd@/boot/kernel/opensolaris.ko
         kfreebsd_module_elf /freebsd@/boot/kernel/zfs.ko
         kfreebsd_module /freebsd@/boot/zfs/zpool.cache type=/boot/zfs/zpool.cache
         set kFreeBSD.vfs.root.mountfrom=zfs:freepool/freebsd

After a GRUB2 configuration change you need to run update-grub as the superuser or sudo update-grub on a Debian-based system. If you are trying to dual-boot with GRUB2 under Fedora 16, run grub2-mkconfig -o /boot/grub2/grub.cfg as the superuser.

For more information please refer to the GNU GRUB Manual.

Dual Boot with Windows Using EasyBCD

EasyBCD was developed by the non-profit NeoSmart Technologies to make it easy to add other operating system entries to the the Windows boot loader. EasyBCD allows you to add entries for multiple Windows installations as well as Linux, BSD, and Mac OS X. EasyBCD provides both a paid version and a free version for limited, non-commercial use.

After booting into Windows, download and install the latest version of EasyBCD. Once installed, launch EasyBCD. The initial screen will show the current Windows bootloader. As seen in the example in Figure 4.5.4a, it will be set to boot Windows only:

Figure 4.5.4a: Viewing the Windows Boot Loader Entries Using EasyBCD


Click the "Add New Entry" button to add an entry for your PC-BSD installation. In the Linux/BSD tab, click the "Type" drop down menu and select FreeBSD/PC-BSD from the list. Type in something useful in the "Name" field; whatever you type here will show up in the boot menu. Click the "Device" drop down menu and select the partition holding your PC-BSD installation. It will have a filesystem type of 0xA5 rather than a drive letter or NTFS. The entry will also show its size so you can find it if you have other non-Windows partitions. An example is seen in Figure 4.5.4b:

Figure 4.5.4b: Adding an Entry for PC-BSD to the Windows Boot Loader


Once you've made your selections, click the "Add Entry" button. If you then click on the "View Settings" button, you should see a new entry for your PC-BSD installation.

Now that you have an entry, you can click the "Edit Boot Menu" button to set the order of the entries in the boot menu, the default operating system to boot, and the boot menu selection timeout before booting into the default operating system. This screen is shown in Figure 4.5.4c.

Figure 4.5.4c: Viewing the New Entry in EasyBCD


Once you reboot, a simple boot menu will appear containing entries for Windows and PC-BSD. A sample menu is shown in Figure 4.5.4d. Use your arrow key to select the operating system you wish to boot into.

Figure 4.5.4d: Sample Boot Menu Created by EasyBCD


Personal tools