Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

zfsboot(8) [freebsd man page]

ZFSBOOT(8)						    BSD System Manager's Manual 						ZFSBOOT(8)

NAME
zfsboot -- bootcode for ZFS on BIOS-based computers DESCRIPTION
zfsboot is used on BIOS-based computers to boot from a filesystem in a ZFS pool. zfsboot is installed in two parts on a disk or a partition used by a ZFS pool. The first part, a single-sector starter boot block, is installed at the beginning of the disk or partition. The second part, a main boot block, is installed at a special offset within the disk or partition. Both areas are reserved by the ZFS on-disk specifi- cation for boot use. If zfsboot is installed in a partition, then that partition should be made bootable using appropriate configuration and boot blocks described in boot(8). BOOTING
The zfsboot boot process is very similar to that of gptzfsboot(8). One significant difference is that zfsboot does not currently support the GPT partitioning scheme. Thus only whole disks and MBR partitions, traditionally referred to as slices, are probed for ZFS disk labels. See the BUGS section in gptzfsboot(8) for some limitations of the MBR scheme support. USAGE
zfsboot supports all the same prompt and configuration file arguments as gptzfsboot(8). FILES
/boot/zfsboot boot code binary /boot.config parameters for the boot block (optional) /boot/config alternative parameters for the boot block (optional) EXAMPLES
zfsboot is typically installed using dd(1). To install zfsboot on the ada0 drive: dd if=/boot/zfsboot of=/dev/ada0 count=1 dd if=/boot/zfsboot of=/dev/ada0 iseek=1 oseek=1024 If the drive is currently in use, the GEOM safety will prevent writes and must be disabled before running the above commands: sysctl kern.geom.debugflags=0x10 zfsboot can also be installed in an MBR slice: gpart create -s mbr ada0 gpart add -t freebsd ada0 gpart create -s BSD ada0s1 gpart bootcode -b /boot/boot0 ada0 gpart set -a active -i 1 ada0 dd if=/boot/zfsboot of=/dev/ada0s1 count=1 dd if=/boot/zfsboot of=/dev/ada0s1 iseek=1 oseek=1024 Note that commands to create and populate a pool are not shown in the example above. SEE ALSO
dd(1), boot.config(5), boot(8), gptzfsboot(8), loader(8), zfsloader(8), zpool(8) HISTORY
zfsboot appeared in FreeBSD 7.3. AUTHORS
This manual page was written by Andriy Gapon <avg@FreeBSD.org>. BUGS
Installing zfsboot with dd(1) is a hack. ZFS needs a command to properly install zfsboot onto a ZFS-controlled disk or partition. BSD
September 15, 2014 BSD

Check Out this Related Man Page

BSDINSTALL(8)						    BSD System Manager's Manual 					     BSDINSTALL(8)

NAME
bsdinstall -- system installer SYNOPSIS
bsdinstall [options] [target] [...] DESCRIPTION
bsdinstall is used for installation of new systems, both for system setup from installation media (e.g. CD-ROMs) and for use on live systems to prepare VM images and jails. Much like make(1), bsdinstall takes a target and possible parameters of the target as arguments. If invoked with no arguments, it will invoke the auto target, which provides a standard interactive installation, invoking the others in sequence. To perform a scripted installation, these subtargets can be invoked separately by an installation script. OPTIONS
bsdinstall supports the following options, global to all targets: -D file Provide a path for the installation log file (overrides BSDINSTALL_LOG). See ENVIRONMENT VARIABLES for more information on BSDINSTALL_LOG. TARGETS
Most of the following targets are only useful for scripting the installer. For interactive use, most users will be interested only in the auto, jail, and script targets. auto Run the standard interactive installation, including disk partitioning. jail destination Sets up a new chroot system at destination, suitable for use with jail(8). Behavior is generally similar to auto, except that disk partitioning and network setup are skipped and a kernel is not installed into the new system. script script Runs the installation script at script. See SCRIPTING for more information on this target. keymap If the current controlling TTY is a syscons(4) or vt(4) console, asks the user to set the current keymap, and saves the result to the new system's rc.conf. hostname Prompts the user for a host name for the new system and saves the result to the new system's rc.conf. If BSDINSTALL_CONFIGCURRENT is set, also sets the host name of the current system. netconfig Interactively configures network interfaces (first invoking wlanconfig on wireless interfaces), saving the result to the new system's rc.conf and resolv.conf. If BSDINSTALL_CONFIGCURRENT is set, also configures the network interfaces of the current system to match. autopart Provides the installer's interactive guided disk partitioner for single-disk installations. Defaults to UFS. zfsboot Provides an alternative ZFS-only automatic interactive disk partitioner. Creates a single zpool with separate datasets for /tmp, /usr, /usr/home, /usr/ports, /usr/src, and /var. Optionally can set up geli(8) to encrypt the disk. partedit Provides the installer's interactive manual disk partitioner with an interface identical to sade(8). Supports multiple disks as well as UFS, ZFS, and FAT file systems. ZFS is set up with one pool and dataset per partition. scriptedpart parameters Sets up disks like autopart and partedit, but non-interactively according to the disk setup specified in parameters. Each disk setup is specified by a three-part argument: disk [scheme] [{partitions}] Multiple disk setups are separated by semicolons. The disk argument specifies the disk on which to operate (which will be erased), while the scheme argument specifies the gpart(8) partition scheme to apply to the disk. If scheme is unspecified, scriptedpart will apply the default bootable scheme on your platform. The partitions argument is also optional and speci- fies how to partition disk. It consists of a comma-separated list of partitions to create enclosed in curly braces. Each partition declaration takes the form size type [mount point] size specifies the partition size to create in bytes (K, M, and G suffixes can be appended to specify kilobytes, megabytes, and gigabytes respectively), while the auto keyword causes the partition to take all the remaining space on the disk. The type option chooses the gpart(8) filesystem type (e.g. freebsd-ufs, freebsd-zfs, or freebsd-swap). The optional mount point argument sets where the created partition is to be mounted in the installed system. As an example, a typical invoca- tion looks like: bsdinstall scriptedpart ada0 { 20G freebsd-ufs /, 4G freebsd-swap, 20G freebsd-ufs /var, auto freebsd-ufs /usr } A shorter invocation to use the default partitioning (as autopart would have used) on the same disk: bsdinstall scriptedpart ada0 mount Mounts the file systems previously configured by autopart, partedit, or scriptedpart under BSDINSTALL_CHROOT. distfetch Fetches the distributions in DISTRIBUTIONS to BSDINSTALL_DISTDIR from BSDINSTALL_DISTSITE. checksum Verifies the checksums of the distributions listed in DISTRIBUTIONS against the distribution manifest. distextract Extracts the distributions listed in DISTRIBUTIONS into BSDINSTALL_CHROOT. rootpass Interactively invokes passwd(1) in the new system to set the root user's password. adduser Interactively invokes adduser(8) in the new system. time Interactively sets the time, date, and time zone of the new system. services Queries the user for the system daemons to begin at system startup, writing the result into the new system's rc.conf. entropy Reads a small amount of data from /dev/random and stores it in a file in the new system's root directory. config Installs the configuration files destined for the new system (e.g. rc.conf fragments generated by netconfig, etc.) onto the new system. ENVIRONMENT VARIABLES
The following environment variables control various aspects of the installation process. Many are used internally during installation and have reasonable default values for most installation scenarios. Others are set by various interactive user prompts, and can be usefully over- ridden when making scripted or customized installers. DISTRIBUTIONS The set of distributions to install (e.g. "base kernel ports"). Default: none BSDINSTALL_DISTDIR The directory in which the distribution files can be found (or to which they should be downloaded). Default: /usr/freebsd-dist BSDINSTALL_DISTSITE URL from which the distribution files should be downloaded if they are not already present in the directory defined by BSDINSTALL_DISTDIR. This should be a full path to the files, including architecture and release names. Most targets (e.g. auto and jail) that prompt for a FreeBSD mirror will skip that step if this variable is already defined in the environment. Example: ftp://ftp.freebsd.org/pub/FreeBSD/releases/powerpc/powerpc64/9.1-RELEASE BSDINSTALL_CHROOT The directory into which the distribution files should be unpacked and the directory at which the root file system of the new system should be mounted. Default: /mnt BSDINSTALL_LOG Path to a log file for the installation. Default: /tmp/bsdinstall_log BSDINSTALL_TMPETC Directory where files destined for the new system's /etc will be stored until the config target is executed. If this directory does not already exist, it will be created. Default: /tmp/bsdinstall_etc BSDINSTALL_TMPBOOT Directory where files destined for the new system's /boot will be stored until the config target is executed. If this directory does not already exist, it will be created. Default: /tmp/bsdinstall_boot SCRIPTING
bsdinstall scripts consist of two parts: a preamble and a setup script. The preamble sets up the options for the installation (how to parti- tion the disk[s], which distributions to install, etc.) and the optional second part is a shell script run under chroot(8) in the newly installed system before bsdinstall exits. The two parts are separated by the usual script header (#!), which also sets the interpreter for the setup script. A typical bsdinstall script looks like this: PARTITIONS=ada0 DISTRIBUTIONS="kernel.txz base.txz" #!/bin/sh echo "ifconfig_em0=DHCP" >> /etc/rc.conf echo "sshd_enable=YES" >> /etc/rc.conf pkg install puppet On FreeBSD release media, such a script placed at /etc/installerconfig will be run at boot time and the system will be rebooted automatically after the installation has completed. This can be used for unattended network installation of new systems; see diskless(8) for details. PREAMBLE The preamble consists of installer settings. These control global installation parameters (see ENVIRONMENT VARIABLES) as well as disk parti- tioning. The preamble is interpreted as a sh(1) script run at the very beginning of the install. If more complicated behavior than setting these variables is desired, arbitrary commands can be run here to extend the installer. In addition to the variables in ENVIRONMENT VARIABLES, in particular DISTRIBUTIONS, the preamble can contain a variable PARTITIONS which is passed to the scriptedpart target to control disk setup. Alternatively, to use zfsboot instead of partedit, the preamble can contain the variable ZFSBOOT_DATASETS instead of PARTITIONS. SETUP SCRIPT Following the preamble is an optional shell script, beginning with a #! declaration. This script will be run at the end of the installation process inside a chroot(8) environment in the newly installed system and can be used to set up configuration files, install packages, etc. Note that newly configured system services (e.g. networking) have not been started in the installed system at this time and only installation host services are available. HISTORY
This version of bsdinstall first appeared in FreeBSD 9.0. AUTHORS
Nathan Whitehorn <nwhitehorn@FreeBSD.org> BSD
October 31, 2014 BSD
Man Page