<chapter id="grub-1" arch="x86"><title>GRUB Based Booting for Solaris Installation</title><highlights><para>This chapter describes the GRUB based booting on x86 based systems that
relates to Solaris installation. This chapter contains the following sections:</para><itemizedlist><listitem><para><olink targetptr="fxivs" remap="internal">GRUB Based Booting (Overview)</olink></para>
</listitem><listitem><para><olink targetptr="gavdl" remap="internal">GRUB Based Booting (Planning)</olink></para>
</listitem>
</itemizedlist>
</highlights><sect1 id="fxivs" arch="x86"><title>GRUB Based Booting (Overview)</title><para>GRUB, the open source boot loader, has been adopted as the default boot
loader in the Solaris OS.</para><note><para>GRUB based booting is not available on SPARC based systems.</para>
</note><para>The <emphasis>boot loader</emphasis> is the first software program that
runs after you power on a system. After you power on an x86 based system,
the Basic Input/Output System (BIOS) initializes the CPU, the memory, and
the platform hardware. When the initialization phase has completed, the BIOS
loads the boot loader from the configured boot device, and then transfers
control of the system to the boot loader.</para><para>GRUB is an open source boot loader with a simple menu interface that
includes boot options that are predefined in a configuration file. GRUB also
has a command-line interface that is accessible from the menu interface for
performing various boot commands. In the Solaris OS, the GRUB implementation
is compliant with the Multiboot Specification. The specification is described
in detail at <ulink url="http://www.gnu.org/software/grub/grub.html" type="url"></ulink>.</para><para>Because the Solaris kernel is fully compliant with the Multiboot Specification,
you can boot a Solaris x86 based system by using GRUB. With GRUB, you can
more easily boot and install various operating systems. For example, on one
system, you could individually boot the following operating systems:</para><itemizedlist><listitem><para>Solaris OS</para>
</listitem><listitem><para>Microsoft Windows</para><note><para>GRUB detects Microsoft Windows partitions but does not verify
that the OS can be booted.</para>
</note>
</listitem><listitem><para>Linux</para>
</listitem>
</itemizedlist><para>A key benefit of GRUB is that it is intuitive about file systems and
kernel executable formats, which enables you to load an operating system without
recording the physical position of the kernel on the disk. With GRUB based
booting, the kernel is loaded by specifying its file name, and the drive,
and the partition where the kernel resides. GRUB based booting replaces the
Solaris Device Configuration Assistant and simplifies the booting process
with a GRUB menu.</para><sect2 id="fxivu" arch="x86"><title>How GRUB Based Booting Works</title><para>After GRUB gains control of the system, a menu is displayed on the console.
In the GRUB menu, you can do the following:</para><itemizedlist><listitem><para>Select an entry to boot your system</para>
</listitem><listitem><para>Modify a boot entry by using the built-in GRUB edit menu</para>
</listitem><listitem><para>Manually load an OS kernel from the command line</para>
</listitem>
</itemizedlist><para>A configurable timeout is available to boot the default OS entry. Pressing
any key aborts the default OS entry boot.</para><para>To view an example of a GRUB menu, see <olink targetptr="gavha" remap="internal">Description
of the GRUB Main Menu</olink>.</para>
</sect2><sect2 id="fvbsh" arch="x86"><title>GRUB Device Naming Conventions</title><para>The device naming conventions that GRUB uses are slightly different
from previous Solaris OS versions. 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.</para><table frame="all" id="fvbsm"><title>Naming 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>), (<literal>fd1</literal>)</para>
</entry><entry><para>First diskette, 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>), (<literal>hd0,1</literal>)</para>
</entry><entry><para>First and second <filename>fdisk</filename> partition of first <filename>bios</filename> disk</para>
</entry>
</row><row><entry><para><literal>(hd0,0,a</literal>), (<literal>hd0,0,b</literal>)</para>
</entry><entry><para>Solaris/BSD slice 0 and 1 on first <filename>fdisk</filename> partition
on the first <filename>bios</filename> disk</para>
</entry>
</row>
</tbody>
</tgroup>
</table><note><para>All GRUB device names must be enclosed in parentheses. Partition
numbers are counted from 0 (zero), not from 1.</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>
</sect2><sect2 id="fxias" arch="x86"><title>Where to Find Information About GRUB Based
Installations</title><para>For more information about these changes, see the following references.</para><table frame="topbot" id="fxxta"><title>Where to Find Information on GRUB
Based Installations</title><tgroup cols="3" colsep="0" rowsep="0"><colspec colname="colspec1" colwidth="29.81*"/><colspec colwidth="49.55*"/><colspec colwidth="70.63*"/><thead><row rowsep="1"><entry><para>Topic</para>
</entry><entry><para>GRUB Menu Tasks</para>
</entry><entry><para>For More Information</para>
</entry>
</row>
</thead><tbody><row><entry morerows="1"><para>Installation</para>
</entry><entry><para>To install from the Solaris OS CD or DVD media</para>
</entry><entry><para><olink targetdoc="solarisinstall" remap="external"><citetitle remap="book">Solaris Express Installation Guide: Basic Installations</citetitle></olink>.</para>
</entry>
</row><row><entry><para>To install from a network installation image</para>
</entry><entry><para><olink targetdoc="solinstallnet" targetptr="ejurp" remap="external">Part&nbsp;II, <citetitle remap="chapter">Installing Over a Local Area Network,</citetitle> in <citetitle remap="book">Solaris Express Installation Guide: Network-Based Installations</citetitle></olink></para>
</entry>
</row><row><entry>
</entry><entry><para>To configure a DHCP server for network installations</para>
</entry><entry><para><olink targetdoc="solinstallnet" targetptr="dhcp-admin-38" remap="external"><citetitle remap="section">Preconfiguring System Configuration Information With the DHCP Service (Tasks)</citetitle> in <citetitle remap="book">Solaris Express Installation Guide: Network-Based Installations</citetitle></olink></para>
</entry>
</row><row><entry>
</entry><entry><para>To install with the Custom JumpStart program</para>
</entry><entry><para><olink targetdoc="solinstalladv" targetptr="customjump-3" remap="external"><citetitle remap="section">Performing a Custom JumpStart Installation</citetitle> in <citetitle remap="book">Solaris Express Installation Guide: Custom JumpStart and Advanced Installations</citetitle></olink></para>
</entry>
</row><row><entry>
</entry><entry><para>To activate or fall back to a boot environment by using Solaris Live
Upgrade</para>
</entry><entry><itemizedlist><listitem><para><olink targetdoc="solinstallupg" targetptr="luupgrade-84" remap="external"><citetitle remap="section">Activating a Boot Environment</citetitle> in <citetitle remap="book">Solaris Express Installation Guide:  Solaris Live Upgrade and Upgrade Planning</citetitle></olink></para>
</listitem><listitem><para><olink targetdoc="solinstallupg" targetptr="luupgrade-85" remap="external">Chapter 6, <citetitle remap="chapter">Failure Recovery: Falling Back to the Original Boot Environment (Tasks),</citetitle> in <citetitle remap="book">Solaris Express Installation Guide:  Solaris Live Upgrade and Upgrade Planning</citetitle></olink></para>
</listitem>
</itemizedlist>
</entry>
</row><row><entry><para>System administration</para>
</entry><entry><para>For more detailed information about GRUB and for administrative tasks</para>
</entry><entry><para><olink targetdoc="sysadv1" targetptr="hbx86boot-68676" remap="external">Chapter 12, <citetitle remap="chapter">Booting a Solaris System With GRUB (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink></para>
</entry>
</row>
</tbody>
</tgroup>
</table><note><para><emphasis role="strong">Starting with the Solaris Express Developer Edition 5/07 release,</emphasis> see
new GRUB enhancements described at <olink targetptr="gfajo" remap="internal">GRUB Extended
Support for Directly Loading and Booting the UNIX Kernel</olink>.</para>
</note>
</sect2>
</sect1><sect1 id="gavdl" arch="x86"><title>GRUB Based Booting (Planning)</title><para>This section describes the basics of GRUB based booting and describes
the GRUB menu.</para><para>When you install the Solaris OS, two GRUB menu entries are installed
on the system by default. The first entry is the Solaris OS entry. The second
entry is the failsafe boot archive, which is to be used for system recovery.
The Solaris GRUB menu entries are installed and updated automatically as part
of the Solaris software installation and upgrade process. These entries are
directly managed by the OS and should not be manually edited.</para><para>During a standard Solaris OS installation, GRUB is installed on the
Solaris <literal>fdisk</literal> partition without modifying the system BIOS
setting. If the OS is not on the BIOS boot disk, you need to do one of the
following: </para><itemizedlist><listitem><para>Modify the BIOS setting.</para>
</listitem><listitem><para>Use a boot manager to bootstrap to the Solaris partition.
For more details, see your boot manager.  </para>
</listitem>
</itemizedlist><para>The preferred method is to install the Solaris OS on the boot disk.
If multiple operating systems are installed on the machine, you can add entries
to the <filename>menu.lst</filename> file. These entries are then displayed
in the GRUB menu the next time you boot the system.</para><para>For additional information on multiple operating systems, see <olink targetdoc="sysadv1" targetptr="fxjig" remap="external"><citetitle remap="section">How Multiple Operating Systems Are Supported in the GRUB Boot Environment</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para><sect2 id="gavdu" arch="x86"><title>Performing a GRUB Based Installation From
the Network</title><para>Performing a GRUB based network boot requires a DHCP server that is
configured for PXE clients and an install server that provides <filename>tftp</filename> service.
The DHCP server must be able to respond to the DHCP classes, <filename>PXEClient</filename> and <filename>GRUBClient</filename>. The DHCP response must contain the following information:</para><itemizedlist><listitem><para>IP address of the file server</para>
</listitem><listitem><para>Name of the boot file (<filename>pxegrub</filename>)</para>
</listitem>
</itemizedlist><note><para><filename>rpc.bootparamd</filename>, which is usually a requirement
on the server side for performing a network boot, is not required for a GRUB
based network boot.</para>
</note><para>If no PXE or DHCP server is available, you can load GRUB from CD-ROM
or local disk. You can then manually configure the network in GRUB and download
the multiboot program and the boot archive from the file server.</para><para>For more information, see <olink targetdoc="solinstallnet" targetptr="bootdiskette-31" remap="external"><citetitle remap="section">Overview of Booting and Installing Over the Network With PXE</citetitle> in <citetitle remap="book">Solaris Express Installation Guide: Network-Based Installations</citetitle></olink>.</para>
</sect2><sect2 id="gavha"><title>Description of the GRUB Main Menu</title><para>When you boot an x86 based system,
the GRUB menu is displayed. This menu provides a list of boot entries to choose
from. A <emphasis>boot entry</emphasis> is an OS instance that is installed
on your system. The GRUB menu is based on the <filename>menu.lst</filename> file,
which is a configuration file. The <filename>menu.lst</filename> file is created
by the Solaris installation program and can be modified after installation.
The <filename>menu.lst</filename> file dictates the list of OS instances that
are shown in the GRUB menu. </para><itemizedlist><listitem><para>If you install or upgrade the Solaris OS, the GRUB menu is
automatically updated. The Solaris OS is then displayed as a new boot entry. </para>
</listitem><listitem><para>If you install an OS other than the Solaris OS, you must modify
the <filename>menu.lst</filename> configuration file to include the new OS
instance. Adding the new OS instance enables the new boot entry to appear
in the GRUB menu the next time that you boot the system. </para>
</listitem>
</itemizedlist><example id="gavhg"><title>GRUB Main Menu</title><para>In the following example, the GRUB main menu shows the Solaris and Microsoft
Windows operating systems.  A Solaris Live Upgrade boot environment is also
listed that is named <literal>second_disk</literal>. See the following for
descriptions of each menu item.</para><screen>GNU GRUB version 0.95 (616K lower / 4127168K upper memory)
+-------------------------------------------------------------------+
|Solaris                                                            |
|Solaris failsafe                                                   |
|second_disk                                                        |
|second_disk failsafe                                               |
|Windows                                                            |
+-------------------------------------------------------------------+
Use the ^ and v keys to select which entry is highlighted. Press
enter to boot the selected OS, 'e' to edit the commands before
booting, or 'c' for a command-line.</screen><variablelist><varlistentry><term>Solaris</term><listitem><para>Specifies the Solaris OS. </para>
</listitem>
</varlistentry><varlistentry><term>Solaris failsafe</term><listitem><para>Specifies a boot archive that can be used for recovery if
the Solaris OS is damaged.</para>
</listitem>
</varlistentry><varlistentry><term>second_disk</term><listitem><para>Specifies a Solaris Live Upgrade boot environment. The <literal>second_disk</literal> boot environment was created as a copy of the Solaris OS. It was
upgraded and activated with the <command>luactivate</command> command. The
boot environment is available for booting.</para>
</listitem>
</varlistentry><varlistentry><term>Windows</term><listitem><para>Specifies the Microsoft Windows OS.  GRUB detects these partitions
but does not verify that the OS can be booted.</para>
</listitem>
</varlistentry>
</variablelist>
</example><sect3 id="gavhe"><title>Description of GRUB <filename>menu.lst</filename> File</title><para>The GRUB <filename>menu.lst</filename> file lists the contents of the
GRUB main menu. The GRUB main menu lists boot entries for all the OS instances
that are installed on your system, including Solaris Live Upgrade boot environments.
The Solaris software upgrade process preserves any changes that you make to
this file.</para><para>Any revisions made to the <filename>menu.lst</filename> file are displayed
on the GRUB main menu, along with the Solaris Live Upgrade entries. Any changes
that you make to the file become effective at the next system reboot. You
can revise this file for the following reasons:</para><itemizedlist><listitem><para>To add to the GRUB menu entries for operating systems other
than Solaris</para>
</listitem><listitem><para>To customize booting behavior such as specifying the default
OS on the GRUB menu</para>
</listitem>
</itemizedlist><caution><para>Do not use the GRUB <filename>menu.lst</filename> file to modify
Solaris Live Upgrade entries. Modifications could cause Solaris Live Upgrade
to fail.</para>
</caution><para>Although you can use the <filename>menu.lst</filename> file to customize
booting behavior such as booting with the kernel debugger, the preferred method
for customization is to use the <command>eeprom</command> command. If you
use the <filename>menu.lst</filename> file to customize, the Solaris OS entries
might be modified during a software upgrade. Changes to the file would then
be lost.</para><para>For information about how to use the <command>eeprom</command> command,
see <olink targetdoc="sysadv1" targetptr="fwbon" remap="external"><citetitle remap="section">How to Modify Boot Behavior by Using the eeprom Command</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para><example id="gavgn"><title><literal>Menu.lst</literal> File</title><para>Here is a sample of a <filename>menu.lst</filename> file:</para><screen>default 0
timeout 10
title Solaris
  root (hd0,0,a)
  kernel$ /platform/i86pc/kernel/$ISADIR/unix -B console=ttya
  module$ /platform/i86pc/$ISADIR/boot_archive
title Solaris failsafe
  root (hd0,0,a)
  kernel /boot/platform/i86pc/kernel/unix -s -B console=ttya
  module /boot/x86.miniroot-safe
#----- second_disk - ADDED BY LIVE UPGRADE - DO NOT EDIT  -----
title second_disk
  root (hd0,1,a)
  kernel$ /platform/i86pc/kernel/$ISADIR/unix
  module$ /platform/i86pc/$ISADIR/boot_archive
title second_disk failsafe
  root (hd0,1,a)
  kernel /boot/platform/i86pc/kernel/unix -s
  module /boot/x86.miniroot-safe
#----- second_disk -------------- END LIVE UPGRADE ------------
title Windows
  root (hd0,0)
  chainloader -1</screen><variablelist><varlistentry><term><literal>default</literal></term><listitem><para>Specifies which item to boot if the timeout expires. To change
the default, you can specify another item in the list by changing the number.
The count begins with zero for the first title. For example, change the default
to 2 to boot automatically to the <literal>second_disk</literal> boot environment.</para>
</listitem>
</varlistentry><varlistentry><term><literal>timeout</literal></term><listitem><para>Specifies the number of seconds to wait for user input before
booting the default entry. If no timeout is specified, you are required to
choose an entry.</para>
</listitem>
</varlistentry><varlistentry><term><literal>title</literal> <replaceable>OS name</replaceable></term><listitem><para>Specifies the name of the operating system. </para><itemizedlist><listitem><para>If this is a Solaris Live Upgrade boot environment, <replaceable>OS name</replaceable> is the name you gave the new boot environment when it
was created. In the previous example, the Solaris Live Upgrade boot environment
is named <literal>second_disk</literal>.</para>
</listitem><listitem><para>If this is a failsafe boot archive, this boot archive is used
for recovery when the primary OS is damaged. In the previous example, Solaris
failsafe and <literal>second_disk</literal> failsafe are the recovery boot
archives for the Solaris and <literal>second_disk</literal> operating systems.</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry><varlistentry><term><literal>root (hd0,0,a)</literal></term><listitem><para>Specifies on which disk, partition, and slice to load files.
GRUB automatically detects the file system type.</para>
</listitem>
</varlistentry><varlistentry><term><literal>kernel$ /platform/i86pc/kernel/$ISADIR/unix</literal></term><listitem><para>Specifies the boot loader that runs on the
system. GRUB expands the <literal>$ISADIR</literal> keyword to <literal>amd64</literal> on
64-bit hardware. <literal>$ISADIR</literal> becomes a null value on 32-bit
only hardware.</para><para><emphasis role="strong">Starting with the Solaris
Express Developer Edition 5/07 release,</emphasis> see new GRUB enhancements
described at <olink targetptr="gfajo" remap="internal">GRUB Extended Support for Directly Loading
and Booting the UNIX Kernel</olink>.</para>
</listitem>
</varlistentry>
</variablelist><para>For a complete description of multiple operating systems, see <olink targetdoc="sysadv1" targetptr="fxjig" remap="external"><citetitle remap="section">How Multiple Operating Systems Are Supported in the GRUB Boot Environment</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</example><sect4 id="gbdif"><title>Locating the <filename>menu.lst</filename> File to
Change the GRUB Menu</title><para>You must always use the <command>bootadm</command> command to locate
the GRUB menu's <filename>menu.lst</filename> file. The <command>list-menu</command> subcommand
finds the active GRUB menu. The <filename>menu.lst</filename> file 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 on the GRUB
menu.  If you want to make changes to this file, see <olink targetdoc="solinstallupg" targetptr="gbdfr" remap="external"><citetitle remap="section">Locating the GRUB Menu&rsquo;s menu.lst File (Tasks)</citetitle> in <citetitle remap="book">Solaris Express Installation Guide:  Solaris Live Upgrade and Upgrade Planning</citetitle></olink>.</para>
</sect4>
</sect3>
</sect2>
</sect1>
</chapter>