<!-- 
The contents of this Documentation are subject to the Public Documentation
License Version 1.01 (the "License"); you may only use this Documentation if
you comply with the terms of this License. A copy of the License is
available at http://www.opensolaris.org/os/community/documentation/license.
-->

<chapter id="index"><title>Introduction to Boot Environments</title><highlights><caution><para><emphasis role="strong">This document is in development for
an upcoming release.</emphasis></para>
</caution><para>A boot environment is a bootable instance of an <trademark>OpenSolaris</trademark> operating system image plus any other application software packages installed
into that image. System administrators can maintain multiple boot environments
on their systems, and each boot environment can have different software versions
installed.</para><para>Upon the initial installation of OpenSolaris onto a system, a boot environment
is created.  Use the <citerefentry><refentrytitle>beadm</refentrytitle><manvolnum>1M</manvolnum></citerefentry> utility or the Package Manager to
administer additional boot environments on your system.</para>
</highlights><sect1 id="snap3"><title>Why Use Multiple Boot Environments?</title><para>With multiple boot environments, the process of updating software becomes
a low risk operation because system administrators can create backup boot
environments before making any software updates to your system.  If needed,
they have the option of booting a backup boot environment.</para><itemizedlist><para>Here are some specific examples where having more than one OpenSolaris
boot environment, and managing them with the <command>beadm</command> utility,
is useful:</para><listitem><para>When you use either the Package Manager tool or the <command>pkg image-update</command> command to update all the packages in your active
OpenSolaris boot environment, this process automatically creates a clone of
that boot environment. The packages are updated in the clone rather than in
the original boot environment. After successfully completing the updates,
the new clone is activated. Then, the clone will become the new default boot
environment on the next reboot. The original boot environment remains on the
GRUB menu for x86 systems, or the boot menu for SPARC systems, as an alternate
selection.</para><para>For more information, see &ldquo;Upgrading an Image&rdquo;
in <ulink url="http://dlc.sun.com/osol/docs/content/2009.06/getstart/" type="text">Getting Started
With OpenSolaris</ulink>.</para><para>You can use the <command>beadm list</command> command to see a list
of all the boot environments on the system, including the backup boot environment
that still has its original, unchanged software. If you are not satisfied
with the updates made to the environment, you can use the <command>beadm activate</command> command to specify that the backup will become the default boot environment
on the next reboot.</para>
</listitem><listitem><para>If you are modifying a boot environment, you can take a snapshot
of that environment at any stage during modifications by using the <command>beadm create</command> command. A snapshot is a read-only image of a dataset
or boot environment at a given point in time.</para><para>You can create custom
names for each snapshot that identify when or why the snapshot was created.
For example, if you are doing monthly upgrades to your boot environment, you
can capture snapshots for each monthly upgrade. You can use the <command>beadm
list <option>s</option></command> command to view the available snapshots
for a boot environment.</para><para>A snapshot is not bootable. But, you can create a boot environment,
based on that snapshot, by using the <option>e</option> option for the <command>beadm create</command> command. Then you can use the <command>beadm activate</command>command to specify that this boot environment will become the default boot
environment on the next reboot.</para>
</listitem><listitem><para>You can maintain more than one boot environment on your system,
and perform various upgrades on each of them as needed. For example, you can
clone a boot environment by using the <command>beadm create</command> command.
A clone is a bootable copy of a boot environment. Then, you can install, test,
and update different software packages on the original boot environment and
on its clone.</para><para>Although only one boot environment can be active
at a time, you can mount an inactive boot environment by using the <command>beadm mount</command> command. Then you can use the <command>pkg image-update</command> command with the <option>R</option> option to update all the packages in
that inactive, mounted environment. Or, use the <command>pkg install <replaceable>packagename</replaceable></command> with the <option>R</option> option to
update specific packages on that environment.</para>
</listitem>
</itemizedlist>
</sect1><sect1 id="packagemgr"><title>Package Manager GUI</title><para>You can manage the boot environments on your system either by using
the <command>beadm</command> command or by using the Package Manager.</para><para>The Package Manager is a graphical user interface that enables you to
install, update, and manage packages on your installed system. If you use
the Package Manager to update all the packages on your system, a clone of
the active boot environment is created. This clone enables you to, if necessary,
boot into the boot environment state that existed before the update process
was started.</para><itemizedlist><para>You can use the Package Manager to manage your boot environments as
follows:</para><listitem><para>You can delete old and unused boot environments, in order
to make the disk space available.</para>
</listitem><listitem><para>You can change the default boot environment on your system.</para>
</listitem><listitem><para>You can activate a boot environment.</para>
</listitem>
</itemizedlist><para>For instructions, see the online help that is available in the Package
Manager.</para><para>The Package Manager is available on the menu bar on the desktop for
both the OpenSolaris Live CD and the installed OpenSolaris operating system.
On the desktop menu bar, go to System&gt;Administration&gt;Package Manager. Or,
select the Get Software icon on the desktop.</para><para>The Package Manager, however, does not provide the full range of options
for managing your boot environments that is available by using the <command>beadm</command> command as described in the following sections.</para>
</sect1><sect1 id="features"><title>Features of <command>beadm</command> Utility</title><itemizedlist><para>The <command>beadm</command> utility has the following features:</para><listitem><para>The <command>beadm</command> utility aggregates all datasets
in a boot environment and performs actions on the entire boot environment
at once. You no longer need to perform ZFS commands to modify each dataset
individually.</para>
</listitem><listitem><para>The <command>beadm</command> utility manages the dataset structures
within boot environments. For example, when the <command>beadm</command> utility
clones a boot environment that has shared datasets, the utility automatically
recognizes and manages those shared datasets for the new boot environment.</para>
</listitem><listitem><para>The <command>beadm</command> utility enables you to perform
administrative tasks on your boot environments. These tasks can be performed
without upgrading your system.</para>
</listitem><listitem><para>The <command>beadm</command> utility automatically manages
and updates the GRUB menu for x86 systems, or the boot menu for SPARC systems.
For example, when you use the <command>beadm</command> utility to create a
new boot environment, that environment is automatically added to the GRUB
menu or boot menu.</para>
</listitem>
</itemizedlist><itemizedlist><para>The new <command>beadm</command> utility enables you to perform the
following tasks:</para><listitem><para>Create a new boot environment based on the active boot environment</para>
</listitem><listitem><para>Create a new boot environment based on an inactive boot environment</para>
</listitem><listitem><para>Create a snapshot of an existing boot environment</para>
</listitem><listitem><para>Create a new boot environment based on an existing snapshot</para>
</listitem><listitem><para>Create a new boot environment and add a custom title to the
x86 GRUB menu or the SPARC boot menu.</para>
</listitem><listitem><para>Activate an existing, inactive boot environment</para>
</listitem><listitem><para>Mount a boot environment</para>
</listitem><listitem><para>Unmount a boot environment</para>
</listitem><listitem><para>Destroy a boot environment</para>
</listitem><listitem><para>Destroy a snapshot of a boot environment</para>
</listitem><listitem><para>Rename an existing, inactive boot environment</para>
</listitem><listitem><para>Display information about your boot environment snapshots
and datasets</para>
</listitem>
</itemizedlist>
</sect1><sect1 id="sysreq"><title><command>beadm</command> Utility Requirements</title><para>To use the new <command>beadm</command> utility to manage your boot
environments, your system must meet the following requirements.</para><table frame="topbot" pgwide="1" id="ggfyp"><title>System Requirements</title><tgroup cols="2" colsep="0" rowsep="0"><colspec colwidth="20.49*"/><colspec colwidth="79.51*"/><thead><row rowsep="1"><entry><para>Requirement</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry><para>OpenSolaris 2008.05 or later release</para>
</entry><entry><para>You must have the OpenSolaris 2008.05 release or a later release installed
on your system. Prior OpenSolaris releases did not include the <command>beadm</command> utility. For information about installing the OpenSolaris operating system,
see <ulink url="http://dlc.sun.com/osol/docs/content/2009.06/getstart/" type="text">Getting Started
With OpenSolaris</ulink>.</para>
</entry>
</row><row><entry><para>ZFS file systems</para>
</entry><entry><para>All OpenSolaris Developer releases have ZFS file systems. The <command>beadm</command> utility is designed for ZFS file systems.</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</sect1><sect1 id="limits"><title>Limitations in Current Release</title><itemizedlist><para>Note the following limitations in the OpenSolaris 2009.06 release.</para><listitem><para>The installation of the OpenSolaris OS supports one pool on
one disk. After installation, you can attach another disk to the root pool
and set up another pool.</para>
</listitem><listitem><para>The <command>beadm</command> utility is implemented with ZFS
support only.</para>
</listitem><listitem><para>The <command>beadm</command> utility manages boot environments
and snapshots that were created by the <command>beadm</command> utility. If
a user manually creates the datasets for a boot environment by using the <command>zfs(1M)</command> command, the <command>beadm</command> utility should recognize
the boot environment, but management of this boot environment might be undefined.</para>
</listitem>
</itemizedlist>
</sect1>
</chapter><chapter id="tasks"><title>Using <command>beadm</command> Utility
(Tasks)</title><highlights><caution><para><emphasis role="strong">This document is in development for
an upcoming release.</emphasis></para>
</caution><para>You can use the <command>beadm</command> utility to create and manage
snapshots and clones of your boot environments.</para><itemizedlist><para>Note the following distinctions relevant to boot environment administration:</para><listitem><para>A <emphasis>snapshot</emphasis> is a read-only image of a
dataset or boot environment at a given point in time. A snapshot is not bootable.</para>
</listitem><listitem><para>A <emphasis>boot environment</emphasis> is a bootable OpenSolaris
environment, consisting of a root dataset and, optionally, other datasets
mounted underneath it. Exactly one boot environment can be active at a time.</para>
</listitem><listitem><para>A <emphasis>clone</emphasis> of a boot environment is created
by copying another boot environment. A clone is bootable.</para><note><para>A clone of the boot environment includes everything hierarchically
under the main root dataset of the original boot environment.  Shared datasets
are not under the root dataset and are not cloned. Instead, the boot environment
accesses the original, shared dataset.</para>
</note>
</listitem><listitem><para>A <emphasis>dataset</emphasis> is a generic name for ZFS entities
such as clones, file systems, or snapshots. In the context of boot environment
administration, the dataset more specifically refers to the file system specifications
for a particular boot environment or snapshot.</para>
</listitem><listitem><para><emphasis>Shared datasets</emphasis> are user-defined files,
such as <filename>/export</filename>, that contain the same mount point in
both the active and inactive boot environments. Shared datasets are located
outside the root dataset area of each boot environment.</para>
</listitem><listitem><para>A boot environment's <emphasis>critical datasets</emphasis> are included within the root dataset area for that environment.</para>
</listitem>
</itemizedlist><note><para>You must be root on your system to use the <command>beadm</command> utility. Alternately, the <command>beadm</command> utility is part of the
Software Installation profile. A user who is part of this profile can use
the <command>pfexec</command> utility to execute <command>beadm</command> commands.</para>
</note><para>For detailed instructions about the <command>beadm</command> utility,
see the <citerefentry><refentrytitle>beadm</refentrytitle><manvolnum>1M</manvolnum></citerefentry> man page. See also <olink type="auto-generated" targetptr="reference" remap="internal"><command>beadm</command> Command Reference</olink>.</para>
</highlights><sect1 id="list"><title>Listing Existing Boot Environments and Snapshots</title><para>All snapshots, boot environments, and datasets that were created by
the <command>beadm</command> command can be displayed with the <command>beadm
list</command> subcommand.</para><para>Snapshots and boot environments can be created by the <command>beadm</command> command. Snapshots and boot environments can also be created by other utilities.
For example, the <command>pkg image-update</command> command automatically
creates a clone of a boot environment and upgrades that clone. The <command>beadm list</command> command output also displays boot environments that
are created by the <command>pkg image-update</command> command.</para><task id="display"><title>How to Display Information About Your Boot Environments,
Snapshots, and Datasets</title><procedure><step><para>Choose the information that you want to view, as described in
this step.</para><stepalternatives><step><para>Choose an option for the <command>beadm list</command> command
from the following list:</para><itemizedlist><listitem override="none"><para><literal>-a</literal> &ndash; Lists all available
information about the boot environment.  This option includes subordinate
datasets and snapshots.</para>
</listitem><listitem override="none"><para><literal>-d</literal> &ndash; Lists information
about a boot environment's datasets.</para>
</listitem><listitem override="none"><para><literal>-s</literal> &ndash; Lists information
about a boot environment's snapshots.</para>
</listitem><listitem override="none"><para><literal>-H</literal> &ndash; Omits the header
information from the display. Choosing this option results in a display that
can be more easily parsed for scripts or other programs.</para>
</listitem>
</itemizedlist>
</step><step><para>You can also choose whether to specify a boot environment name
in the <command>beadm list</command> command.</para><para>By default, if you
do not include a boot environment name in the command, the results include
all boot environments.</para><para>But, if you include a boot environment name in the <command>beadm list</command> command, the results include only information about that boot environment.</para>
</step>
</stepalternatives>
</step><step><para>Type the <command>beadm list</command> command with preferred
options.</para><para>For example, include the <option>a</option> option and
specify the BE1 environment as follows:</para><screen>$ <command>beadm list <option>a</option> <replaceable>BE1</replaceable></command></screen>
</step><step><para>Review the information that is displayed about the available boot
environments.</para>
</step>
</procedure><example id="ieview"><title>Viewing Boot Environment Specifications</title><para>This example includes the <option>a</option> option and specifies the
BE2 environment as follows:</para><screen>$ <command>beadm list <option>a</option> <replaceable>BE2</replaceable></command></screen><para>Sample results are displayed. The BE2 environment will be active on
reboot, as indicated by the R in the Active column.</para><screen>BE/Dataset             Active Mountpoint Space  Policy Created         
----------             ------ ---------- -----  ------ -------         
BE2 rpool/ROOT/BE2     R      /mnt       89.67M static 2008-09-17 20:17
    rpool/ROOT/BE2/opt -      /mnt/opt   0      static 2008-09-17 20:17</screen><para>Two datasets are included in BE2, the dataset, <filename>rpool/ROOT/BE2</filename>, and the dataset, <filename>rpool/ROOT/BE2/opt</filename>. The values for
the Active column are as follows:</para><itemizedlist><listitem><para><replaceable>R</replaceable> &ndash; Active on reboot</para>
</listitem><listitem><para><replaceable>N</replaceable> &ndash; Now active</para>
</listitem><listitem><para><replaceable>&ldquo;-&rdquo;</replaceable> &ndash; Inactive</para>
</listitem>
</itemizedlist>
</example><example id="ieviewsnap"><title>Viewing Snapshot Specifications</title><para>This example includes the <option>s</option> option, which displays
information for any snapshots that exist on the current image. The status
of those snapshots is the same list that the <citerefentry><refentrytitle>zfs</refentrytitle><manvolnum>1M</manvolnum></citerefentry> command displays.</para><screen>$ <command>beadm list <option>s</option> <replaceable>BE2</replaceable></command></screen><para>Sample results are displayed.</para><screen>BE/Snapshot              Space   Policy Created         
-----------              -----   ------ -------          
BE1
BE1@2008-10-13-20:53:10  32.00M  static 2008-10-13 13:53
BE2
BE2@2008-10-16-16:40:09  213.0K  static 2008-10-16 09:40      
preview2
preview2@install         452.00M static 2008-05-24 14:24
preview2@BE1             765.37M static 2008-07-11 12:15
preview2@BE2             438.22M static 2008-08-09 16:22</screen><para>In this example, the BE1, BE2, and Preview 2 boot environments are listed.
BE1 and BE2 each have one snapshot listed, with each snapshot name showing
when the snapshot was taken. The Preview 2 boot environment has three snapshots
available, with each snapshot name indicating the original image source.</para>
</example>
</task>
</sect1><sect1 id="create"><title>Creating a Boot Environment</title><para>If you want to create a backup of an existing boot environment, for
example, prior to modifying the original boot environment, you can use the <command>beadm</command> command to create and mount a new boot environment that is
a clone of your active boot environment. This clone is inactive and displays
as an alternate in the GRUB menu for x86 systems or the boot menu for SPARC
systems on reboot. The SPARC boot menu is located at <filename>/rpool/boot/menu.lst</filename>.</para><note><para>When you create a new boot environment, the process first automatically
takes a snapshot of the original boot environment, then the process makes
a new clone that is derived from this snapshot. Both the new snapshot and
the new clone are retained by the system.</para>
</note><task id="create2"><title>How to Create a Boot Environment</title><procedure><step><para>At the command line, type the following:</para><screen>$ <command>beadm create <replaceable>beName</replaceable></command></screen><para><literal>beName</literal> is a variable for the name of the new boot
environment. This new boot environment is inactive.</para><note><para><command>beadm create</command> does not create a partial boot
environment. The command either successfully creates a full boot environment,
or the command fails.</para>
</note>
</step><step performance="optional"><para>You can use the <command>beadm mount</command> command to mount the new boot environment as follows:</para><screen>$ <command>beadm mount <replaceable>beName</replaceable> <replaceable>mountpoint</replaceable></command></screen><note><para>If the directory for the mount point does not exist, the <command>beadm</command> utility creates the directory, then mounts the boot environment
on that directory.</para><para>If the boot environment is already mounted,
the <command>beadm mount</command> command fails and does not remount the
boot environment at the newly specified location.</para>
</note><para>The boot environment is mounted, but remains inactive. You can upgrade
a mounted, inactive boot environment.</para><note><para>Unmount the boot environment before rebooting.</para>
</note>
</step><step performance="optional"><para>If you want to boot to this new boot environment,
use the following command to activate the boot environment:</para><screen>$ <command>beadm activate <replaceable>beName</replaceable></command></screen><para><replaceable>beName</replaceable> is a variable for the name of the
boot environment to be activated.</para><para>On reboot, the newly active boot environment is displayed as the default
selection in the x86 GRUB menu or the SPARC boot menu.</para><note><para>The GRUB menu or boot menu always displays the mostly recently
activated boot environment as the default.</para>
</note>
</step>
</procedure><example id="ieclone"><title>Creating a New, Cloned Boot Environment with Datasets (BE2)</title><para>The following example illustrates the datasets in a newly created boot
environment.</para><para>Type the following command.</para><screen>$ <command>beadm create <replaceable>BE2</replaceable></command></screen><para>The original boot environment in this example is BE1. The new boot environment,
BE2, contains separate datasets cloned from BE1. If BE1 contains separate
datasets for traditional file systems, such as <literal>/var</literal> or <literal>/opt</literal>, then those datasets are also cloned.</para><screen>rpool/ROOT/BE1
rpool/ROOT/BE1/usr
rpool/ROOT/BE1/var
rpool/ROOT/BE1/opt</screen><screen>rpool/ROOT/BE2
rpool/ROOT/BE2/usr
rpool/ROOT/BE2/var
rpool/ROOT/BE2/opt</screen><para><filename>rpool</filename> in this example is the name of the storage
pool.  The pool already exists on the system, previously set up by the initial
installation or upgrade.  ROOT is a special dataset that was also created
previously by the initial installation or upgrade. ROOT is reserved exclusively
for use by boot environment roots.</para>
</example><example id="ieshared"><title>Creating a New Boot Environment With Shared Datasets</title><para>The following example illustrates a newly&hyphen;created boot environment
that has shared datasets.</para><para>Shared datasets are user-defined files, such as <filename>/export</filename>, that contain the same mount point in both the active and inactive boot
environments. Shared datasets are located outside the root dataset area of
each boot environment.</para><para>Type the following command.</para><screen>$ <command>beadm create <replaceable>BE2</replaceable></command></screen><para>The shared datasets, <literal>rpool/export</literal> and <literal>rpool/export/home</literal>, are not cloned when the boot environment is cloned. The shared datasets
are located outside the <literal>rpool/ROOT/&lt;BE&gt;</literal> datasets and
are referenced at their original locations by the cloned boot environment.</para><para>The original boot environment, BE1 and datasets are as follows:</para><screen>rpool/ROOT/BE1
rpool/ROOT/BE1/usr
rpool/ROOT/BE1/var
rpool/ROOT/BE1/opt
rpool/export
rpool/export/home</screen><para>The cloned boot environment, BE2, has new root datasets, but the original
shared datasets, <literal>rpool/export</literal> and <literal>rpool/export/home</literal>, are unchanged.</para><screen>rpool/ROOT/BE2
rpool/ROOT/BE2/usr
rpool/ROOT/BE2/var
rpool/ROOT/BE2/opt
rpool/export
rpool/export/home</screen>
</example>
</task><task id="inactive"><title>How to Create a Boot Environment From an Inactive
Boot Environment</title><tasksummary><para>By default, a new boot environment is created from the active boot environment.
However, you can use the <command>beadm create</command> command to create
a new boot environment that is based on an existing, inactive boot environment.</para>
</tasksummary><procedure><step><para>Become superuser or assume an equivalent role.</para>
</step><step><para>To create a new, inactive BE from an existing, inactive boot environment,
type the following command:</para><screen>$ <command>beadm create <option>e</option> <replaceable>non-activeBeName</replaceable> <replaceable>beName</replaceable></command></screen><para><replaceable>non-activeBeName</replaceable> is a variable for the existing
inactive BE that is cloned by this command.</para><para><replaceable>beName</replaceable> is the variable for the new BE name.</para><para>By default, the new boot environment is inactive.</para>
</step>
</procedure>
</task>
</sect1><sect1 id="snapshot"><title>Taking a Snapshot of a Boot Environment</title><para>You can manually create a snapshot of an existing boot environment for
your reference. This snapshot is a read-only image of a dataset or boot environment
at a given point in time. You can create a custom name for the snapshot that
indicates when the snapshot was created or what it contains.</para><task id="snapshot2"><title>How to Create a Snapshot of a Boot Environment</title><procedure remap="single-step"><step><para>Use the following command to create a snapshot.</para><screen>$ <command>beadm create <replaceable>BEname@snapshotdescription</replaceable></command></screen><para>Replace the variable, <replaceable>BEname@snapshotdescription</replaceable>, with a custom name for your snapshot. The custom name must use the format <replaceable>BEname@snapshotdescription</replaceable>, where <replaceable>BEname</replaceable> is the name of an existing boot environment that you want to make a snapshot
from. Type a custom <replaceable>snapshotdescription</replaceable> to identify
the date or purpose of the snapshot.</para><itemizedlist><para>Sample snapshot names include:</para><listitem><para><literal>BE1@0312200.12:15pm</literal></para>
</listitem><listitem><para><literal>BE2@backup</literal></para>
</listitem><listitem><para><literal>BE1@march132008</literal></para>
</listitem>
</itemizedlist>
</step>
</procedure>
</task>
</sect1><sect1 id="usesnap"><title>Using an Existing Snapshot</title><para>A snapshot of a boot environment is not bootable. However, you can create
a new boot environment from an existing snapshot. Then you can activate and
boot that new boot environment.</para><task id="usesnap2"><title>How to Create a Boot Environment From an Existing
Snapshot</title><procedure remap="single-step"><step><para>Use the following command to create a new boot environment from
a snapshot.</para><screen>$ <command>beadm create <option>e</option> <replaceable>BEname@snapshotdescription</replaceable> <replaceable>beName</replaceable></command></screen><para>Replace the variable, <replaceable>BEname@snapshotdescription</replaceable>, with the name of an existing snapshot. As described in the previous task,
snapshot names use the format <replaceable>BEname@snapshotdescription</replaceable>, where <replaceable>BEname</replaceable> is the name of an existing boot
environment, and <replaceable>snapshotdescription</replaceable> is a description
of a specific snapshot made from the existing boot environment.</para><para>Replace the variable, <replaceable>BEname</replaceable>, with a custom
name for your new boot environment.</para><para>See the following example.</para><screen>$ <command>beadm create <option>e</option> <replaceable>BE1@now</replaceable> <replaceable>BE2</replaceable></command></screen><para>This command creates a new boot environment, named BE2, from the existing
snapshot named BE1@now. You can active this boot environment by using the
next procedure.</para>
</step>
</procedure>
</task>
</sect1><sect1 id="default"><title>Changing the Default Boot Environment</title><para>You can change an inactive boot environment into an active boot environment.
Only one boot environment can be active at a time. The newly activated boot
environment becomes the default environment upon reboot.</para><task id="activate"><title>How to Activate an Existing Boot Environment</title><procedure><step><para>Use the following command to activate an existing, inactive boot
environment:</para><screen>$ <command>beadm activate <replaceable>beName</replaceable></command></screen><para><replaceable>beName</replaceable> is a variable for the name of the
boot environment to be activated.</para><para>Note the following specifications.</para><itemizedlist><listitem><para><command>beadm activate <replaceable>beName</replaceable></command> activates a boot environment by setting the bootable pool property, <literal>bootfs</literal>, to the value of the ROOT dataset of the boot environment
that is being activated.</para>
</listitem><listitem><para><command>beadm activate</command> sets the newly activated
boot environment as the default in the <literal>menu.lst</literal> file.</para><note><para>When a boot environment is created, whether it is active or inactive,
an entry is created for the boot environment on the x86 GRUB menu or the SPARC
boot menu. The default boot environment is the last boot environment that
was activated.</para>
</note>
</listitem>
</itemizedlist>
</step><step><para>Reboot.</para><para>The newly activated boot environment is now
the default on the x86 GRUB menu or SPARC boot menu.</para><note><para>If the boot environment fails to boot, reboot and select the previous
boot environment from the GRUB menu or the boot menu.</para>
</note>
</step>
</procedure>
</task>
</sect1><sect1 id="mount"><title>Mounting and Updating an Inactive Boot Environment</title><para>If you want to update packages on an existing, inactive boot environment,
you can mount that environment and then update the packages on it.</para><task id="mount2"><title>How to Mount a Boot Environment</title><procedure><step><para>You can use the <command>beadm mount</command> command to mount
a boot environment as follows:</para><screen>$ <command>beadm mount <replaceable>beName</replaceable> <replaceable>mountpoint</replaceable></command></screen><note><para>If the directory for the mount point does not exist, the <command>beadm</command> utility creates the directory, then mounts the boot environment
on that directory.</para><para>If the boot environment is already mounted,
the <command>beadm mount</command> command fails and does not remount the
boot environment at the newly specified location.</para>
</note><para>The boot environment is mounted but remains inactive.</para>
</step><step performance="optional"><para>You can update packages on the boot environment
by using one of the following options:</para><stepalternatives><step><para>Use the <command>pkg image-update</command> command with the <option>R</option> option to update all packages on the boot environment as follows:</para><screen>$ <command>pkg <option>R</option> <replaceable>/mnt</replaceable> image-update</command></screen><para>Where <replaceable>/mnt</replaceable> is the mount point for the boot
environment.</para>
</step>
</stepalternatives>
</step><step><para>Use the <command>pkg install</command> command with the <option>R</option> option to update specific packages on the boot environment as
follows:</para><screen>$ <command>pkg <option>R</option> <replaceable>/mnt</replaceable> install <replaceable>packagename</replaceable></command></screen><para>Where <replaceable>/mnt</replaceable> is the mount point for the boot
environment.</para><note><para>Unmount the boot environment before rebooting.</para>
</note>
</step>
</procedure>
</task><sect2 id="unmount"><title>Unmounting Boot Environments</title><para>You can use the <command>beadm</command> command to unmount an existing
boot environment.</para><note><para>You cannot unmount the boot environment that is currently booted.</para>
</note><task id="unmount2"><title>How to Unmount an Existing Boot Environment</title><procedure remap="single-step"><step><para>To unmount the boot environment, type the following:</para><screen>$ <command>beadm unmount <replaceable>beName</replaceable></command></screen>
</step>
</procedure>
</task>
</sect2>
</sect1><sect1 id="destroy"><title>Destroying a Boot Environment</title><para>If you want to make more room available on your system, you can use
the <command>beadm</command> command to destroy an existing boot environment.</para><itemizedlist><para>Note the following specifications:</para><listitem><para>You cannot destroy the boot environment that is currently
booted.</para>
</listitem><listitem><para>The <command>beadm destroy</command> command automatically
removes the destroyed boot environment's entry from the x86 GRUB menu or the
SPARC boot menu.</para>
</listitem><listitem><para>The <command>beadm destroy</command> command destroys only
the critical or nonshared datasets of the boot environment. Shared datasets
are located outside of the boot environment root dataset area and are not
affected when a boot environment is destroyed.</para><para>See the following
example, where BE1 and BE2 share the <filename>rpool/export</filename> and <filename>rpool/export/home</filename> datasets. The datasets include the following:</para><screen>rpool/ROOT/BE1
rpool/ROOT/BE1/opt
rpool/ROOT/BE2
rpool/ROOT/BE2/opt
rpool/export
rpool/export/home</screen><para>Destroy BE2 by using the following command:</para><screen><command>beadm destroy <replaceable>BE2</replaceable></command></screen><para>The shared datasets, <filename>rpool/export</filename> and <filename>rpool/export/home</filename>, are not destroyed when the boot environment
BE2 is destroyed. The following datasets remain.</para><screen>rpool/ROOT/BE1
rpool/ROOT/BE1/opt
rpool/export
rpool/export/home</screen>
</listitem>
</itemizedlist><task id="destroy2"><title>How to Destroy an Existing Boot Environment</title><procedure remap="single-step"><step><para>To destroy a boot environment, type the following:</para><screen>$ <command>beadm destroy <replaceable>beName</replaceable></command></screen><note><para>The <command>beadm destroy</command> command asks for confirmation
before destroying the boot environment. Add the <literal>-F</literal> option
to the <command>beadm destroy</command> command to force destruction of the
boot environment without a confirmation request. Add the <option>f</option> option to force destruction of the boot environment even if its mounted.</para>
</note>
</step>
</procedure>
</task>
</sect1><sect1 id="custom"><title>Creating Custom Names for Boot Environments</title><para>The <command>beadm rename</command> command enables you to rename an
existing boot environment. This command enables you to create a custom name
for a boot environment, a name that is more meaningful for your particular
situation. For example, you could rename boot environments to specify how
you customized that environment. The boot environment's dataset name is also
changed to conform with the new boot environment name. </para><note><para>An active boot environment cannot be renamed. Only an inactive
boot environment can be renamed. If you want to rename the active boot environment,
first, make a different boot environment active.</para>
</note><task id="rename"><title>How to Rename a Boot Environment</title><procedure remap="single-step"><step><para>Use the following command to rename the boot environment:</para><screen>$ <command>beadm rename <replaceable>beName</replaceable> <replaceable>newBeName</replaceable></command></screen><note><para>If the new name is already in use, the <command>beadm rename</command> command fails.</para>
</note>
</step>
</procedure>
</task>
</sect1>
</chapter><chapter id="zones"><title><command>beadm</command> Zones Support</title><highlights><caution><para><emphasis role="strong">This document is in development for
an upcoming release.</emphasis></para>
</caution><para>Zones partitioning technology is used to virtualize operating system
services and provide an isolated and secure environment for running applications.
Each OpenSolaris system is a global zone. Within a global zone, specific non-global
zones can be created.</para><para>For information about creating and administering non-global zones on
your system, see the zones section in the <ulink url="http://dlc.sun.com/osol/docs/content/SYSADRM/zones.intro-2.html" type="text"><citetitle>System Administration Guide: Virtualization Using the Solaris Operating System</citetitle></ulink>.</para><para>The <command>beadm</command> utility includes support for non-global
zones.</para>
</highlights><sect1 id="zonelimit"><title>Zones Support Limitations</title><itemizedlist><para>Note the following limitations of support for non-global zones in the <command>beadm</command> utility and in related processes:</para><listitem><para>When you use the <command>pkg image-update</command> command,
the command only upgrades ipkg branded zones.</para>
</listitem><listitem><para>The <command>beadm</command> utility is not supported inside
a non-global  zone.</para>
</listitem><listitem><para>Non-global zone support is limited to ZFS support. Zones are
not supported unless they are on ZFS.</para>
</listitem><listitem><para>Zones are not supported in the <literal>rpool/ROOT</literal> namespace. Non-global zones are cloned or copied only when the original
zone is within the shared area for the global zone, for example, within <filename>rpool/export</filename> or within <filename>rpool/zones</filename>.</para>
</listitem><listitem><para>Although the <command>beadm</command> utility affects the
non-global zones on your system, the <command>beadm</command> utility does
not display zones information. Use the <command>zoneadm</command> utility
to view changes in the zones in your boot environment. For example, use the <command>zoneadm list</command> command to view a list of all current zones on the
system.</para><para>For further information, see the <citerefentry><refentrytitle>zoneadm</refentrytitle><manvolnum>1M</manvolnum></citerefentry> man page.</para>
</listitem>
</itemizedlist>
</sect1><sect1 id="zonesupport"><title>Zones Support Specifications</title><para>The <command>beadm</command> command impacts the non-global zones in
your boot environments as follows.</para><variablelist><varlistentry><term><command>beadm create</command></term><listitem><para>When you clone a boot environment by using the <command>beadm
create</command> command, all zones in that boot environment are copied into
the new boot environment.</para>
</listitem>
</varlistentry><varlistentry><term><command>beadm destroy</command></term><listitem><para>When you destroy an inactive boot environment, the zones that
belong to that boot environment are also destroyed.</para>
</listitem>
</varlistentry><varlistentry><term><command>beadm mount</command></term><listitem><para>When you mount a boot environment, the zones in that environment
are mounted relative to the mount points for the environment.</para>
</listitem>
</varlistentry><varlistentry><term><command>beadm unmount</command></term><listitem><para>When you unmount a boot environment, the zones in that environment
are also unmounted. All mount points are returned to their states prior to
being mounted.</para>
</listitem>
</varlistentry><varlistentry><term><command>beadm rename</command></term><listitem><para>When you rename a boot environment, that change does not impact
the names of the zones or the names of the datasets that are used for those
zones in that boot environment.  The change does not impact the relationships
between the zones and their related boot environments.</para>
</listitem>
</varlistentry>
</variablelist>
</sect1><sect1 id="zonename"><title>Zones Naming Conventions</title><para>The <command>beadm</command> utility automatically handles all zones
naming tasks related to the <command>beadm</command> processes. Just for your
reference, this section describes the zones naming conventions that are automatically
used by the <command>beadm</command> utility.</para><para>A zone root dataset name is stated in the following format:</para><screen><filename>&lt;zonepath dataset&gt;/ROOT/&lt;zone root&gt;</filename></screen><para>For example:</para><screen><filename>rpool/zones/zone1/ROOT</filename></screen><para>When a zone is copied from one boot environment to another boot environment,
only the datasets that are under the zone's root dataset are copied.</para><para>A dataset can be shared between zone boot environments. A shared dataset
is identified by using the following format:</para><screen><filename>&lt;zonepath dataset&gt;/export</filename></screen><para>For example:</para><screen><filename>rpool/zones/zone1/export</filename></screen><para>A shared dataset must be explicitly added during zones configuration.
A shared dataset is not cloned when the zone dataset is cloned.</para><example id="ienonglobal"><title>Non-Global Zones Example</title><para>This example shows the zones impact of the <command>beadm create</command> command when cloning a boot environment that contains two non-global zones.</para><itemizedlist><listitem><para>The original boot environment is named <filename>opensolaris</filename> with the dataset at <filename>rpool/ROOT/opensolaris</filename>.</para>
</listitem><listitem><para>A zone named <filename>z1</filename> exists that uses the
dataset, <filename>rpool/zones/z1</filename>, as its zonepath. The boot environment
has a copy of <filename>rpool/zones/z1</filename>. The copy is <filename>rpool/zones/z1/ROOT/zbe</filename>.</para>
</listitem>
</itemizedlist><para>Perform the following command to clone the boot environment and name
the new boot environment <filename>opensolaris-1</filename>:</para><screen><command>beadm create <replaceable>opensolaris-1</replaceable></command></screen>
</example><para>The root dataset for the new boot environment is at <filename>rpool/ROOT/opensolaris-1</filename>. The copy of zone <filename>z1</filename> for the new boot environment has
its root dataset at <filename>rpool/zones/z1/ROOT/zbe-1</filename>.</para><note><para>ZFS properties for each dataset track the relationships between
original and cloned datasets, and track the relationships between non-global
zones and their parent boot environments.</para>
</note>
</sect1><sect1 id="resources"><title>Additional Resources</title><para>For further information about the OpenSolaris operating system, see
the following references.</para><table frame="topbot" id="tblresource"><title>OpenSolaris Documentation</title><tgroup cols="2" colsep="0" rowsep="0"><colspec colwidth="50*"/><colspec colwidth="50*"/><thead><row rowsep="1"><entry><para>Document</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry><para><ulink url="http://dlc.sun.com/osol/docs/content/2009.06/getstart/" type="text">Getting Started
With OpenSolaris</ulink></para>
</entry><entry><para>Instructions for installing and upgrading the OpenSolaris operating
system</para>
</entry>
</row><row><entry><para><ulink url="http://dlc.sun.com/osol/docs/content/2009.06/IMGPACKAGESYS/index.html" type="text">OpenSolaris Image Packaging System Guide</ulink></para>
</entry><entry><para>Instructions for using the Package Manager and the <command>pkg</command> command to install and update packages on your OpenSolaris system.</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</sect1>
</chapter><chapter id="reference"><title>Appendix: <command>beadm</command> Reference</title><highlights><caution><para><emphasis role="strong">This document is in development for
an upcoming release.</emphasis></para>
</caution><para>The <command>beadm</command> command, <filename>/usr/sbin/beadm</filename>, enables users to manage their boot environments. The following table summarizes
the subcommands and options for the <command>beadm</command> utility.</para>
</highlights><sect1 id="reference2"><title><command>beadm</command> Command Reference</title><table frame="topbot" pgwide="1" id="tblreference"><title><command>beadm</command> Command</title><tgroup cols="2" colsep="0" rowsep="0"><colspec colwidth="21.13*"/><colspec colwidth="78.87*"/><thead><row rowsep="1"><entry><para>Subcommands</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry><para><command>beadm</command></para>
</entry><entry><para>Displays command usage.</para>
</entry>
</row><row><entry><para><command>beadm activate</command></para>
</entry><entry><para>Makes <literal>beName</literal> the active boot environment on next
reboot.</para><para>Syntax: <command>beadm activate beName</command></para>
</entry>
</row><row><entry><para><command>beadm create</command></para>
</entry><entry><para>Creates a new boot environment name, beName. Unless the <option>e</option> option is provided, the new boot environment is created as a clone of the
currently running boot environment.</para><para>Syntax: <command>beadm create [-a] [-d description] [-e non-activeBeName
| beName@snapshot] [-o property=value] beName</command></para><itemizedlist><listitem override="none"><para><literal>-a</literal> &ndash; Activate the
newly created boot environment upon creation. The default is to not activate
the newly created boot environment.</para>
</listitem><listitem><para><literal>-d description</literal> &ndash; Use this description
as the title in the x86 GRUB menu or the SPARC boot menu that describes this
new boot environment. If this option is not used, beName is used for the title.</para>
</listitem><listitem override="none"><para><literal>-e non-activeBeName</literal> &ndash;
Create a new boot environment from an existing, inactive boot environment.
The default is to create the boot environment from the active boot environment.</para>
</listitem><listitem override="none"><para><literal>-e beName@snapshot</literal> &ndash;
Create a new boot environment from an existing snapshot of the boot environment
named beName.</para>
</listitem><listitem override="none"><para><literal>-o property=value</literal> &ndash;
Create the datasets for new boot environment with specific ZFS properties.
Multiple <literal>-o</literal> options can be specified. See <command>zfs(1M)</command> for more information on the <option>o</option> option.</para>
</listitem><listitem override="none"><para><literal>beName</literal> &ndash; Name of
the boot environment to create.</para>
</listitem><listitem override="none"><para><literal>beName@snapshot</literal> &ndash;
Name of an existing snapshot of the boot environment named beName.</para>
</listitem>
</itemizedlist>
</entry>
</row><row><entry><para><command>beadm create beName@snapshot</command></para>
</entry><entry><para>Creates a snapshot of the existing boot environment named beName.</para><para>Syntax: <command>beadm create beName@snapshot</command></para><para><literal>beName@snapshot</literal> &ndash; The snapshot name must use
the format, <command>beName@snapshotdescription</command>, where <command>beName</command> is the name of an existing boot environment that you want
to make a snapshot from. Enter a custom <command>snapshotdescription</command> to identify the date or purpose of the snapshot.</para>
</entry>
</row><row><entry><para><command>beadm destroy</command></para>
</entry><entry><para>Destroys the boot environment named <command>beName</command> or destroys
an existing snapshot, <command>beName@snapshot</command>, of a boot environment.
Prompts for confirmation before destroying the boot environment.</para><para>Syntax: <command>beadm destroy [-fF] beName | beName@snapshot</command></para><itemizedlist><listitem override="none"><para><literal>-f</literal> &ndash; Forces destruction
of the boot environment even if it is mounted.</para>
</listitem><listitem override="none"><para><literal>-F</literal> &ndash; Forces destruction
of the boot environment without prompting for confirmation.</para>
</listitem>
</itemizedlist>
</entry>
</row><row><entry><para><command>beadm list</command></para>
</entry><entry><para>Lists information about the existing boot environment, which is <command>beName</command>, or lists information for all boot environments if <command>beName</command> is not provided. The default is to list boot environments
without any additional information.</para><para>Syntax: <literal>beadm list [-a | [-ds] [-H] [beName]</literal></para><itemizedlist><listitem override="none"><para><literal>-a</literal> &ndash; Lists all available
information about the boot environment.  This information includes subordinate
datasets and snapshots.</para>
</listitem><listitem override="none"><para><literal>-d</literal> &ndash; Lists information
about all subordinate datasets hat belong to the boot environment.</para>
</listitem><listitem override="none"><para><literal>-s</literal> &ndash; Lists information
about the snapshots of the boot environment.</para>
</listitem><listitem override="none"><para><literal>-H</literal> &ndash; Prevents listing
header information. Each field in the output is separated by a semicolon.</para><para>The example is displayed without a header:</para><screen>BE2:no:yes:mounted:/pool1/BE/BE2:6.2G;;;</screen><itemizedlist><para>Without header information, the display information is identified by
the following delimiters:</para><listitem><para><literal>;</literal> &ndash; Delimits boot environments, datasets,
zones, and snapshots.</para>
</listitem><listitem><para><literal>:</literal> &ndash; Delimits attributes for boot
environments, datasets, zones, and snapshots.</para>
</listitem><listitem><para><literal>,</literal> &ndash; Delimits multiple datasets, zones,
and snapshots.</para>
</listitem><listitem><para>Multiple boot environments are delimited with a return, a
blank line.</para>
</listitem>
</itemizedlist><note><para>The <option>p</option> option can be combined with the other options.</para>
</note>
</listitem><listitem override="none"><para><literal>beName</literal> &ndash; If <command>beName</command> is not provided, the command results display information
for all boot environments. </para>
</listitem>
</itemizedlist>
</entry>
</row><row><entry><para><command>beadm mount</command></para>
</entry><entry><para>Mounts a boot environment named <command>beName</command> at mount point.
The mount point must be an already existing, empty directory.</para><para>Syntax: <command>beadm mount beName mountpoint</command></para><note><para>Unmount the boot environment before rebooting.</para>
</note>
</entry>
</row><row><entry><para><command>beadm rename</command></para>
</entry><entry><para>Renames the boot environment named <command>beName</command> to <command>newBeName</command>.</para><para>Syntax: <literal>beadm rename beName newBeName</literal></para>
</entry>
</row><row><entry><para><command>beadm unmount</command></para>
</entry><entry><para>Unmounts the boot environment named <command>beName</command>.</para><para>Syntax: <command>beadm unmount [-f] beName</command></para><para><literal>-f</literal> &ndash; Forcefully unmounts the boot environment
even if it is currently busy.</para>
</entry>
</row>
</tbody>
</tgroup>
</table><para>For detailed instructions about the <command>beadm</command> utility,
see the <citerefentry><refentrytitle>beadm</refentrytitle><manvolnum>1M</manvolnum></citerefentry> man page.</para>
</sect1>
</chapter>