1ca987d46SWarner Losh.\" Copyright (c) 2014 Andriy Gapon <avg@FreeBSD.org> 2ca987d46SWarner Losh.\" All rights reserved. 3ca987d46SWarner Losh.\" 4ca987d46SWarner Losh.\" Redistribution and use in source and binary forms, with or without 5ca987d46SWarner Losh.\" modification, are permitted provided that the following conditions 6ca987d46SWarner Losh.\" are met: 7ca987d46SWarner Losh.\" 1. Redistributions of source code must retain the above copyright 8ca987d46SWarner Losh.\" notice, this list of conditions and the following disclaimer. 9ca987d46SWarner Losh.\" 2. Redistributions in binary form must reproduce the above copyright 10ca987d46SWarner Losh.\" notice, this list of conditions and the following disclaimer in the 11ca987d46SWarner Losh.\" documentation and/or other materials provided with the distribution. 12ca987d46SWarner Losh.\" 13ca987d46SWarner Losh.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND 14ca987d46SWarner Losh.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15ca987d46SWarner Losh.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16ca987d46SWarner Losh.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE 17ca987d46SWarner Losh.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18ca987d46SWarner Losh.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19ca987d46SWarner Losh.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20ca987d46SWarner Losh.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21ca987d46SWarner Losh.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22ca987d46SWarner Losh.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23ca987d46SWarner Losh.\" SUCH DAMAGE. 24ca987d46SWarner Losh.\" 25*34a1f87bSEugene Grosbein.Dd March 27, 2018 26ca987d46SWarner Losh.Dt ZFSBOOT 8 27ca987d46SWarner Losh.Os 28ca987d46SWarner Losh.Sh NAME 29ca987d46SWarner Losh.Nm zfsboot 30ca987d46SWarner Losh.Nd bootcode for ZFS on BIOS-based computers 31ca987d46SWarner Losh.Sh DESCRIPTION 32ca987d46SWarner Losh.Nm 33ca987d46SWarner Loshis used on BIOS-based computers to boot from a filesystem in 34ca987d46SWarner Losha ZFS pool. 35ca987d46SWarner Losh.Nm 36ca987d46SWarner Loshis installed in two parts on a disk or a partition used by a ZFS pool. 37ca987d46SWarner LoshThe first part, a single-sector starter boot block, is installed 38ca987d46SWarner Loshat the beginning of the disk or partition. 39ca987d46SWarner LoshThe second part, a main boot block, is installed at a special offset 40ca987d46SWarner Loshwithin the disk or partition. 41ca987d46SWarner LoshBoth areas are reserved by the ZFS on-disk specification for boot use. 42ca987d46SWarner LoshIf 43ca987d46SWarner Losh.Nm 44ca987d46SWarner Loshis installed in a partition, then that partition should be made 45ca987d46SWarner Loshbootable using appropriate configuration and boot blocks described in 46ca987d46SWarner Losh.Xr boot 8 . 47ca987d46SWarner Losh.Sh BOOTING 48ca987d46SWarner LoshThe 49ca987d46SWarner Losh.Nm 50ca987d46SWarner Loshboot process is very similar to that of 51ca987d46SWarner Losh.Xr gptzfsboot 8 . 52ca987d46SWarner LoshOne significant difference is that 53ca987d46SWarner Losh.Nm 54ca987d46SWarner Loshdoes not currently support the GPT partitioning scheme. 55ca987d46SWarner LoshThus only whole disks and MBR partitions, traditionally referred to as 56ca987d46SWarner Loshslices, are probed for ZFS disk labels. 57ca987d46SWarner LoshSee the BUGS section in 58ca987d46SWarner Losh.Xr gptzfsboot 8 59ca987d46SWarner Loshfor some limitations of the MBR scheme support. 60ca987d46SWarner Losh.Sh USAGE 61ca987d46SWarner Losh.Nm 62ca987d46SWarner Loshsupports all the same prompt and configuration file arguments as 63ca987d46SWarner Losh.Xr gptzfsboot 8 . 64ca987d46SWarner Losh.Sh FILES 65ca987d46SWarner Losh.Bl -tag -width /boot/zfsboot -compact 66ca987d46SWarner Losh.It Pa /boot/zfsboot 67ca987d46SWarner Loshboot code binary 68ca987d46SWarner Losh.It Pa /boot.config 69ca987d46SWarner Loshparameters for the boot block 70ca987d46SWarner Losh.Pq optional 71ca987d46SWarner Losh.It Pa /boot/config 72ca987d46SWarner Loshalternative parameters for the boot block 73ca987d46SWarner Losh.Pq optional 74ca987d46SWarner Losh.El 75ca987d46SWarner Losh.Sh EXAMPLES 76ca987d46SWarner Losh.Nm 77ca987d46SWarner Loshis typically installed using 78ca987d46SWarner Losh.Xr dd 1 . 79ca987d46SWarner LoshTo install 80ca987d46SWarner Losh.Nm 81ca987d46SWarner Loshon the 82ca987d46SWarner Losh.Pa ada0 83ca987d46SWarner Loshdrive: 84ca987d46SWarner Losh.Bd -literal -offset indent 85ca987d46SWarner Loshdd if=/boot/zfsboot of=/dev/ada0 count=1 86ca987d46SWarner Loshdd if=/boot/zfsboot of=/dev/ada0 iseek=1 oseek=1024 87ca987d46SWarner Losh.Ed 88ca987d46SWarner Losh.Pp 89ca987d46SWarner LoshIf the drive is currently in use, the GEOM safety will prevent writes 90ca987d46SWarner Loshand must be disabled before running the above commands: 91ca987d46SWarner Losh.Bd -literal -offset indent 92ca987d46SWarner Loshsysctl kern.geom.debugflags=0x10 93ca987d46SWarner Losh.Ed 94ca987d46SWarner Losh.Pp 95ca987d46SWarner Losh.Nm 96ca987d46SWarner Loshcan also be installed in an MBR slice: 97ca987d46SWarner Losh.Bd -literal -offset indent 98ca987d46SWarner Loshgpart create -s mbr ada0 99ca987d46SWarner Loshgpart add -t freebsd ada0 100ca987d46SWarner Loshgpart bootcode -b /boot/boot0 ada0 101ca987d46SWarner Loshgpart set -a active -i 1 ada0 102*34a1f87bSEugene Grosbeindd if=/dev/zero of=/dev/ada0s1 count=2 103ca987d46SWarner Loshdd if=/boot/zfsboot of=/dev/ada0s1 count=1 104ca987d46SWarner Loshdd if=/boot/zfsboot of=/dev/ada0s1 iseek=1 oseek=1024 105ca987d46SWarner Losh.Ed 106ca987d46SWarner Losh.Pp 107ca987d46SWarner LoshNote that commands to create and populate a pool are not shown 108ca987d46SWarner Loshin the example above. 109ca987d46SWarner Losh.Sh SEE ALSO 110ca987d46SWarner Losh.Xr dd 1 , 111ca987d46SWarner Losh.Xr boot.config 5 , 112ca987d46SWarner Losh.Xr boot 8 , 113ca987d46SWarner Losh.Xr gptzfsboot 8 , 114ca987d46SWarner Losh.Xr loader 8 , 115ca987d46SWarner Losh.Xr zpool 8 116ca987d46SWarner Losh.Sh HISTORY 117ca987d46SWarner Losh.Nm 118ca987d46SWarner Loshappeared in FreeBSD 7.3. 119ca987d46SWarner Losh.Sh AUTHORS 120ca987d46SWarner LoshThis manual page was written by 121ca987d46SWarner Losh.An Andriy Gapon Aq avg@FreeBSD.org . 122ca987d46SWarner Losh.Sh BUGS 123ca987d46SWarner LoshInstalling 124ca987d46SWarner Losh.Nm 125ca987d46SWarner Loshwith 126ca987d46SWarner Losh.Xr dd 1 127ca987d46SWarner Loshis a hack. 128ca987d46SWarner LoshZFS needs a command to properly install 129ca987d46SWarner Losh.Nm 130ca987d46SWarner Loshonto a ZFS-controlled disk or partition. 131