BOOTADM(8) | Maintenance Commands and Procedures | BOOTADM(8) |
bootadm - manage bootability of the operating system
/sbin/bootadm update-archive [-vnf] [-R altroot [-p platform]]
[-F format]
/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(8) 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
svc:/system/boot-archive:default/config/format
This property takes one of the following values:
cpio
hsfs
ufs
ufs-nocompress
See EXAMPLES for how to change this value.
list-archive
install-bootloader
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.
set-menu
list-menu
The bootadm command has the following options:
-f
In an install-bootloader operation, override the boot loader versioning constraints.
-F format
-n
-o key=value
-p platform
-v
In an install-bootloader operation, display any output from tasks performed.
-M
This option is not supported on non-x86 systems, and it is an error to specify it.
-P pool
-R altroot
Note -
key=value
default=entrynum
timeout=seconds
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 Changing archive format
The following command changes the boot archive format to ufs
# svccfg -s system/boot-archive:default setprop config/format = ufs # svcadm refresh system/boot-archive:default # bootadm update-archive -f
Example 6 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
1
See attributes(7) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
Interface Stability | Committed |
menu.lst(5), attributes(7), beadm(8), boot(8), installboot(8)
March 30, 2023 | OmniOS |