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 2016 Toomas Soome <tsoome@me.com>
/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] key=value
/sbin/bootadm list-menu [-R altroot] [-o key=value]
The bootadm command manages the boot archive and, with x86 boot environments, the boot loader 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 boot 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 boot menu and the current boot menu entries. The location of the boot menu list is /<boot pool root dataset mountpoint>/boot/menu.lst. Use the list-menu subcommand to locate the boot menu. See the EXAMPLES section for typical output from the list-menu option.
Note that OpenBoot PROM (OBP)-based machines, such as SPARC systems, use PROM variables to set boot behavior and are managed by the eeprom(1M) command.
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.
The bootadm command has the following subcommands: update-archive
Updates current boot archive if required. Applies to both SPARC and x86 platforms.
Lists the files and directories to be included in the boot archive. Applies to both SPARC and x86 platforms.
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. To reinstall the boot loader on some or all of the disks, the -f option must be passed to the install-bootloader subcommand to override boot program version checks.
Maintain the menu configuration. The index of menu entries is listed in the menu.lst file, and the actual configuration of the menu entry is located in the boot environment /boot directory. Applies to x86 platforms only.
Lists the location of the menu.lst, as well as the current menu entries. This listing includes the default entry, dataset name, and the title of each entry. Applies to x86 platforms only.
The bootadm command has the following options: -f
In an install-bootloader operation, override the boot loader versioning constraints.
In an update-archive operation, archive content is checked but not updated.
In a list-menu operation, specify the menu entry for detailed inspection. Possible keys are entry and title, taking either entry number or title name as values.
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.
In an update-archive operation, stale files are displayed on stderr. In an install-bootloader operation, display any output from tasks performed.
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.
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.
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).
Possible values are: default=entrynum
The item number (for example, 0, 1, or 2) in the boot menu designating the operating system to boot when the timer expires.
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.
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 Boot Menu Entries and Location of Boot Menu
The following command lists the boot environments and the location of the menu.lst:
# bootadm list-menu the location for the active menu is: /raid/boot/menu.lst Index Default Dataset Menu 0 - raid/ROOT/test-182 test-182 1 - raid/ROOT/test-183 test-183 2 * raid/ROOT/test-184 test-184
Example 4 Switching Default Boot Entry
The following command refers to the menu displayed in the previous example. The user selects test-183 (item 1).
# bootadm set-menu default=1
Example 5 Detailed information about menu entry.
The following command lists more detailed information about a boot menu entry:
# bootadm list-menu -o entry=2 the location for the active menu is: /raid/boot/menu.lst Title: test-184 Timeout: 10 Console: text Bootfs: raid/ROOT/test-184 Kernel: /platform/i86pc/kernel/amd64/unix Boot-args: "-v" Modules: Name: boot_archive Path: /platform/i86pc/${ISADIR}/boot_archive Type: rootfs Status: Load Name: boot_archive.hash Path: /platform/i86pc/${ISADIR}/boot_archive.hash Type: hash Status: Load Name: system Path: /boot/modules/etc/system Type: file Hash: 4f4fe2d2dfae393a2a87ce29e3c71b803938c5fb Flags: name=etc/system Status: Load
The following exit values are returned: 0
The command completed successfully.
The command exited due to an error.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE ATTRIBUTE VALUE |
Interface Stability Committed |
boot(1M), beadm(1M), installboot(1M), attributes(5)