<?Pub UDT _bookmark _target?><?Pub UDT __target_1 _target?><?Pub UDT registeredtm trademark?><?Pub EntList bull rArr sect?><?Pub CX solbook(book(title()bookinfo()chapter(14)?><chapter id="hbsysboot-76719" arch="x86"><?Pub Tag atict:info tracking="on"
ref="0"?><?Pub Tag atict:user user="sk23612" fullname="Juanita Heieck"?><?Pub Tag
atict:user user="jonj" fullname="Juanita Heieck"?><?Pub Tag atict:user
user="kathys" fullname="Kathy Slattery"?><?Pub Tag atict:user user="cathleen"
fullname=""?><?Pub Tag atict:user user="eb151805" fullname="Juanita Heieck"?><?Pub Tag
atict:user user="jh118764" fullname="Juanita Heieck"?><?Pub Tag atict:user
user="lh136763" fullname="Laura Hartman"?><title>GRUB Based Booting (Reference)</title><highlights><para>This chapter contains information about x86 boot processes, including
GRUB implementation details and additional GRUB reference information.</para><para>For overview information, see <olink targetptr="hboverview-25463" remap="internal">Chapter&nbsp;9,
Shutting Down and Booting a System (Overview)</olink>.</para><para>For step-by-step instructions on booting a system, see <olink targetptr="hbsparcboot-79782" remap="internal">Chapter&nbsp;12, Booting a Solaris System (Tasks)</olink>.</para>
</highlights><sect1 id="hbsysboot-1" arch="x86"><title>Boot Processes</title><para>This section includes information about boot processes that are unique
to booting an x86 based system.</para><sect2 id="fwaze" arch="x86"><title>System BIOS</title><indexterm><primary>BIOS</primary><secondary>system BIOS</secondary><tertiary>in GRUB boot environment</tertiary>
</indexterm><indexterm><primary>system BIOS in GRUB boot environment</primary>
</indexterm><para>When a system is powered on, the system is controlled by the read-only-memory
(ROM) Basic Input/Output System (BIOS). The BIOS is the firmware interface
on Solaris Operating Systems that have x86 64-bit and 32-bit support.</para><para>Hardware adapters usually have an on-board BIOS that displays the physical
characteristics of the device. The BIOS is used to access the device. During
the startup process, the system BIOS checks for the presence of any adapter
BIOS. If any adapters are found, the system then loads and executes each adapter
BIOS. Each adapter's BIOS runs self-test diagnostics and then displays device
information.</para><itemizedlist><para>The BIOS on most systems has a user interface, where you can select
an ordered list of boot devices that consists of the following selections:</para><listitem><para>Diskette</para>
</listitem><listitem><para>CD or DVD</para>
</listitem><listitem><para>Hard disk</para>
</listitem><listitem><para>Network</para>
</listitem>
</itemizedlist><para>The BIOS attempts to boot from each device, in turn, until a valid device
with a bootable program is found.</para>
</sect2><sect2 id="fwazd" arch="x86"><title>Kernel Initialization Process</title><indexterm><primary>kernel initialization in the GRUB boot environment</primary>
</indexterm><para>The <command>/platform/i86pc/multiboot</command> program is an <literal>ELF32</literal> executable that contains a header which is defined in the Multiboot
Specification. </para><itemizedlist><para>The multiboot program is responsible for performing the following tasks:</para><listitem><para>Interpreting the content of boot archive</para>
</listitem><listitem><para>Autodetection of systems that are 64-bit capable</para>
</listitem><listitem><para>Selecting the best kernel mode for booting the system</para>
</listitem><listitem><para>Assembling core kernel modules in memory</para>
</listitem><listitem><para>Handing control of the system to the Solaris kernel</para>
</listitem>
</itemizedlist>
</sect2>
</sect1><sect1 id="ghcsf" arch="x86"><title>Solaris Support for the GRUB Bootloader</title><para>The following sections contain additional reference information for
administering GRUB in the Solaris OS</para><sect2 id="grubterm" arch="x86"><title>GRUB Terminology</title><indexterm><primary>GRUB terminology</primary>
</indexterm><indexterm><primary>terminology</primary><secondary>GRUB</secondary>
</indexterm><para>To thoroughly grasp GRUB concepts, an understanding of the following
terms is essential.</para><note><para>Some of the terms that are described in this list are not exclusive
to GRUB based booting.</para>
</note><variablelist><varlistentry><term><emphasis role="strong">boot archive</emphasis></term><listitem><para>A collection of critical files that is used to boot the Solaris
OS. These files are needed during system startup before the root file system
is mounted. Multiple boot archives are maintained on a system:</para><itemizedlist><listitem><para>A <emphasis>primary boot archive</emphasis> is used to boot
the Solaris OS on an x86 based system.</para><note><para>On
the x86 platform, when you install the Solaris OS, two primary boot archives
are created, one 32-bit archive and one 64-bit archive.</para>
</note>
</listitem><listitem><para>A <emphasis>failsafe boot archive</emphasis> that is used
for recovery when a primary boot archive is damaged. This boot archive starts
the system without mounting the root file system. On the GRUB menu, this boot
archive is called <emphasis>failsafe</emphasis>. The archive's primary purpose
is to regenerate the primary boot archives, which are usually used to boot
the system.</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry><varlistentry><term><emphasis role="strong">boot loader</emphasis></term><listitem><para>The first software program that runs after you power on a
system. This program begins the booting process.</para>
</listitem>
</varlistentry><varlistentry><term><emphasis role="strong">failsafe archive</emphasis></term><listitem><para>See boot archive.</para>
</listitem>
</varlistentry><varlistentry><term><emphasis role="strong">GRUB</emphasis></term><listitem><para>GNU GRand Unified Bootloader (GRUB) is an open-source boot
loader with a menu interface.  The menu displays a list of the operating systems
that are installed on a system. GRUB enables you to easily boot these various
operating systems,  such as the Solaris OS, Linux, or Windows.</para>
</listitem>
</varlistentry><varlistentry><term><emphasis role="strong">GRUB main menu</emphasis></term><listitem><para>A boot menu that lists the operating systems that are installed
 on a system. From this menu, you can easily boot an operating  system without
modifying the BIOS or <literal>fdisk</literal> partition settings.</para>
</listitem>
</varlistentry><varlistentry><term><emphasis role="strong">GRUB edit menu</emphasis></term><listitem><para>A submenu of the GRUB main menu. GRUB commands are displayed
on this submenu. These commands can be edited to change boot behavior.</para>
</listitem>
</varlistentry><varlistentry><term><filename>menu.lst</filename> <emphasis role="strong">file</emphasis></term><listitem><para>A configuration file that lists all the operating systems
that are installed on a system.  The contents of this file dictate the list
of operating systems that is displayed in the GRUB menu.  From the GRUB menu,
you can easily boot an operating system without modifying the BIOS or <literal>fdisk</literal> partition settings.</para>
</listitem>
</varlistentry><varlistentry><term><emphasis role="strong">miniroot</emphasis></term><listitem><para>A minimal, bootable root (<filename>/</filename>) file system
that resides on the Solaris installation media. A miniroot consists of the
Solaris software that is required to install and upgrade systems. On x86 based
systems, the miniroot is copied to the system to be used as the failsafe boot
archive. See boot archive for details about the failsafe boot archive.</para>
</listitem>
</varlistentry><varlistentry><term><emphasis role="strong">primary boot archive</emphasis></term><listitem><para>See boot archive.</para>
</listitem>
</varlistentry>
</variablelist>
</sect2><sect2 id="fvbsp" arch="x86"><title>Functional Components of GRUB</title><indexterm><primary>GRUB functional components</primary>
</indexterm><indexterm><primary>components of GRUB</primary>
</indexterm><indexterm><primary>functional components of GRUB</primary>
</indexterm><indexterm><primary><filename>stage2</filename></primary><secondary>GRUB component</secondary>
</indexterm><indexterm><primary><filename>menu.1st</filename></primary><secondary>GRUB component</secondary>
</indexterm><itemizedlist><para>GRUB consists of the following functional components:</para><listitem><para><filename>stage1</filename> &ndash; Is an image that is installed
on the first sector of the Solaris <filename>fdisk</filename> partition. You
can optionally install <filename>stage1</filename> on the master boot sector
by specifying the <option>m</option> option with the <command>installgrub</command> command.
See the <olink targetdoc="refman" targetptr="installgrub-1m" remap="external"><citerefentry><refentrytitle>installgrub</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page and <olink targetdoc="sagdfs" targetptr="gbehx" remap="external"><citetitle remap="section">Disk Management in the GRUB Boot Environment</citetitle> in <citetitle remap="book">System Administration Guide: Devices and File Systems</citetitle></olink> for
more information.</para>
</listitem><listitem><para><filename>stage2</filename> &ndash; Is an image that is installed
in a reserved area in the Solaris <filename>fdisk</filename> partition. The <filename>stage2</filename> image is the core image of GRUB.</para>
</listitem><listitem><para><filename>menu.lst</filename> file &ndash; Is typically located
in the <filename>/boot/grub</filename> directory on systems with a UFS root
and in the <filename>/<replaceable>pool-name</replaceable>/boot/grub</filename> directory
on systems with a ZFS root. This file is read by the GRUB <filename>stage2</filename> file.
For more information, see the section, <olink targetptr="fvbsi" remap="internal">Modifying
Boot Behavior by Editing the menu.lst File</olink>.</para>
</listitem>
</itemizedlist><para>You cannot use the <command>dd</command> command to write <filename>stage1</filename> and <filename>stage2</filename> images to disk. The <filename>stage1</filename> image must
be able to receive information about the location of the <filename>stage2</filename> image
that is on the disk. Use the <command>installgrub</command> command, which
is the supported method for installing GRUB boot blocks.</para><sect3 id="fvbsh"><title>Naming Conventions That Are Used for Configuring GRUB</title><indexterm><primary>GRUB device naming conventions</primary>
</indexterm><indexterm><primary>naming conventions for devices</primary><secondary>in GRUB</secondary>
</indexterm><indexterm><primary>device naming conventions</primary><secondary>in GRUB</secondary>
</indexterm><para>GRUB uses conventions that are slightly different from previous Solaris
releases. Understanding the GRUB device-naming conventions can assist you
in correctly specifying drive and partition information when you configure
GRUB on your system.</para><para>The following table describes the GRUB device-naming conventions for
this Solaris release.</para><table frame="all" id="fvbsm"><title>Conventions for GRUB Devices</title><tgroup cols="2" colsep="1" rowsep="1"><colspec colwidth="50*"/><colspec colwidth="50*"/><thead><row><entry><para>Device Name</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry><para>(<literal>fd0</literal>)</para>
</entry><entry><para>First diskette</para>
</entry>
</row><row><entry><para>(<literal>fd1</literal>)</para>
</entry><entry><para>Second diskette</para>
</entry>
</row><row><entry><para>(<literal>nd</literal>)</para>
</entry><entry><para>Network device</para>
</entry>
</row><row><entry><para>(<literal>hd0,0</literal>)</para>
</entry><entry><para>First <literal>fdisk</literal> partition on first hard disk</para>
</entry>
</row><row><entry><para>(<literal>hd0,1</literal>)</para>
</entry><entry><para>Second <literal>fdisk</literal> partition on first hard disk</para>
</entry>
</row><row><entry><para><literal>(hd0,0,a</literal>),</para>
</entry><entry><para>Slice <literal>a</literal> on first <literal>fdisk</literal> partition
on first hard disk</para>
</entry>
</row><row><entry><para>(<literal>hd0,0,b</literal>)</para>
</entry><entry><para>Slice <literal>b</literal> on first <literal>fdisk</literal> partition
on first hard disk</para>
</entry>
</row>
</tbody>
</tgroup>
</table><note><para>All GRUB device names must be enclosed in parentheses.</para>
</note><para>For more information about <literal>fdisk</literal> partitions, see <olink targetdoc="sagdfs" targetptr="disksxadd-54639" remap="external"><citetitle remap="section">Guidelines for Creating an fdisk Partition</citetitle> in <citetitle remap="book">System Administration Guide: Devices and File Systems</citetitle></olink>.</para>
</sect3><sect3 id="ghskt"><title>Naming
Conventions That Are Used by the <command>findroot</command> Command</title><para>Starting with the Solaris 10 10/08 release, the <command>findroot</command> command
replaces the <command>root</command> command that was previously used by GRUB.
The <command>findroot</command> command provides enhanced capabilities for
discovering a targeted disk, regardless of the boot device.  The <command>findroot</command> command also supports booting from a ZFS root file system This
command replaces the <command>root</command> command that was formerly used
by GRUB.</para><itemizedlist><para>The following is a description of the device naming convention that
is used by the <command>findroot</command> command for various GRUB implementations:</para><listitem><para>Solaris Live Upgrade:</para><screen><command>findroot</command> (<filename>BE_<replaceable>x</replaceable>,0,a</filename>)</screen><para>The <replaceable>x</replaceable> variable is the name of the boot environment.</para>
</listitem><listitem><para>Standard system upgrades and new installations for systems
with ZFS support:</para><screen><command>findroot</command>(<filename>pool_<replaceable>p</replaceable>,0,a</filename>)</screen><para>The <replaceable>p</replaceable> variable is the name of the root pool.</para>
</listitem><listitem><para>Standard system upgrades and new installations for systems
with UFS support:</para><screen><command>findroot</command> (<filename>rootfs<replaceable>N</replaceable>,0,a</filename>)</screen><para>The <replaceable>N</replaceable> variable is an integer number that
starts at 0.</para>
</listitem>
</itemizedlist>
</sect3>
</sect2><sect2 id="fxjig"><title>How Multiple Operating Systems Are Supported by GRUB</title><indexterm><primary>multiple operating systems in the GRUB boot environment</primary>
</indexterm><indexterm><primary>GRUB</primary><secondary>support for multiple operating systems</secondary>
</indexterm><para>This section describes how multiple operating systems that are on the
same disk are supported with GRUB. The following is an example of an x86 based
system that has the Solaris 10 10/08 OS, the Solaris 9 OS, Linux, and Windows
installed on the same disk.</para><table frame="topbot" id="getpg"><title>Sample GRUB Menu Configuration</title><tgroup cols="2" colsep="0" rowsep="0"><?PubTbl tgroup dispwid="916.00px"?><colspec colwidth="44.70*"/><colspec colwidth="55.30*"/><thead><row rowsep="1"><entry><para>Operating System</para>
</entry><entry><para>Location on Disk</para>
</entry>
</row>
</thead><tbody><row><entry><para>Windows</para>
</entry><entry><para><literal>fdisk</literal> partition 0</para>
</entry>
</row><row><entry><para>Linux</para>
</entry><entry><para><literal>fdisk</literal> partition 1</para>
</entry>
</row><row><entry><para>Solaris</para>
</entry><entry><para><literal>fdisk</literal> partition 2</para>
</entry>
</row><row><entry><para>Solaris 9 OS</para>
</entry><entry><para>Slice <literal>0</literal></para>
</entry>
</row><row><entry><para>Solaris 10 10/08 OS</para>
</entry><entry><para>Slice <literal>3</literal></para>
</entry>
</row>
</tbody>
</tgroup>
</table><para>Based on the preceding information, the GRUB menu would look like the
following:</para><screen>title Solaris 10
			findroot (pool_rpool,0,a)
			kernel$ /platform/i86pc/multiboot -B $ZFS-BOOTFS
			module /platform/i86pc/boot_archive
title Solaris 9 OS (pre-GRUB)
			root (hd0,2,a)
			chainloader +1
			makeactive
title Linux
			root (hd0,1)
			kernel &lt;from Linux GRUB menu...&gt;
			initrd &lt;from Linux GRUB menu...&gt;
title Windows
			root (hd0,0)
			chainloader +1</screen><note><para>The Solaris slice must be the active partition. Also, do not indicate <literal>makeactive</literal> under the Windows menu. Doing so causes the system to
boot Windows every time. Note that if Linux has installed GRUB on the master
boot block, you cannot access the Solaris boot option. The inability to access
the Solaris boot option occurs whether or not you designate it as the active
partition.</para>
</note><itemizedlist><para>In this case, you can do one of the following:</para><listitem><para>Chain-load from the Linux GRUB by modifying the menu on Linux.</para><para><emphasis>Chain-loading</emphasis> is a mechanism for loading unsupported
operating systems by using another boot loader.</para>
</listitem><listitem><para>Replace the master boot block with the Solaris GRUB by running
the <command>installgrub</command> command with the <option>m</option> option:</para><screen># <userinput>installgrub -m /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/<replaceable>root-slice</replaceable></userinput></screen><para>See the <olink targetdoc="refman" targetptr="installgrub-1m" remap="external"><citerefentry><refentrytitle>installgrub</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page for more information.</para>
</listitem>
</itemizedlist><para>For information about the Solaris Live Upgrade boot environment, see <olink targetdoc="solinstallupg" remap="external"><citetitle remap="book">Solaris Express Installation Guide:  Solaris Live Upgrade and Upgrade Planning</citetitle></olink>.</para>
</sect2><sect2 id="getnk" arch="x86"><title>Supported GRUB Implementations</title><indexterm><primary>booting a system by using GRUB, overview</primary>
</indexterm><indexterm><primary>implementations of GRUB in Solaris OS</primary>
</indexterm><para> In
the Solaris Express release, GRUB uses the direct boot implementation. The
contents of the <filename>menu.lst</filename> file varies, depending on the
Solaris release you are running, the installation method that is used, and
whether you are booting the system from a ZFS root or a UFS root.</para><itemizedlist><listitem><para><emphasis role="strong">GRUB ZFS boot support</emphasis></para><para>For a description of the <filename>menu.lst</filename> file and an example,
see <olink targetptr="ggjgb" remap="internal">Description of the menu.lst File (ZFS Support)</olink>.</para>
</listitem><listitem><para><emphasis role="strong">GRUB UFS boot support</emphasis></para><para>For a description of the <filename>menu.lst</filename> file and an example,
see <olink targetptr="getof" remap="internal">Description of the menu.lst File (UFS Support)</olink>.</para>
</listitem><listitem><para><emphasis role="strong">GRUB hypervisor support</emphasis></para><para>For a description of the <filename>menu.lst</filename> file
and instructions on booting an x86 based system with this implementation of
GRUB, see <olink targetptr="gftyx" remap="internal">Description of a menu.lst File That Supports
Hypervisor Technology</olink>.</para>
</listitem>
</itemizedlist><note><para>In this implementation
of GRUB, the <literal>multiboot</literal> module is no longer used.</para>
</note><sect3 id="ggjgb"><title>Description of the <filename>menu.lst</filename> File
(ZFS Support)</title><para>The following are various
examples of a <filename>menu.lst</filename> file
for a boot environment that contains a ZFS boot loader:</para><note><para>Because the miniroot is mounted as the real root file system,
the entry for failsafe booting in the <filename>menu.lst</filename> file does <emphasis>not </emphasis> change to the ZFS <literal>bootfs</literal> property, even
if the failsafe archive is read from a ZFS dataset. The ZFS dataset is not
accessed after the boot loader reads the miniroot.</para>
</note><example id="ggvnt"><title>Default <filename>menu.lst</filename> File (New
Installation or Standard Upgrade)</title><screen>title Solaris 11 s10x_90 X86
findroot (pool_rpool,0,a)
kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS
module$ /platform/i86pc/$ISADIR/boot_archive

title Solaris 11 failsafe
findroot (pool_rpool,0,a)
kernel /boot/platform/i86pc/kernel/unix -s -B console=ttyb
module /boot/x86.miniroot-safe</screen>
</example><example id="ggvmz"><title>Default <filename>menu.lst</filename> File (Solaris
Live Upgrade)</title><screen>title be1
findroot (BE_be1,0,a)
bootfs rpool/ROOT/szboot_0508
kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS
module$ /platform/i86pc/$ISADIR/boot_archive

title be1 failsafe
findroot (BE_be1,0,a)
kernel /boot/platform/i86pc/kernel/unix -s -B console=ttyb
module /boot/x86.miniroot-safe</screen>
</example>
</sect3><sect3 id="getof"><title>Description of the <filename>menu.lst</filename> File
(UFS Support)</title><indexterm><primary>multiboot implementation</primary><secondary><filename>menu.lst</filename> file description</secondary>
</indexterm><indexterm><primary><filename>menu.lst</filename> file</primary><secondary>multiboot implementation</secondary>
</indexterm><para>The following
are examples of a <filename>menu.lst</filename> file on a system that supports booting from UFS.</para><example id="gexxl"><title>Default GRUB <filename>menu.lst</filename> File
(New Installation or Standard Upgrade)</title><screen>title Solaris 10 5/08 s10x_nbu6wos_nightly X86 
findroot (pool_rpool,0,a)
kernel /platform/i86pc/multiboot
module /platform/i86pc/boot_archive

title Solaris failsafe
findroot (rootfs0,0,a)
kernel /boot/multiboot kernel/unix -s -B console-ttyb
module /boot/x86.miniroot-safe</screen>
</example><example id="ghbcv"><title>Default GRUB <filename>menu.lst</filename> File
(Solaris Live Upgrade)</title><screen>title be1
findroot (BE_be1,0,a)
kernel$ /platform/i86pc/kernel/$ISADIR/unix
module$ /platform/i86pc/$ISADIR/boot_archive

title be1 failsafe
findroot (BE_be1,0,a)
kernel /boot/platform/i86pc/kernel/unix -s -B console=ttyb
module /boot/x86.miniroot-safe</screen>
</example>
</sect3><sect3 id="gftyx"><title>Description of a <filename>menu.lst</filename> File That Supports Hypervisor Technology</title><indexterm><primary>hypervisor support</primary><secondary><filename>menu.lst</filename> file description</secondary>
</indexterm><indexterm><primary>GRUB hypervisor support</primary>
</indexterm><indexterm><primary><filename>menu.lst</filename> file</primary><secondary>GRUB support for hypervisor</secondary>
</indexterm><para>You can run the Solaris OS as a virtualized control domain, with the
hypervisor. To run the Solaris release with this support, there must be an
entry in <filename>menu.lst</filename> file that specifies the hypervisor.
This entry can either be the default boot menu item, or you can select this
entry manually at boot time.  After you upgrade your system for the first
time to a Solaris release that includes this support, the <command>bootadm</command> command
automatically adds a GRUB <filename>menu.lst</filename> entry for the hypervisor.</para><para>The following are <filename>menu.lst</filename> entries for this GRUB
implementation:</para><screen remap="wide">title Solaris on xVM
kernel$ /boot/$ISADIR/xen.gz
module$ /platform/i86xpv/kernel/$ISADIR/unix /platform/i86xpv/kernel/$ISADIR/unix -B $ZFS-BOOTFS
module$ /platform/i86pc/$ISADIR/boot_archive</screen><itemizedlist><listitem><para>The <filename>kernel$</filename> line specifies a path to <filename>xen.gz</filename> file, followed by optional hypervisor arguments.</para>
</listitem><listitem><para>The first <filename>module$</filename> line includes the path
to UNIX twice, followed by any arguments for the Solaris dom0 kernel.</para>
</listitem><listitem><para>The second <filename>module$</filename> line provides the
path to the boot archive.</para>
</listitem>
</itemizedlist><para>Note that the path to UNIX in the <filename>menu.lst</filename> entry
for the hypervisor uses <literal>i86xpv</literal>, <emphasis>not</emphasis> <literal>i86pc</literal>. The options that are interpreted by the hypervisor are added
to end of the <command>kernel$</command> line, after the <filename>xen.gz</filename> file
information.</para><para>If you choose to run the Solaris release as a stand-alone OS, you can
continue to use the same GRUB menu entries that you used previously.</para><para>For example:</para><screen>title Solaris Nevada ... X86
kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS
module$ /platform/i86pc/$ISADIR/boot_archive</screen><para>For more information about how to modify GRUB <filename>menu.lst</filename> entries,
see <olink targetptr="fvbbb" remap="internal">How to Modify Boot Behavior by Editing the menu.lst
File</olink>.</para>
</sect3>
</sect2>
</sect1>
</chapter><?Pub *0000035322 0?>