Difference between revisions of "Dual Booting/9.2/en"

From PC-BSD Wiki
Jump to: navigation, search
(Importing a new version from external source)
(Importing a new version from external source)
 
(13 intermediate revisions by one user not shown)
Line 1: Line 1:
 
<noinclude>
 
<noinclude>
{{NavHeader|back=Using a Rolling Release |forward=Multiple Boot Environments}}</noinclude>
+
{{UseTOC{{putVers}}|Nav}}</noinclude>
  
 
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.  
 
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.  
Line 6: Line 6:
 
If you wish to install multiple operating systems on your computer, you will need the following:
 
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 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 {{local|link=Partitioning the Hard Drive}}.
  
 
* a boot loader that allows you to select which operating system you wish to boot into. 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 boot loader that allows you to select which operating system you wish to boot into. 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.
Line 14: Line 14:
 
=== Choosing the Installation Partition ===
 
=== 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 Selection Screen | Disk Selection 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.'' '''
+
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 {{local|link=Disk Selection Screen|Disk Selection 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|icon64=''' ''make sure that you click the "Customize" button while in the "Disk Selection" screen.'' ''' If you just click Next without customizing the disk layout, the installer will overwrite the contents of the primary disk.}}
 
{{danger|icon64=''' ''make sure that you click the "Customize" button while in the "Disk Selection" screen.'' ''' If you just click Next without customizing the disk layout, the installer will overwrite the contents of the primary disk.}}
  
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.
+
===GRUB Boot Loader===
  
=== Choosing a Boot Manager ===
+
If you install PC-BSD® on a computer that already contains an operating system, an entry for PC-BSD® will automatically be added to the {{local|link=Booting_Into_PC-BSD®|anchor=Interrupting_the_Boot_to_Access_the_Boot_Menu|PC-BSD® boot menu}}. Depending upon which other operating systems are installed, the installer may or may not automatically detect and add entries for the other operating systems.
  
When selecting a boot manager, choose the one that best suits your needs or which is already installed on the computer.
+
If your other operating system is not found, use the {{local|link=PC-BSD® Bug Reporting}} tool to create a bug report. Include the version of the missing operating system and on which disk and partition that operating system is installed. If you are already familiar with how to create GRUB entries and are successful in manually adding an entry, include that entry in your bug report. This way, other PC-BSD® users with similar layouts can benefit when the required GRUB entry is added to the installer's logic.
 
+
If GRUB is already installed on the system, review the [[Dual Booting#GRUB|GRUB]] section before installing PC-BSD® in order to determine which version of GRUB is installed. Legacy GRUB does not support GPT or ZFS. Depending upon your hardware, the installer may automatically select GPT or ZFS for you. You will need to change your layout to UFS and make sure that the "Partition disk with GPT" checkbox is unchecked while in the [[Disk Selection Screen]] of the installer. If GRUB version 2 is installed, you can select the installer's default partitioning layout as GRUB version 2 supports all of the disk options available during a PC-BSD® installation.
+
 
+
If you will be dual booting with Windows, EasyBCD is easy to install graphical application for configuring a customized boot menu. This boot manager supports all of the disk options available during a PC-BSD® installation, including ZFS and GPT. EasyBCD has also been localized into 13 languages, making it a good choice for localized boot menus.
+
 
+
GAG provides an easy to configure boot manager for loading any operating system. However, it does not support GPT. This means that you will need to make sure that the "Partition disk with GPT" checkbox is unchecked while in the [[Disk Selection Screen]] of the installer.
+
 
+
The rest of this section will demonstrate how to configure the GAG, GRUB, and EasyBCD boot loaders.
+
 
+
=== GAG, The Graphical Boot Manager ===
+
 
+
{{citelink|url=http://gag.sourceforge.net/|txt=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 5.2a:
+
 
+
[[File:Gag1.png|thumb|393px|'''Figure 5.2a: Initial GAG Screen''']]
+
 
+
{{note|width=48.5%|icon64=your mouse will not 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 5.2b:
+
 
+
[[File:Gag4.png|thumb|393px|'''Figure 5.2b: Press the S Key to Configure GAG''']]
+
 
+
Press S to "Setup GAG" and see the screen shown in Figure 5.2c:
+
 
+
[[File:Gag5.png|thumb|393px|'''Figure 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|width=48.5%|icon64=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&nbsp;9.1". 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 5.2d.
+
 
+
[[File:Gag7.png|thumb|393px|'''Figure 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&nbsp;9.1" 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". Note that the screen shown in Figure 5.2b now contains the entries for the operating systems that you added. Remove the CD and press the key associated with the operating system that 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.
+
 
+
=== GRUB ===
+
 
+
Many Linux distros use {{citelink|url=http://www.gnu.org/software/grub/|txt=GRUB}} as the boot loader. This section shows you how to add PC-BSD® to an existing GRUB menu.
+
 
+
There are two versions of GRUB that are in use. To see which version your Linux distro is using, boot into the Linux system and use the '''--version''' option to the '''grub''' command line tool:
+
 
+
{{txtbox|box='''sudo grub'''
+
grub> '''grub --version'''}}
+
 
+
If the version number is less than 1, you are using legacy GRUB; otherwise you are using GRUB version 2.
+
 
+
If you are using GRUB version 2, run the '''ls''' command within '''grub''' to determine the names of the disks and partitions that can be seen by GRUB. This will help you determine which drive options to use when setting the root option in the examples shown in [[Dual Booting#Adding PC-BSD® to GRUB Version 2|Adding PC-BSD® to GRUB Version 2]]. The output of this command will vary depending upon your disk layout and the naming scheme used by the Linux distro. When you are finished using '''grub''', type '''quit''' to leave the utility.
+
 
+
{{txtbox|box=grub> '''ls'''
+
grub> '''quit'''}} 
+
 
+
==== Adding PC-BSD® to Legacy GRUB ====
+
 
+
{{note|legacy GRUB does not support the GPT format. When you are in the [[Disk Selection Screen]] of the PC-BSD® installer, select Advanced Mode and make sure that the "Partition disk with GPT" checkbox is unchecked.}}
+
 
+
Here is an example of adding a PC-BSD® entry to a Linux distro that is using legacy GRUB:
+
 
+
{{txtbox|box=title  PCBSD 9.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®, as determined by the '''ls''' command described in the previous section. In this example, PC-BSD® is installed on the first hard disk ''hd0'' and on the second partition '',1''. Depending upon your distro and where you installed PC-BSD®, the ouput of '''ls''' on your system may differ.  
+
 
+
* '''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 {{citelink|url=http://www.gnu.org/software/grub/manual/legacy/grub.html|txt=GRUB Legacy Manual}}.
+
 
+
==== Adding PC-BSD® to GRUB Version 2 ====
+
 
+
GRUB version 2 supports both the MBR and GPT formats.
+
 
+
In this example, PC-BSD® is installed on the third primary partition of the first hard drive using the MBR format:
+
 
+
{{txtbox|box=menuentry "PCBSD 9.1" {
+
insmod ufs2
+
set root=(hd0,2,a)
+
kfreebsd /boot/loader
+
<nowiki>}</nowiki>}}
+
 
+
Where:
+
 
+
* '''menuentry''': the text between the quotes will be displayed in the boot menu and can be anything that makes sense to you.
+
   
+
* '''insmod''': some distros require this instruction to load the UFS2 kernel module.
+
 
+
* '''set root:''' the root of the partition containing PC-BSD®, as determined by the '''ls''' command described in the previous section.  Always add the ''a'' at the end to refer to the  BSD boot partition on the specified disk and partition.
+
   
+
* '''kfreebsd''': used to load the primary boot image. For FreeBSD and PC-BSD®, always use ''/boot/loader''.
+
 
+
The entry for the same installation (third partition on first drive), but with the GPT box checked, will differ slightly in the ''set root'' line.
+
 
+
{{txtbox|box=menuentry "PCBSD 9.1" {
+
insmod ufs2
+
set root=(hd0,msdos2,bsd1)
+
kfreebsd /boot/loader
+
<nowiki>}</nowiki>}}
+
 
+
If you installed PC-BSD® onto the second hard drive, you need to invoke the ''map'' and ''chainloader'' commands in order to boot from the second disk. In this example, PC-BSD® is installed in the first partition of the second drive and the  box to partition disk with GPT was ''' ''not'' ''' checked.
+
 
+
{{txtbox|box=menuentry "PC-BSD 9.1" {
+
map (hd0) (hd1)
+
map (hd1) (hd0)
+
map --hook
+
chainloader (hd0,0)/boot0
+
boot
+
<nowiki>}</nowiki>}}
+
 
+
The entry if the GPT box was checked looks like this:
+
 
+
{{txtbox|box=menuentry "PC-BSD GPT" {
+
map (hd0) (hd1)
+
map (hd1) (hd0)
+
map --hook
+
chainloader (hd0,0)/pmbr
+
boot
+
<nowiki>}</nowiki>}}
+
 
+
If you installed ZFS, several modules need to be loaded. Here is a sample entry with the GPT box checked:
+
 
+
{{txtbox|box=menuentry "PC-BSD 9.1" {
+
&nbsp;        insmod zfs
+
&nbsp;        search -s -l tank0
+
&nbsp;        kfreebsd /freebsd@/boot/kernel/kernel
+
&nbsp;        kfreebsd_module_elf /freebsd@/boot/kernel/opensolaris.ko
+
&nbsp;        kfreebsd_module_elf /freebsd@/boot/kernel/zfs.ko
+
&nbsp;        kfreebsd_module /freebsd@/boot/zfs/zpool.cache type=/boot/zfs/zpool.cache
+
&nbsp;        set kFreeBSD.vfs.root.mountfrom=zfs:tank0/freebsd
+
<nowiki>}</nowiki>}}
+
 
+
 
+
After a GRUB2 configuration change you need to run a command to update the configuration. This command varies by distro:
+
 
+
* '''sudo update-grub''' on a Debian-based system
+
 
+
* '''grub2-mkconfig -o /boot/grub2/grub.cfg''' as the superuser under Fedora 16 or Gentoo
+
 
+
* '''grub-mkconfig -o /boot/grub/grub.cfg''' when using Sabayon
+
 
+
For more information please refer to the {{citelink|url=http://www.gnu.org/software/grub/manual/grub.html|txt=GNU GRUB Manual}}.
+
 
+
=== Dual Boot with Windows Using EasyBCD ===
+
 
+
{{citelink|url=http://neosmart.net/EasyBCD/|txt=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 5.2e, it will be set to boot Windows only:
+
 
+
[[File:Easybsd1.png|thumb|393px|'''Figure 5.2e: 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 5.2f:
+
 
+
[[File:Easybsd2a.png|thumb|393px|'''Figure 5.2f: Adding an Entry for PC-BSD® to the Windows Boot Loader''']]
+
 
+
Once you have 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 5.2g.
+
 
+
[[File:Easybcd3.png|thumb|393px|'''Figure 5.2g: 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 5.2h. Use your arrow key to select the operating system you wish to boot into.
+
 
+
[[File:Easybcd4.png|thumb|393px|'''Figure 5.2h: Sample Boot Menu Created by EasyBCD''']]
+
 
+
=== Recovering Windows Boot loader After Installing PC-BSD® ===
+
 
+
If you accidentally overwrite your Windows boot loader, you will be unable to boot into Windows after installing PC-BSD®.  Depending upon the version of Windows, the PC-BSD® boot loader may or may not automatically provide an entry to boot into Windows. However, assuming you have not accidentally installed PC-BSD® into the Windows partition, your Windows installation is still there and it is possible to restore the Windows boot loader. How to do so varies by the version of Windows:
+
 
+
* {{citelink|url=http://www.ehow.com/how_4891476_reinstall-xp-bootloader.html|txt=How to Reinstall XP Bootloader}}
+
 
+
* {{citelink|url=http://www.ehow.com/how_5127739_restore-vista-boot-manager.html|txt=How to Restore Vista Boot Manager}}
+
 
+
* {{citelink|url=http://www.howtogeek.com/howto/32523/how-to-manually-repair-windows-7-boot-loader-problems/|txt=How to Manually Repair Windows 7 Boot Loader Problems}}
+
 
+
Once the Windows boot loader is recovered, you can use [[#Dual Boot with Windows Using EasyBCD|EasyBCD]] to add an entry for PC-BSD® to the Windows boot loader.
+
  
 
<noinclude>
 
<noinclude>
{{refheading}}
+
<!-- {{refheading}} --><!-- uncomment when citelink is used on the page -->
 +
[[category:Advanced Installation Topics]]
 
[[category:handbook]]
 
[[category:handbook]]
[[category:Advanced Installation Topics]]
 
</noinclude>
 
 
<languages/>
 
<languages/>
 
</noinclude>
 
</noinclude>

Latest revision as of 03:22, 18 December 2013


Contents


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/9.2.
  • a boot loader that allows you to select which operating system you wish to boot into. 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; on 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 will be glad that you made a backup should something go wrong.

[edit] 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 Selection 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 you click the "Customize" button while in the "Disk Selection" screen. If you just click Next without customizing the disk layout, the installer will overwrite the contents of the primary disk.

[edit] GRUB Boot Loader

If you install PC-BSD® on a computer that already contains an operating system, an entry for PC-BSD® will automatically be added to the PC-BSD® boot menu. Depending upon which other operating systems are installed, the installer may or may not automatically detect and add entries for the other operating systems.

If your other operating system is not found, use the PC-BSD® Bug Reporting/9.2 tool to create a bug report. Include the version of the missing operating system and on which disk and partition that operating system is installed. If you are already familiar with how to create GRUB entries and are successful in manually adding an entry, include that entry in your bug report. This way, other PC-BSD® users with similar layouts can benefit when the required GRUB entry is added to the installer's logic.

Other languages:German 100% • ‎English 100% • ‎French 36%
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox