Changeset View
Changeset View
Standalone View
Standalone View
sbin/zfsbootcfg/zfsbootcfg.8
Show All 18 Lines | |||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd May 24, 2017 | .Dd July 22, 2020 | ||||
.Dt ZFSBOOTCFG 8 | .Dt ZFSBOOTCFG 8 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm zfsbootcfg | .Nm zfsbootcfg | ||||
.Nd "specify zfsboot options for the next boot" | .Nd "specify zfsboot options for the next boot" | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.Nm | .Nm | ||||
.Ao Ar options Ac | .Ao Ar options Ac | ||||
.Nm | |||||
.Op Fl k Ar key | |||||
.Op Fl p | |||||
.Op Fl t Ar type | |||||
.Op Fl v Ar value | |||||
.Op Fl z Ar pool | |||||
.Nm | |||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||
.Nm | .Nm | ||||
is used to set | is used to set | ||||
.Xr boot.config 5 Ns -style | .Xr boot.config 5 Ns -style | ||||
options to be used by | options to be used by | ||||
.Xr zfsboot 8 | .Xr zfsboot 8 , | ||||
or | |||||
.Xr gptzfsboot 8 | .Xr gptzfsboot 8 | ||||
or | |||||
.Xr loader 8 | |||||
the next time the machine is booted. | the next time the machine is booted. | ||||
Once | Once | ||||
.Xr zfsboot 8 | .Xr zfsboot 8 | ||||
or | or | ||||
.Xr gptzfsboot 8 | .Xr gptzfsboot 8 | ||||
or | |||||
.Xr loader 8 | |||||
reads the information, it is deleted. | reads the information, it is deleted. | ||||
If booting fails, the machine automatically reverts to the previous | If booting fails, the machine automatically reverts to the previous | ||||
boot configuration. | boot configuration. | ||||
The information is stored in a special reserved area of a ZFS pool. | The information is stored in a special boot environment area of a ZFS pool. | ||||
.Xr zfsboot 8 | .Pp | ||||
or | If used without arguments, | ||||
.Xr gptzfsboot 8 | .Nm | ||||
read the boot option information from the first disk found in the first | will output the current boot configuration, if set. | ||||
ZFS pool found. | .Pp | ||||
The following options are supported by | |||||
.Nm : | |||||
.Bl -tag -width indent | |||||
.It Fl k Ar key | |||||
Define key for | |||||
.Ao key , value Ac | |||||
pair. | |||||
.It Fl p | |||||
Print all information stored in ZFS pool bootenv area. | |||||
.It Fl t Ar type | |||||
Set type of | |||||
.Ar value | |||||
used in | |||||
.Ao key , value Ac | |||||
pair. | |||||
Currently, the only supported type is | |||||
.Ar DATA_TYPE_STRING . | |||||
.It Fl v Ar value | |||||
Define value for | |||||
.Ao key , value Ac | |||||
pair. | |||||
.It Fl z Ar pool | |||||
Operate on | |||||
.Ar pool . | |||||
.El | |||||
.Sh ENVIRONMENT | .Sh ENVIRONMENT | ||||
.Bl -tag -width vfs.zfs.boot.primary_pool -compact | .Bl -tag -width vfs.root.mountfrom -compact | ||||
.It Ev vfs.zfs.boot.primary_pool | .It Ev vfs.root.mountfrom | ||||
The | The | ||||
.Xr kenv 1 | .Xr kenv 1 | ||||
variable that identifies a pool for which the options are written. | variable that identifies a pool for which the options are written. | ||||
.It Ev vfs.zfs.boot.primary_vdev | |||||
The | |||||
.Xr kenv 1 | |||||
variable that identifies a disk within the pool where the options | |||||
are written. | |||||
.El | .El | ||||
.Sh EXAMPLES | .Sh EXAMPLES | ||||
Try to boot to a new | Try to boot to a new | ||||
.Em boot environment | .Em boot environment | ||||
without changing the | without changing the | ||||
.Cm bootfs | .Cm bootfs | ||||
property of a pool: | property of a pool: | ||||
.Pp | .Pp | ||||
.Dl "zfsbootcfg ""zfs:tank/ROOT/newbe:"" | .Dl "zfsbootcfg ""zfs:tank/ROOT/newbe:"" | ||||
.Pp | .Pp | ||||
To clear the boot options: | To clear the boot options: | ||||
.Pp | .Pp | ||||
.Dl "zfsbootcfg """" | .Dl "zfsbootcfg """" | ||||
.Sh SEE ALSO | .Sh SEE ALSO | ||||
.Xr boot.config 5 , | .Xr boot.config 5 , | ||||
.Xr bectl 8 , | |||||
.Xr gptzfsboot 8 , | .Xr gptzfsboot 8 , | ||||
.Xr loader 8 , | |||||
.Xr zfsboot 8 | .Xr zfsboot 8 | ||||
.Sh HISTORY | .Sh HISTORY | ||||
.Nm | .Nm | ||||
appeared in | appeared in | ||||
.Fx 11.1 . | .Fx 11.1 . | ||||
.Sh AUTHORS | .Sh AUTHORS | ||||
This manual page was written by | This manual page was written by | ||||
.An Andriy Gapon Aq Mt avg@FreeBSD.org . | .An Andriy Gapon Aq Mt avg@FreeBSD.org . | ||||
.Sh CAVEATS | |||||
At the moment, | |||||
.Nm | |||||
uses the | |||||
.Ev vfs.zfs.boot.primary_pool | |||||
and | |||||
.Ev vfs.zfs.boot.primary_vdev | |||||
.Xr kenv 1 | |||||
variables to determine a ZFS pool and a disk in it where the options | |||||
are to be stored. | |||||
The variables are set by the ZFS boot chain, so there is an assumption | |||||
that the same boot disk is going to be used for the next reboot. | |||||
There is no | |||||
.Nm | |||||
option to specify a different pool or a different disk. | |||||
.Pp | |||||
.Nm | |||||
should be extended to install new | |||||
.Xr zfsboot 8 | |||||
blocks in a ZFS pool. |