Solaris 10 6/06 Installation Guide: Solaris Live Upgrade and Upgrade Planning

Chapter 5 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 5–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 5–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 10 6/06 Installation Guide: Basic Installations.

To install from a network installation image 

Part II, Installing Over a Local Area Network, in Solaris 10 6/06 Installation Guide: Network-Based Installations

 

To configure a DHCP server for network installations 

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

 

To install with the Custom JumpStart program 

Performing a Custom JumpStart Installation in Solaris 10 6/06 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 11, GRUB Based Booting (Tasks), in System Administration Guide: Basic Administration

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 10 6/06 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 5–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 Set Solaris Boot Parameters by Using the eeprom Command in System Administration Guide: Basic Administration.


Example 5–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/multiboot -B console=ttya
  module /platform/i86pc/boot_archive
title Solaris failsafe
  root (hd0,0,a)
  kernel /boot/multiboot -B console=ttya -s
  module /boot/x86.miniroot.safe
#----- second_disk - ADDED BY LIVE UPGRADE - DO NOT EDIT  -----
title second_disk
  root (hd0,1,a)
  kernel /platform/i86pc/multiboot
  module /platform/i86pc/boot_archive
title second_disk failsafe
  root (hd0,1,a)
  kernel /boot/multiboot 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/multiboot

Specifies the multiboot program. The kernel command must always be followed by the multiboot program. The string after multiboot is passed to the Solaris OS without interpretation.

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 x86: Locating the GRUB Menu's menu.lst File (Tasks).

x86: Locating the GRUB Menu's menu.lst File (Tasks)

The GRUB menu can be updated. For example, you might want to change the default time for how fast the default OS is booted. Or, you might want to add another OS to the GRUB menu.

Typically, the active GRUB menu's menu.lst file is located at /boot/grub/menu.lst. In some situations, the GRUB menu.lst file resides elsewhere. For example, in a system that uses Solaris Live Upgrade, the GRUB menu.lst file might be on a boot environment that is not the currently running boot environment. Or if you have upgraded a system with an x86 boot partition, the menu.lst file might reside in the /stubboot directory. Only the active GRUB menu.lst file is used to boot the system. In order to modify the GRUB menu that is displayed when you boot the system, the active GRUB menu.lst file must be modified. Changing any other GRUB menu.lst file has no effect on the menu that is displayed when you boot the system. To determine the location of the active GRUB menu.lst file, use the bootadm command. The list-menu subcommand displays the location of the active GRUB menu. The following procedures determine the location of the GRUB menu's menu.lst file.

For more information about the bootadm command, see bootadm(1M) man page.

ProcedureLocating the GRUB Menu's menu.lst file

In the following procedure, the system contains two operating systems: Solaris and a Solaris Live Upgrade boot environment, second_disk. The Solaris OS has been booted and contains the GRUB menu.

Steps
  1. Become superuser or assume an equivalent role.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. To locate the menu.lst file, type:


    # /sbin/bootadm list-menu
    

    The location and contents of the file are displayed.


    The location for the active GRUB menu is: /boot/grub/menu.lst
    default 0
    timeout 10
    0 Solaris
    1 Solaris failsafe
    2 second_disk
    3 second_disk failsafe

ProcedureLocating the GRUB Menu's menu.lst File When the active menu.lst file is in Another Boot Environment

In the following procedure, the system contains two operating systems: Solaris and a Solaris Live Upgrade boot environment, second_disk. In this example, the menu.lst file does not exist in the currently running boot environment. The second_disk boot environment has been booted. The Solaris boot environment contains the GRUB menu. The Solaris boot environment is not mounted.

Steps
  1. Become superuser or assume an equivalent role.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. To locate the menu.lst file, type:


    # /sbin/bootadm list-menu
    

    The location and contents of the file are displayed.


    The location for the active GRUB menu is: /dev/dsk/device_name(not mounted)
    The filesystem type of the menu device is <ufs>
    default 0
    timeout 10
    0 Solaris
    1 Solaris failsafe
    2 second_disk
    3 second_disk failsafe
  3. Because the file system containing the menu.lst file is not mounted, mount the file system. Specify the UFS file system and the device name.


    # /usr/sbin/mount -F ufs /dev/dsk/device_name /mnt
    

    Where device_name specifies the location of the root (/) file system on the disk device of the boot environment that you want to mount. The device name is entered in the form of /dev/dsk/cwtxdysz. For example:


    # /usr/sbin/mount -F ufs /dev/dsk/c0t1d0s0 /mnt
    

    You can access the GRUB menu at /mnt/boot/grub/menu.lst

  4. Unmount the filesystem


    # /usr/sbin/umount /mnt
    

    Note –

    If you mount a boot environment or a file system of a boot environment, ensure that the file system or file systems are unmounted after use. If these file systems are not unmounted, future Solaris Live Upgrade operations on that boot environment might fail.


ProcedureLocating the GRUB Menu's menu.lst File When a Solaris Live Upgrade Boot Environment is Mounted

In the following procedure, the system contains two operating systems: Solaris and a Solaris Live Upgrade boot environment, second_disk. The second_disk boot environment has been booted. The Solaris boot environment contains the GRUB menu. The Solaris boot environment is mounted at /.alt.Solaris.

Steps
  1. Become superuser or assume an equivalent role.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. To locate the menu.lst file, type:


    # /sbin/bootadm list-menu
    

    The location and contents of the file are displayed.


    The location for the active GRUB menu is:
    /.alt.Solaris/boot/grub/menu.lst
    default 0
    timeout 10
    0 Solaris
    1 Solaris failsafe
    2 second_disk
    3 second_disk failsafe

    Since the boot environment containing the GRUB menu is already mounted, then you can access the menu.lst file at /.alt.Solaris/boot/grub/menu.lst.

ProcedureLocating the GRUB Menu's menu.lst File When Your System Has an x86 Boot Partition

In the following procedure, the system contains two operating systems: Solaris and a Solaris Live Upgrade boot environment, second_disk. The second_disk boot environment has been booted. Your system has been upgraded and an x86 boot partition remains. The boot partition is mounted at /stubboot and contains the GRUB menu. For an explanation of x86 boot partitions, see x86: Partitioning Recommendations.

Steps
  1. Become superuser or assume an equivalent role.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. To locate the menu.lst file, type:


    # /sbin/bootadm list-menu
    

    The location and contents of the file are displayed.


    The location for the active GRUB menu is:
    /stubboot/boot/grub/menu.lst
    default 0
    timeout 10
    0 Solaris
    1 Solaris failsafe
    2 second_disk
    3 second_disk failsafe

    You can access the menu.lst file at /stubboot/boot/grub/menu.lst.