Booting and Shutting Down Oracle® Solaris 11.2 Systems

Exit Print View

Updated: July 2014
 
 

x86: How to Set Attributes for a Specified Boot Entry in the GRUB Menu

Use the change-entry subcommand of the bootadm command to set certain boot attributes for a specified boot entry, or a comma-separated list of entries, in the GRUB menu. The entry is specified by either an entry title or an entry number. If multiple entries have the same title, all of the entries are affected.


Note -  A special property, set-default, sets the default entry to boot from when the timer expires. This subcommand functions the same as the set-menu default=value subcommand. See Example 2–1.

For information about how to set attributes for specific boot entries by editing the GRUB menu at boot time, see Adding Kernel Arguments by Editing the GRUB Menu at Boot Time.

  1. Assume the root role.

    See Using Your Assigned Administrative Rights in Securing Users and Processes in Oracle Solaris 11.2 .

  2. (Optional)List the GRUB menu entries.
    # bootadm list-menu
  3. Set the boot attributes for the specified entry.
    # bootadm change-entry [-P pool] {[entry-title[,entry-title...]}]
    	| -i entry-number[,entry-number]...]} { key=value [ key=value ...]
    	| set-default }

    When specifying a value that includes white space, you must enclose the value in single or double quotation marks.

    For more information about each value that you can specify by using the change-entry subcommand, see the bootadm(1M) man page. Examples of common ways to use the change-entry subcommand follow this procedure.

  4. Verify that the changes have been made to the specified entry.
    # bootadm list-menu

    Note - If you do not see your changes, check the grub.cfg file to verify that the change was made.
Example 2-4  Setting the Title for a Specified Boot Entry in the GRUB Menu

You can set the title for a specified boot entry by using the change-entry subcommand of the bootadm command. When setting the title, you can specify either the entry number or the entry title. The following example shows how to set the title for a specified boot entry both ways. If multiple have the same title, all of the entries are affected.

Set the title for a boot entry by specifying the entry number, as follows:

# bootadm list-menu
The location of the boot loader configuration file is /rpool/boot/grub
default 1
console graphics
timeout 30
0 Oracle Solaris 11/11
1 Oracle Solaris 11.2
2 Oracle Solaris 11_test
# bootadm change-entry -i 2 title="Oracle Solaris 11-backup1"
# bootadm list-menu
The location of the boot loader configuration file is /rpool/boot/grub
default 2
console graphics
timeout 45
0 Oracle Solaris 11/11
1 Oracle Solaris 11.2
2 Oracle Solaris 11-backup1

Set the title for a boot entry by specifying the title, as follows:

# bootadm list-menu
The location of the boot loader configuration file is /rpool/boot/grub
default 1
console graphics
timeout 30
0 Oracle Solaris 11/11
1 Oracle Solaris 11.2
2 Oracle Solaris 11_test
# bootadm change-entry "Oracle Solaris 11_test" title="Oracle Solaris 11-backup1"
# bootadm list-menu
The location of the boot loader configuration file is /rpool/boot/grub
default 2
console graphics
timeout 45
0 Oracle Solaris 11/11
1 Oracle Solaris 11.2
2 Oracle Solaris 11-backup1
Example 2-5  Changing a Boot Entry by Specifying Kernel Arguments

The following examples show how to set kernel boot arguments for a specified boot entry by using the change-entry subcommand of the bootadm command.

In this example, boot entry number 1 is set to boot in single-user mode:

# bootadm list-menu
The location of the boot loader configuration file is /rpool/boot/grub
default 1
console graphics
timeout 30
0 Oracle Solaris 11/11
1 Oracle Solaris 11.2
2 Oracle Solaris 11_test
# bootadm change-entry -i 1 kargs=-s
# bootadm list-menu -i 1
The location of the boot loader configuration files is: /rpool/boot/grub
     title: Oracle Solaris 11.2
     kernel: /platform/i86pc/kernel/$ISADIR/unix
     kernel arguments: -s
     boot archive: /platform/i86pc/$ISADIR/boot_archive
     ZFS root pool: rpool

In this example, multiple kernel arguments are specified for boot entry number 2:

# bootadm change-entry -i 2 kargs="-v -s"
# bootadm list-menu -i 2
The location of the boot loader configuration files is: /rpool/boot/grub
     title: Oracle Solaris 11_test
     kernel: /platform/i86pc/kernel/$ISADIR/unix
     kernel arguments: -v -s
     boot archive: /platform/i86pc/$ISADIR/boot_archive
     bootfs: rpool/ROOT/snv_160-nightly-1

In this example, the –v and –s options were specified, which boots the system to a single-user state in verbose mode.

Any time that you set an attribute (or multiple attributes) that include white space, you must enclose the values in single or double quotation marks.

Example 2-6  Changing a Boot Entry by Using the –B Option to Specify Kernel Arguments

The following examples show some of ways that you can set kernel arguments for a specific boot entry by using the –B option.

You would disable the e1000g network driver and load the kernel debugger at boot time, as follows:

# bootadm change-entry -i 0 kargs="-B disable-e1000g=true -k"

You can specify multiple –B options by using the bootadm change-entry command. For example, you would disable the e1000g driver and ACPI at the same time by using either of the following commands:

# bootadm change-entry -i 0 kargs="-B disable-e1000g=true -B acpi-user-options=2"
# bootadm change-entry -i 0 kargs="-B disable-e1000g=true,acpi-user-options=2"

You can also use the –B option to set certain boot attributes at boot time by editing the specified boot entry. For instructions, see Adding Kernel Arguments by Editing the GRUB Menu at Boot Time.

Example 2-7  Removing Previously Added Kernel Arguments From a Boot Entry

In the following example, a kernel argument (–s) is removed from a specific boot entry:

# bootadm list-menu -i 1
the location of the boot loader configuration files is: /rpool/boot/grub
title: s11.2.backup
kernel: /platform/i86pc/kernel/amd64/unix
kernel arguments: -s
boot archive: /platform/i86pc/amd64/boot_archive
bootfs: rpool/ROOT/s11.2.backup
# bootadm change-entry -i 1 kargs=
# bootadm list-menu -i 1
the location of the boot loader configuration files is: /rpool/boot/grub
title: s11.2.backup
kernel: /platform/i86pc/kernel/amd64/unix
kernel arguments:
boot archive: /platform/i86pc/amd64/boot_archive
bootfs: rpool/ROOT/s11.2.backup