System Administration Guide: Basic Administration

Procedurex86: How to Modify Boot Behavior by Editing the menu.lst File

You might need to modify the menu.lst file for one of the following reasons:

Before You Begin

Because only the active GRUB menu.lst file is used to boot the system, make sure you edit the correct file. Changing any other GRUB menu.lst file has no effect on the menu that is displayed when you boot the system.

The location of the active menu.lst file varies, depending on whether you have a system with a UFS root or a ZFS root.

You can determine the location of the active GRUB menu.lst file by using the bootadm command with the list-menu subcommand.


# bootadm list-menu

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

  1. Become superuser or assume an equivalent role.

  2. To add a new OS entry to the active menu.lst file, use a text editor to modify the file.

    The comments within the menu.lst file provide you with the necessary information for adding a new OS entry.

    The following is an example of a menu.lst file on a system that is running a Solaris release with ZFS boot support. Boot entries in the menu.lst file vary, depending on the Solaris release you are running.


    #---------- ADDED BY BOOTADM - DO NOT EDIT ----------
    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
    #---------------------END BOOTADM--------------------

    Caution – Caution –

    Do not directly edit the original contents of the menu.lst file. To make changes to any of the OS entries in the file, edit the file manually, duplicating the existing content. Then, make the modifications to the duplicated content.

    Also note when manually adding new user entries to the file, do not include guard comments that are reserved for use by the system, such as “Added by bootadm” or “Added by Live Upgrade”. Not using these comments for manually-added entries ensures that these entries remain intact during a software upgrade.


    • To specify a 32-bit Solaris kernel as the default kernel to boot, remove all instances of the $ISADIR keyword from the menu.lst file.


      title Solaris Nevada snv_53 X86
      kernel$ /platform/i86pc/kernel/unix [*]
      module$ /platform/i86pc/boot_archive

      To specify a 32-bit kernel as the boot method, you must also change the line that begins with the kernel keyword in the Solaris failsafe entry:


      title Solaris failsafe
      kernel /boot/platform/i86pc/kernel/unix [-B *] -s [*]
      module /boot/x86.miniroot-safe

    If you have added any additional entries, beyond the default entries, make equivalent changes manually.

    The [-B *] and [*] flags must be preserved, if these flags exist in the original menu.lst file. Also, the failsafe entry should always have an -s flag.

  3. After adding the required information, save the file.

    Note that any changes you make to the file take effect at the next system reboot.


    Tip –

    If you are running the Linux OS, and install the Solaris OS, the Linux OS entry is not displayed in the GRUB menu when the system is rebooted. Before installing the Solaris software, save a copy of the menu.lst file that contains the Linux information. After the installation, add the Linux information back to the newly-created menu.lst file in the Solaris partition.


    Because changes you make to the menu.lst file are not directly related to the Solaris OS, you cannot make them by using the eeprom command. You must edit the file directly. Note that the Solaris software upgrade process preserves any changes that you make to the menu.lst file.


    Caution – Caution –

    Solaris GRUB is capable of booting both the Linux OS and the Solaris OS. However, Linux GRUB is not capable of booting the Solaris OS.

    Always ensure that one of the following conditions are met:

    • The Solaris fdisk partition is active, that it has GRUB installed , and that the menu.lst file is the active GRUB menu

    • That Solaris GRUB is installed to the Master Boot Record (MBR) and that it refers to a menu.lst in the Solaris fdisk partition.


    For a detailed description of the GRUB menu.lst that pertains to each Solaris release, see x86: Supported GRUB Implementations.


Example 11–6 menu.lst File on a System With a ZFS Boot Loader

The following examples show what a menu.lst file looks like on a system that has a ZFS boot loader. By default, this system will boot from a ZFS root file system. Note that the contents of the file varies, depending on the installation type.

New installation or standard upgrade:


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 -B console=ttyb
module /boot/x86.miniroot-safe

Solaris Live Upgrade:


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


Example 11–7 menu.lst File on a System With a UFS Boot Loader

The following examples show what a menu.lst file looks like on a system that has a UFS root file system installed. By default, this system will boot from a UFS root file system.

New installation or standard upgrade:


title Solaris 11 s10x_90 X86
findroot (rootfs0,0,a)
kernel$ /platform/i86pc/kernel/$ISADIR/unix
module$ /platform/i86pc/$ISADIR/boot_archive

title Solaris 11 failsafe
findroot (rootfs0,0,a)
kernel /boot/platform/i86pc/kernel/unix -s -B console=ttyb
module /boot/x86.miniroot-safe

Solaris Live Upgrade:


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


Example 11–8 x86: menu.lst File With Hypervisor Support

The following examples are for a GRUB implementation that supports booting the Solaris OS as a dom0, with hypervisor support.

In this example, the menu.lst file has been modified to enable a 64-bit capable system to boot the Solaris OS as a dom0, in 32-bit mode. This modification includes removing all instances of $ISADIR from the file.


title 32-bit Solaris on xVM
kernel$ /boot/xen.gz
module$ /platform/i86xpv/kernel/unix /platform/i86xpv/kernel/unix -B $ZFS-BOOTFS [*]
module$ /platform/i86pc/boot_archive

In this example, the menu.lst file has been modified to direct the hypervisor to use the serial console. Note that the serial console is also shared by the Solaris OS dom0 console.


title Solaris on xVM
kernel$ /boot/$ISADIR/xen.gz console=com1 com1=9600,8n1
module$ /platform/i86xpv/kernel/$ISADIR/unix /platform/i86xpv/kernel/$ISADIR/unix \
-B $ZFS-BOOTFS console=hypervisor
module$ /platform/i86pc/$ISADIR/boot_archive