Solaris Express Installation Guide: Planning for Installation and Upgrade

Chapter 6 x86: GRUB Based Booting for Solaris Installation

This chapter describes the GRUB based booting on x86 based systems that relates to Solaris installation. This chapter contains the following sections:

x86: GRUB Based Booting (Overview)

GRUB, the open source boot loader, has been adopted as the default boot loader in the Solaris OS.


Note –

GRUB based booting is not available on SPARC based systems.


The boot loader 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.

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 http://www.gnu.org/software/grub/grub.html.

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:

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.

x86: How GRUB Based Booting Works

After GRUB gains control of the system, a menu is displayed on the console. In the GRUB menu, you can do the following:

A configurable timeout is available to boot the default OS entry. Pressing any key aborts the default OS entry boot.

To view an example of a GRUB menu, see Description of the GRUB Main Menu.

x86: GRUB Device Naming Conventions

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.

The following table describes the GRUB device naming conventions.

Table 6–1 Naming Conventions for GRUB Devices

Device Name 

Description 

(fd0), (fd1)

First diskette, second diskette 

(nd)

Network device 

(hd0,0), (hd0,1)

First and second fdisk partition of first bios disk

(hd0,0,a), (hd0,0,b)

Solaris/BSD slice 0 and 1 on first fdisk partition on the first bios disk


Note –

All GRUB device names must be enclosed in parentheses. Partition numbers are counted from 0 (zero), not from 1.


For more information about fdisk partitions, see Guidelines for Creating an fdisk Partition in System Administration Guide: Devices and File Systems.

x86: Where to Find Information About GRUB Based Installations

For more information about these changes, see the following references.

Table 6–2 Where to Find Information on GRUB Based Installations

Topic 

GRUB Menu Tasks 

For More Information 

Installation 

To install from the Solaris OS CD or DVD media 

Solaris Express Installation Guide: Basic Installations.

To install from a network installation image 

Part II, Installing Over a Local Area Network, in Solaris Express Installation Guide: Network-Based Installations

 

To configure a DHCP server for network installations 

Preconfiguring System Configuration Information With the DHCP Service (Tasks) in Solaris Express Installation Guide: Network-Based Installations

 

To install with the Custom JumpStart program 

Performing a Custom JumpStart Installation in Solaris Express Installation Guide: Custom JumpStart and Advanced Installations

 

To activate or fall back to a boot environment by using Solaris Live Upgrade 

System administration 

For more detailed information about GRUB and for administrative tasks 

Chapter 12, Booting a Solaris System With GRUB (Tasks), in System Administration Guide: Basic Administration


Note –

Starting with the Solaris Express Developer Edition 5/07 release, see new GRUB enhancements described at x86: GRUB Extended Support for Directly Loading and Booting the UNIX Kernel.


x86: GRUB Based Booting (Planning)

This section describes the basics of GRUB based booting and describes the GRUB menu.

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.

During a standard Solaris OS installation, GRUB is installed on the Solaris fdisk 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:

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 menu.lst file. These entries are then displayed in the GRUB menu the next time you boot the system.

For additional information on multiple operating systems, see How Multiple Operating Systems Are Supported in the GRUB Boot Environment in System Administration Guide: Basic Administration.

x86: Performing a GRUB Based Installation From the Network

Performing a GRUB based network boot requires a DHCP server that is configured for PXE clients and an install server that provides tftp service. The DHCP server must be able to respond to the DHCP classes, PXEClient and GRUBClient. The DHCP response must contain the following information:


Note –

rpc.bootparamd, which is usually a requirement on the server side for performing a network boot, is not required for a GRUB based network boot.


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.

For more information, see Overview of Booting and Installing Over the Network With PXE in Solaris Express Installation Guide: Network-Based Installations.

Description of the GRUB Main Menu

When you boot an x86 based system, the GRUB menu is displayed. This menu provides a list of boot entries to choose from. A boot entry is an OS instance that is installed on your system. The GRUB menu is based on the menu.lst file, which is a configuration file. The menu.lst file is created by the Solaris installation program and can be modified after installation. The menu.lst file dictates the list of OS instances that are shown in the GRUB menu.


Example 6–1 GRUB Main Menu

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 second_disk. See the following for descriptions of each menu item.


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.
Solaris

Specifies the Solaris OS.

Solaris failsafe

Specifies a boot archive that can be used for recovery if the Solaris OS is damaged.

second_disk

Specifies a Solaris Live Upgrade boot environment. The second_disk boot environment was created as a copy of the Solaris OS. It was upgraded and activated with the luactivate command. The boot environment is available for booting.

Windows

Specifies the Microsoft Windows OS. GRUB detects these partitions but does not verify that the OS can be booted.


Description of GRUB menu.lst File

The GRUB menu.lst 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.

Any revisions made to the menu.lst 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:


Caution – Caution –

Do not use the GRUB menu.lst file to modify Solaris Live Upgrade entries. Modifications could cause Solaris Live Upgrade to fail.


Although you can use the menu.lst file to customize booting behavior such as booting with the kernel debugger, the preferred method for customization is to use the eeprom command. If you use the menu.lst file to customize, the Solaris OS entries might be modified during a software upgrade. Changes to the file would then be lost.

For information about how to use the eeprom command, see How to Modify Boot Behavior by Using the eeprom Command in System Administration Guide: Basic Administration.


Example 6–2 Menu.lst File

Here is a sample of a menu.lst file:


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
default

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 second_disk boot environment.

timeout

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.

title OS name

Specifies the name of the operating system.

  • If this is a Solaris Live Upgrade boot environment, OS name 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 second_disk.

  • 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 second_disk failsafe are the recovery boot archives for the Solaris and second_disk operating systems.

root (hd0,0,a)

Specifies on which disk, partition, and slice to load files. GRUB automatically detects the file system type.

kernel$ /platform/i86pc/kernel/$ISADIR/unix

Specifies the boot loader that runs on the system. GRUB expands the $ISADIR keyword to amd64 on 64-bit hardware. $ISADIR becomes a null value on 32-bit only hardware.

Starting with the Solaris Express Developer Edition 5/07 release, see new GRUB enhancements described at x86: GRUB Extended Support for Directly Loading and Booting the UNIX Kernel.

For a complete description of multiple operating systems, see How Multiple Operating Systems Are Supported in the GRUB Boot Environment in System Administration Guide: Basic Administration.


Locating the menu.lst File to Change the GRUB Menu

You must always use the bootadm command to locate the GRUB menu's menu.lst file. The list-menu subcommand finds the active GRUB menu. The menu.lst 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 Locating the GRUB Menu’s menu.lst File (Tasks) in Solaris Express Installation Guide: Solaris Live Upgrade and Upgrade Planning.