bootadm.1m revision c7c0ceafd167e558cd8cb8195b8bd63cbc817b27
te
Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
Copyright (c) 2015 Toomas Soome <tsoome@me.com>
BOOTADM 1M "Jul 26, 2015"
NAME
bootadm - manage bootability of GRUB-enabled operating system
SYNOPSIS

/sbin/bootadm update-archive [-vn] [-R altroot [-p platform]]

/sbin/bootadm list-archive [-vn] [-R altroot [-p platform]]

/sbin/bootadm install-bootloader [-Mfv] [-R altroot] [-P pool]

 x86 only

/sbin/bootadm set-menu [-R altroot [-p platform]] key=value

/sbin/bootadm list-menu [-R altroot [-p platform]]
DESCRIPTION

The bootadm command manages the boot archive and, with x86 boot environments, the GRUB (GRand Unified Bootloader) menu. The update-archive option provides a way for user to update the boot archive as a preventative measure or as part of a recovery procedure. The set-menu subcommand allows you to switch the auto-boot timeout and default boot entry in the GRUB menu.

The install-bootloader subcommand installs the system boot loader on a ZFS pool. If ZFS pool was not specified with the -P option, then the boot loader is installed on the ZFS pool that the system booted from. If the system did not boot from a ZFS pool (for example, it booted an installer via PXE or CD-ROM) then the -P option is required. This subcommand can be used to install, update, and repair the boot loader on a ZFS pool intended for booting. When disks in the ZFS pool used for booting the system have been replaced, one should run bootadm install-bootloader to ensure that all disks in that pool have the system boot loader installed.

The list-menu subcommand displays the location of the GRUB menu and the current GRUB menu entries. While the typical location of the GRUB menu is /boot/grub/menu.lst, depending on the install method used the active GRUB menu might be located somewhere else. Use the list-menu subcommand to locate the active GRUB menu. See the EXAMPLES section for typical output from the list-menu option.

Note that OpenBoot PROM (OBP)-based machines, such as SPARC systems, do not use GRUB and have no boot menu manageable by bootadm.

The bootadm command determines dynamically the options supported by the image to be managed, so that bootadm invoked on one platform can be used to manage diskless clients of a different platform type.

SUBCOMMANDS

The bootadm command has the following subcommands: update-archive

Updates current boot archive if required. Applies to both SPARC and x86 platforms.

list-archive

Lists the files and directories to be included in the boot archive. Applies to both SPARC and x86 platforms.

install-bootloader

Applies platform specific method to install the system boot loader to the disks that are part of the selected ZFS pool (either specified with -P or the default). On SPARC, the boot loader is installed in the boot area of the disk partition used by the ZFS pool. On x86, disks are formatted using either MBR Partitioning (Master Boot Record) or using GPT Partitioning (GUID Partition Tables). The first sector on the disk that is used by the BIOS to find a boot loader is referred to as the MBR (Master Boot Record) and is always used regardless of the partition scheme. On x86, disks in a ZFS pool may be a combination of either type of partitioning scheme. If an entire disk was added to a ZFS pool (e.g. c0t0d0), then it was formatted with GPT partitioning and the fact is recorded. The install-bootloader subcommand will always update the system boot loader on the disks. However, unless the entire disk was given a ZFS pool or the -M option is specified, the MBR of the disk will not updated, as the system cannot guarantee that the MBR belongs to it. If, for example, the system was being dual booted, a different initial boot loader may be installed there. When GRUB is being used as the system boot loader (currently on x86), to reinstall the boot loader on some or all of the disks, the -f option must be passed to the install-bootloader subcommand.

set-menu

Maintain the GRUB menu. The current GRUB menu is boot/grub/menu.lst, relative to root. Do not depend on this location, because it is subject to change. Applies to x86 platforms only.

list-menu

Lists the location of the active GRUB menu, as well as the current GRUB menu entries. This includes the autoboot-timeout, the default entry number, and the title of each entry. Applies to x86 platforms only.

OPTIONS

The bootadm command has the following options: -f

In an install-bootloader operation, override boot loader versioning constraints.

-n

In an update-archive operation, archive content is checked but not updated.

-p platform

The platform, or machine hardware class, of the client. The platform type can only be specified together with -R, and is generally useful only for managing a diskless client where the client is of a different platform class than the server. Platform must be one of i86pc, sun4u, or sun4v.

-v

In an update-archive operation, stale files are displayed on stderr. In an install-bootloader operation, display any output from tasks performed.

-M

On x86 systems, in an install-bootloader operation, additionally installs the system boot loader to the MBR (master boot record). For more information, see the discussion of install-bootloader in the SUBCOMMANDS section. This option is not supported on non-x86 systems, and it is an error to specify it.

-P pool

In an install-bootloader operation, the boot loader is installed on the disks in the ZFS pool pool. If the -P option is not specified, then the boot loader is installed on the ZFS pool that the system booted from. If the system did not boot from a ZFS pool then the -P option is required.

-R altroot

Operation is applied to an alternate root path. In an install-bootloader operation, the boot loader is still installed on the specified pool; however, the boot loader itself will come from the alternate root.

Note -

The root file system of any non-global zones must not be referenced with the -R option. Doing so might damage the global zone's file system, might compromise the security of the global zone, and might damage the non-global zone's file system. See zones(5).

key=value

Possible values are: default=entrynum

The item number (for example, 0, 1, or 2) in the GRUB menu designating the operating system to boot when the timer expires.

timeout=seconds

The number of seconds before the operating system designated by the default item number is booted. If the value is -1, auto boot is disabled.

EXAMPLES

Example 1 Updating the Current Boot Archive

The following command updates the current boot archive:

# bootadm update-archive

Example 2 Updating the Boot Archive on an Alternate Root

The following command updates the boot archive on an alternate root:

# bootadm update-archive -R /a

Example 3 Listing Installed OS Instances

The following command lists the installed operating system instances in a GRUB menu:

# bootadm list-menu

default=0
timeout=10
(0) Solaris10
(1) Solaris10 Failsafe
(2) Linux

Example 4 Switching Default Boot Entry

The following command refers to the menu displayed in the previous example. The user selects Linux (item 2).

# bootadm set-menu default=2

Example 5 Listing GRUB Menu Entries and Location of GRUB Menu

The following command lists the GRUB menu entries and the location of the GRUB menu:

# bootadm list-menu
The location for the active GRUB menu is: /stubboot/boot/grub/menu.lst
default 0
timeout 10
0 Solaris10
1 Solaris10 failsafe
2 Linux

Example 6 Displaying Location of GRUB Menu

The following command displays the location of the GRUB menu:

# bootadm list-menu
The location for the active GRUB menu is: /dev/dsk/c0t1d0s0 (not mounted)
The filesystem type of the menu device is <ufs>
default 2
timeout 10
0 c0t1d0s3
1 c0t1d0s3 failsafe
2 Solaris10
3 Solaris10 failsafe

In this example, the active GRUB menu is located on a device which is not mounted. To access the GRUB menu, mount the device and access the GRUB menu at <mountpoint>/boot/grub/menu.lst.

EXIT STATUS

The following exit values are returned: 0

The command completed successfully.

1

The command exited due to an error.

ATTRIBUTES

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE ATTRIBUTE VALUE
Interface Stability Committed
SEE ALSO

boot(1M), beadm(1M), installgrub(1M), installboot(1M), attributes(5)

Consult the GRUB home page, under:

http://www.gnu.org/