xref: /illumos-gate/usr/src/man/man8/installboot.8 (revision bbf21555)
10c946d80SToomas Soome.\"
20c946d80SToomas Soome.\" This file and its contents are supplied under the terms of the
30c946d80SToomas Soome.\" Common Development and Distribution License ("CDDL"), version 1.0.
40c946d80SToomas Soome.\" You may only use this file in accordance with the terms of version
50c946d80SToomas Soome.\" 1.0 of the CDDL.
60c946d80SToomas Soome.\"
70c946d80SToomas Soome.\" A full copy of the text of the CDDL should have accompanied this
80c946d80SToomas Soome.\" source.  A copy of the CDDL is also available via the Internet at
90c946d80SToomas Soome.\" http://www.illumos.org/license/CDDL.
100c946d80SToomas Soome.\"
110c946d80SToomas Soome.\"
12afc6b57aSToomas Soome.\" Copyright 2021 Toomas Soome <tsoome@me.com>
130c946d80SToomas Soome.\"
14afc6b57aSToomas Soome.Dd Oct 16, 2021
15*bbf21555SRichard Lowe.Dt INSTALLBOOT 8
160c946d80SToomas Soome.Os
170c946d80SToomas Soome.Sh NAME
180c946d80SToomas Soome.Nm installboot
190c946d80SToomas Soome.Nd install bootloader in a disk partition
200c946d80SToomas Soome.Sh SYNOPSIS
210c946d80SToomas Soome.Ss SPARC
220c946d80SToomas Soome.Nm
230c946d80SToomas Soome.Op Fl fn
240c946d80SToomas Soome.Op Fl F Sy zfs Ns | Ns Sy ufs Ns | Ns Sy hsfs
250c946d80SToomas Soome.Op Fl u Ar verstr
260c946d80SToomas Soome.Ar bootblk raw-device
270c946d80SToomas Soome.Nm
280c946d80SToomas Soome.Op Fl enV
290c946d80SToomas Soome.Fl F Sy zfs
300c946d80SToomas Soome.Fl i
31b6dfa2aeSToomas Soome.Ar raw-device | Ar file
320c946d80SToomas Soome.Nm
330c946d80SToomas Soome.Op Fl n
340c946d80SToomas Soome.Fl F Sy zfs
350c946d80SToomas Soome.Fl M
360c946d80SToomas Soome.Ar raw-device attach-raw-device
370c946d80SToomas Soome.Ss x86
380c946d80SToomas Soome.Nm
390c946d80SToomas Soome.Op Fl fFmn
40d7802caeSToomas Soome.Op Fl b Ar boot_dir
410c946d80SToomas Soome.Op Fl u Ar verstr
42d7802caeSToomas Soome.Op Ar stage1 stage2
43d7802caeSToomas Soomeraw-device
440c946d80SToomas Soome.Nm
450c946d80SToomas Soome.Op Fl enV
460c946d80SToomas Soome.Fl i
47b6dfa2aeSToomas Soome.Ar raw-device | Ar file
480c946d80SToomas Soome.Nm
490c946d80SToomas Soome.Op Fl n
500c946d80SToomas Soome.Fl M
510c946d80SToomas Soome.Ar raw-device attach-raw-device
520c946d80SToomas Soome.Sh DESCRIPTION
530c946d80SToomas SoomeThe
54*bbf21555SRichard Lowe.Xr boot 8
550c946d80SToomas Soomeboot program is loaded from disk and is responsible of loading kernel and its
560c946d80SToomas Soomesupport files from specific file system.
570c946d80SToomas Soome.Pp
580c946d80SToomas SoomeThe SPARC systems have one boot loader program file to be installed on the boot
5972d3dbb9SYuri Pankovarea of a disk slice.
6072d3dbb9SYuri PankovAs the SPARC zfs boot loader is too large to fit into boot area at the start of
6172d3dbb9SYuri Pankovthe disk slice,
620c946d80SToomas Soome.Nm
630c946d80SToomas Soomecommand will split the zfs boot loader between disk slice boot area, and zfs
640c946d80SToomas Soomepool boot area.
650c946d80SToomas Soome.Pp
66d7802caeSToomas SoomeThe x86 BIOS systems have boot loader implemented as three stages:
670c946d80SToomas Soome.Bl -tag -width Ds
680c946d80SToomas Soome.It Sy stage1
690c946d80SToomas Soome.Pa /boot/pmbr
700c946d80SToomas Soomeis used as master boot record
710c946d80SToomas Soome.Pq MBR
720c946d80SToomas Soomeand partition boot program.
730c946d80SToomas Soome.It Sy stage2
740c946d80SToomas Soome.Pa /boot/gptzfsboot
7572d3dbb9SYuri Pankovis responsible for loading files from file system.
7672d3dbb9SYuri PankovThe
770c946d80SToomas Soome.Sy stage2
780c946d80SToomas Soomeon x86 systems is always installed to zfs pool boot area, and therefore only zfs
790c946d80SToomas Soomeboot is supported.
800c946d80SToomas Soome.Nm
810c946d80SToomas Soomecommand will record the location of
820c946d80SToomas Soome.Sy stage2
830c946d80SToomas Soometo
840c946d80SToomas Soome.Sy stage1 ,
850c946d80SToomas Soomewhich is always installed at least on partition
860c946d80SToomas Soome.Pq MBR or GPT
870c946d80SToomas Soomeboot area, making it possible to boot via chainload from other boot loaders.
880c946d80SToomas Soome.Pp
890c946d80SToomas SoomeWhen
900c946d80SToomas Soome.Nm
910c946d80SToomas Soomecommand is used with the
920c946d80SToomas Soome.Fl m
930c946d80SToomas Soomeoption,
940c946d80SToomas Soome.Nm
950c946d80SToomas Soomeinstalls the stage1 file on the master boot sector of the disk as well.
960c946d80SToomas Soome.It Sy stage3
979fd53718SToomas Soome.Pa /boot/loader
980c946d80SToomas Soomeis read from file system and executed by
990c946d80SToomas Soome.Sy stage2
1000c946d80SToomas Soomeand will provide boot loader user environment and is responsible of loading
1010c946d80SToomas Soomeand starting the operating system kernel.
1020c946d80SToomas Soome.Pp
1030c946d80SToomas SoomeIn case of GPT partitioning scheme, if the file system to boot from is either
1040c946d80SToomas SoomeUFS or PCFS, there must be
1050c946d80SToomas Soome.Sy boot
10672d3dbb9SYuri Pankovpartition defined to store stage2 boot program.
10772d3dbb9SYuri PankovThis is needed because UFS and PCFS do not have sufficient space reserved to
10872d3dbb9SYuri Pankovstore boot programs.
1090c946d80SToomas Soome.Pp
1100c946d80SToomas SoomeThe boot partition must use following GPT UUID:
1110c946d80SToomas Soome.Bd -literal -offset indent
1120c946d80SToomas Soome6a82cb45-1dd2-11b2-99a6-080020736631
1130c946d80SToomas Soome.Ed
1140c946d80SToomas Soome.Pp
1150c946d80SToomas Soomewhich is provided by
1160c946d80SToomas Soome.Qq boot
1170c946d80SToomas Soometag in
118*bbf21555SRichard Lowe.Xr format 8
1190c946d80SToomas Soomepartition menu.
1200c946d80SToomas Soome.El
121d7802caeSToomas Soome.Pp
122d7802caeSToomas SoomeThe x86 UEFI systems load and start boot loader program from
123d7802caeSToomas Soome.Sy /EFI/Boot
124d7802caeSToomas Soomedirectory of the EFI System Partition (ESP).
125d7802caeSToomas SoomeThe boot loader program in ESP is named
126afc6b57aSToomas Soome.Sy bootx64.efi
127d7802caeSToomas Soomefor AMD64 system and
128d7802caeSToomas Soome.Sy bootia32.efi
129d7802caeSToomas Soomefor i386 system.
130d7802caeSToomas SoomeNote, only a 64-bit kernel is supported, even on i386 systems.
131d7802caeSToomas SoomeThe
132d7802caeSToomas Soome.Sy bootia32.efi
133d7802caeSToomas Soomeboot program is only provided to support systems with 32-bit UEFI firmware,
134d7802caeSToomas Soomebut which can support 64-bit mode.
135d7802caeSToomas Soome.Pp
136d7802caeSToomas SoomeThe
137afc6b57aSToomas Soome.Sy bootx64.efi
138d7802caeSToomas Soomeis copied from
139d7802caeSToomas Soome.Sy /boot/loader64.efi
140d7802caeSToomas Soomeand
141d7802caeSToomas Soome.Sy bootia32.efi
142d7802caeSToomas Soomeis copied from
143d7802caeSToomas Soome.Sy /boot/loader32.efi .
1440c946d80SToomas Soome.Ss Options
1450c946d80SToomas SoomeThe
1460c946d80SToomas Soome.Nm
1470c946d80SToomas Soomecommand accepts the following options:
1480c946d80SToomas Soome.Bl -tag -width Ds
149d7802caeSToomas Soome.It Fl b Ar boot_dir
150d7802caeSToomas SoomeProvide path to the directory, where loader boot programs are located.
151d7802caeSToomas Soome.Nm
152d7802caeSToomas Soomewill automatically pick the needed programs and will install to the
153d7802caeSToomas Soomespecified disk device.
1540c946d80SToomas Soome.It Fl h
1550c946d80SToomas SoomePrints short usage message.
1560c946d80SToomas Soome.It Fl m
1570c946d80SToomas SoomeInstalls
1580c946d80SToomas Soome.Sy stage1
15972d3dbb9SYuri Pankovon the master boot sector interactively.
16072d3dbb9SYuri PankovYou must use this option if OS is installed on an extended FDISK or an EFI/GPT
16172d3dbb9SYuri Pankovpartition.
1620c946d80SToomas Soome.It Fl f
1630c946d80SToomas SoomeSuppresses interaction when overwriting the master boot sector on x86.
1640c946d80SToomas SoomeForce update on SPARC.
1650c946d80SToomas Soome.It Fl n
16672d3dbb9SYuri PankovDry run session.
16772d3dbb9SYuri PankovWill not write to disk.
1680c946d80SToomas Soome.It Fl F
16972d3dbb9SYuri PankovOn SPARC, specify file system type.
17072d3dbb9SYuri PankovOn x86, inhibit version check and enforce boot loader update.
1710c946d80SToomas Soome.It Fl u Ar verstr
17272d3dbb9SYuri PankovSpecify custom version string.
17372d3dbb9SYuri PankovCan be used to add version on non-versioned boot loader or change built in
17472d3dbb9SYuri Pankovversion string.
1750c946d80SToomas Soome.It Fl i
176b6dfa2aeSToomas SoomePrint version string from installed boot loader or from indicated file.
1770c946d80SToomas Soome.It Fl e
1780c946d80SToomas SoomePrint version string from installed boot loader without description.
1790c946d80SToomas Soome.It Fl V
1800c946d80SToomas SoomePrint version string from installed boot loader with full description.
1810c946d80SToomas Soome.It Fl M
1820c946d80SToomas SoomeMirror boot loader from installed disk partition.
1830c946d80SToomas Soome.El
1840c946d80SToomas Soome.Ss Operands
1850c946d80SToomas SoomeThe
1860c946d80SToomas Soome.Nm
1870c946d80SToomas Soomecommand accepts the following operands:
1880c946d80SToomas Soome.Bl -tag -width Ds
1890c946d80SToomas Soome.It Ar bootblk
1900c946d80SToomas SoomeThe name of the SPARC boot loader code.
1910c946d80SToomas Soome.It Ar stage1
1920c946d80SToomas SoomeThe name of the loader stage 1 file.
1930c946d80SToomas Soome.It Ar stage2
1940c946d80SToomas SoomeThe name of the loader stage 2 file.
1950c946d80SToomas Soome.It Ar raw-device
19672d3dbb9SYuri PankovThe name of the device onto which bootloader code is to be installed.
19772d3dbb9SYuri PankovIt must be a character device that is readable and writable and part of boot
19872d3dbb9SYuri Pankovpool.
1990c946d80SToomas Soome.El
2000c946d80SToomas Soome.Sh FILES
2010c946d80SToomas Soome.Bl -tag -width Ds
2020c946d80SToomas Soome.It Pa /boot
2030c946d80SToomas SoomeDirectory where x86 loader files reside.
2040c946d80SToomas Soome.It Pa /usr/platform/platform name/lib/fs
2050c946d80SToomas SoomeDirectory where SPARC boot loader files reside.
2060c946d80SToomas Soome.El
2070c946d80SToomas Soome.Sh EXAMPLES
2080c946d80SToomas Soome.Bl -tag -width Ds
2090c946d80SToomas Soome.It Sy Example 1 No Installing zfs boot loader on SPARC disk slice
2100c946d80SToomas SoomeThe following command installs zfs boot loader on SPARC system:
2110c946d80SToomas Soome.Bd -literal
2120c946d80SToomas Soome# installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk \e
2130c946d80SToomas Soome  /dev/rdsk/c0t0d0s0
2140c946d80SToomas Soome.Ed
2150c946d80SToomas Soome.It Sy Example 2 No Installing boot loader on x86 system
2160c946d80SToomas SoomeThe following command installs loader stage files and master boot record:
2170c946d80SToomas Soome.Bd -literal
2180c946d80SToomas Soome# installboot -m /boot/pmbr /boot/gptzfsboot /dev/rdsk/c0t0d0s0
2190c946d80SToomas Soome.Ed
2200c946d80SToomas Soome.El
2210c946d80SToomas Soome.Sh INTERFACE STABILITY
2220c946d80SToomas Soome.Sy Uncommitted
2230c946d80SToomas Soome.Sh SEE ALSO
224*bbf21555SRichard Lowe.Xr attributes 7 ,
225*bbf21555SRichard Lowe.Xr boot 8 ,
226*bbf21555SRichard Lowe.Xr bootadm 8 ,
227*bbf21555SRichard Lowe.Xr fdisk 8 ,
228*bbf21555SRichard Lowe.Xr fmthard 8 ,
229*bbf21555SRichard Lowe.Xr format 8 ,
230*bbf21555SRichard Lowe.Xr kernel 8
2310c946d80SToomas Soome.Sh WARNINGS
2320c946d80SToomas SoomeInstalling
2330c946d80SToomas Soome.Sy stage1
2340c946d80SToomas Soomeon the master boot sector
2350c946d80SToomas Soome.Po
2360c946d80SToomas Soome.Fl m
2370c946d80SToomas Soomeoption
2380c946d80SToomas Soome.Pc
23972d3dbb9SYuri Pankovoverrides any boot loader currently installed on the machine.
24072d3dbb9SYuri PankovThe system will always boot the current OS partition regardless of which fdisk
24172d3dbb9SYuri Pankovpartition is active.
2420c946d80SToomas Soome.Pp
2430c946d80SToomas SoomeIf version string indicates the source boot loader might be more recent,
2440c946d80SToomas Soome.Nm
24572d3dbb9SYuri Pankovwill also verify md5 checksums to determine if update is really necessary.
24672d3dbb9SYuri PankovIf checksums match, the install will not be performed.
247