2 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved
3 .\" 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.
4 .\" 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.
5 .\" 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]
6 .\" Copyright (c) 2015 Toomas Soome <tsoome@me.com>
7 .TH BOOTADM 1M "Jul 26, 2015"
9 bootadm \- manage bootability of GRUB-enabled operating system
13 \fB/sbin/bootadm\fR update-archive [\fB-vn\fR] [\fB-R\fR \fIaltroot\fR [\fB-p\fR \fIplatform\fR]]
18 \fB/sbin/bootadm\fR list-archive [\fB-vn\fR] [\fB-R\fR \fIaltroot\fR [\fB-p\fR \fIplatform\fR]]
23 \fB/sbin/bootadm\fR install-bootloader [\fB-Mfv\fR] [\fB-R\fR \fIaltroot\fR] [\fB-P\fR \fIpool\fR]
33 \fB/sbin/bootadm\fR set-menu [\fB-R\fR \fIaltroot\fR] \fIkey\fR=\fIvalue\fR
38 \fB/sbin/bootadm\fR list-menu [\fB-R\fR \fIaltroot\fR]
43 The \fBbootadm\fR command manages the boot archive and, with x86 boot
44 environments, the GRUB (GRand Unified Bootloader) menu. The
45 \fBupdate-archive\fR option provides a way for user to update the boot archive
46 as a preventative measure or as part of a recovery procedure. The
47 \fBset-menu\fR subcommand allows you to switch the \fBauto-boot\fR timeout and
48 default boot entry in the GRUB menu.
51 The \fBinstall-bootloader\fR subcommand installs the system boot loader on a
52 ZFS pool. If ZFS pool was not specified with the \fB-P\fR option, then the boot
53 loader is installed on the ZFS pool that the system booted from. If the
54 system did not boot from a ZFS pool (for example, it booted an installer via PXE
55 or CD-ROM) then the \fB-P\fR option is required.
57 This subcommand can be used to install, update, and repair the boot loader on a
58 ZFS pool intended for booting. When disks in the ZFS pool used for booting the
59 system have been replaced, one should run \fBbootadm install-bootloader\fR to
60 ensure that all disks in that pool have the system boot loader installed.
63 The \fBlist-menu\fR subcommand displays the location of the GRUB menu and the
64 current GRUB menu entries. While the typical location of the GRUB menu is
65 \fB/boot/grub/menu.lst\fR, depending on the install method used the active GRUB
66 menu might be located somewhere else. Use the \fBlist-menu\fR subcommand to
67 locate the active GRUB menu. See the EXAMPLES section for typical output from
68 the \fBlist-menu\fR option.
71 Note that OpenBoot PROM (OBP)-based machines, such as SPARC systems, do not use
72 GRUB and have no boot menu manageable by \fBbootadm\fR.
75 The \fBbootadm\fR command determines dynamically the options supported by the
76 image to be managed, so that \fBbootadm\fR invoked on one platform can be used
77 to manage diskless clients of a different platform type.
80 The \fBbootadm\fR command has the following subcommands:
84 \fB\fBupdate-archive\fR\fR
88 Updates current boot archive if required. Applies to both SPARC and x86
95 \fB\fBlist-archive\fR\fR
99 Lists the files and directories to be included in the boot archive. Applies to
100 both SPARC and x86 platforms.
106 \fB\fBinstall-bootloader\fR\fR
110 Applies platform specific method to install the system boot loader to the disks
111 that are part of the selected ZFS pool (either specified with \fB-P\fR or
114 On SPARC, the boot loader is installed in the boot area of the disk partition
115 used by the ZFS pool.
117 On x86, disks are formatted using either \fBMBR Partitioning\fR (Master Boot
118 Record) or using \fBGPT Partitioning\fR (GUID Partition Tables). The first
119 sector on the disk that is used by the \fBBIOS\fR to find a boot loader
120 is referred to as the \fBMBR\fR (Master Boot Record) and is always used
121 regardless of the partition scheme.
123 On x86, disks in a ZFS pool may be a combination of either type of partitioning
124 scheme. If an entire disk was added to a ZFS pool (e.g. c0t0d0), then it was
125 formatted with \fBGPT\fR partitioning and the fact is recorded. The
126 \fBinstall-bootloader\fR subcommand will always update the system boot loader on
127 the disks. However, unless the entire disk was given a ZFS pool or the \fB-M\fR
128 option is specified, the \fBMBR\fR of the disk will not updated, as the system
129 cannot guarantee that the \fBMBR\fR belongs to it. If, for example, the system
130 was being dual booted, a different initial boot loader may be installed there.
132 When \fBGRUB\fR is being used as the system boot loader (currently on x86), to
133 reinstall the boot loader on some or all of the disks, the \fB-f\fR option must
134 be passed to the \fBinstall-bootloader\fR subcommand.
144 Maintain the GRUB menu. The current GRUB menu is \fBboot/grub/menu.lst\fR,
145 relative to root. Do not depend on this location, because it is subject to
146 change. Applies to x86 platforms only.
152 \fB\fBlist-menu\fR\fR
156 Lists the location of the active GRUB menu, as well as the current GRUB menu
157 entries. This includes the autoboot-timeout, the default entry number, and the
158 title of each entry. Applies to x86 platforms only.
163 The \fBbootadm\fR command has the following options:
171 In an \fBinstall-bootloader\fR operation, override boot loader versioning
182 In an \fBupdate-archive\fR operation, archive content is checked but not
189 \fB\fB-p\fR \fIplatform\fR\fR
193 The platform, or machine hardware class, of the client. The platform type can
194 only be specified together with \fB-R\fR, and is generally useful only for
195 managing a diskless client where the client is of a different platform class
196 than the server. Platform must be one of \fBi86pc\fR, \fBsun4u\fR, or
207 In an \fBupdate-archive\fR operation, stale files are displayed on stderr.
209 In an \fBinstall-bootloader\fR operation, display any output from tasks
220 On x86 systems, in an \fBinstall-bootloader\fR operation, additionally installs
221 the system boot loader to the \fBMBR\fR (master boot record). For more
222 information, see the discussion of \fBinstall-bootloader\fR in the
223 \fBSUBCOMMANDS\fR section.
225 This option is not supported on non-x86 systems, and it is an error to specify
236 In an \fBinstall-bootloader\fR operation, the boot loader is installed on
237 the disks in the ZFS pool \fIpool\fR. If the \fB-P\fR option is not specified,
238 then the boot loader is installed on the ZFS pool that the system booted from.
239 If the system did not boot from a ZFS pool then the \fB-P\fR option is required.
245 \fB\fB-R\fR\ \fIaltroot\fR\fR
249 Operation is applied to an alternate root path. In an \fBinstall-bootloader\fR
250 operation, the boot loader is still installed on the specified pool; however,
251 the boot loader itself will come from the alternate root.
256 The root file system of any non-global zones must not be referenced with the
257 \fB-R\fR option. Doing so might damage the global zone's file system, might
258 compromise the security of the global zone, and might damage the non-global
259 zone's file system. See \fBzones\fR(5).
266 \fB\fIkey\fR=\fIvalue\fR\fR
274 \fB\fBdefault=\fR\fIentrynum\fR\fR
278 The item number (for example, 0, 1, or 2) in the GRUB menu designating the
279 operating system to boot when the timer expires.
285 \fB\fBtimeout=\fR\fIseconds\fR\fR
289 The number of seconds before the operating system designated by the default
290 item number is booted. If the value is -1, auto boot is disabled.
297 \fBExample 1 \fRUpdating the Current Boot Archive
300 The following command updates the current boot archive:
305 # bootadm update-archive
310 \fBExample 2 \fRUpdating the Boot Archive on an Alternate Root
313 The following command updates the boot archive on an alternate root:
318 # bootadm update-archive -R /a
323 \fBExample 3 \fRListing Installed OS Instances
326 The following command lists the installed operating system instances in a GRUB
337 (1) Solaris10 Failsafe
343 \fBExample 4 \fRSwitching Default Boot Entry
346 The following command refers to the menu displayed in the previous example. The
347 user selects Linux (item 2).
352 # bootadm set-menu default=2
357 \fBExample 5 \fRListing GRUB Menu Entries and Location of GRUB Menu
360 The following command lists the GRUB menu entries and the location of the GRUB
367 The location for the active GRUB menu is: /stubboot/boot/grub/menu.lst
377 \fBExample 6 \fRDisplaying Location of GRUB Menu
380 The following command displays the location of the GRUB menu:
386 The location for the active GRUB menu is: /dev/dsk/c0t1d0s0 (not mounted)
387 The filesystem type of the menu device is <ufs>
399 In this example, the active GRUB menu is located on a device which is \fBnot\fR
400 mounted. To access the GRUB menu, mount the device and access the GRUB menu at
401 \fB\fI<mountpoint>\fR/boot/grub/menu.lst\fR.
405 The following exit values are returned:
413 The command completed successfully.
423 The command exited due to an error.
428 See \fBattributes\fR(5) for descriptions of the following attributes:
436 ATTRIBUTE TYPE ATTRIBUTE VALUE
438 Interface Stability Committed
443 \fBboot\fR(1M), \fBbeadm\fR(1M), \fBinstallgrub\fR(1M), \fBinstallboot\fR(1M),
447 Consult the GRUB home page, under: