Skip Navigation Links | |
Exit Print View | |
Creating and Administering Oracle Solaris 11.1 Boot Environments Oracle Solaris 11.1 Information Library |
1. Introduction to Managing Boot Environments
3. Creating Boot Environments and Snapshots
Creating and Copying Snapshots
Creating a Snapshot of a Boot Environment
Creating a Boot Environment From an Existing Snapshot
How to Create a Boot Environment From a Snapshot
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 beadm command to create and mount a new boot environment that is a clone of your active boot environment. This clone is listed as an alternate boot environment in the GRUB menu for x86 systems or in the boot menu for SPARC systems.
When you clone a boot environment by using the beadm create command, all supported zones in that boot environment are copied into the new boot environment.
The beadm create command has the following options, where BeName specifies the name of the boot environment to be created.
beadm create [-a] [-d description] [-e non-activeBeName | BeName@snapshot] [-o property=value]...[-p zpool] BeName
-a – Activate the newly created boot environment upon creation. The default is to not activate the newly created boot environment.
-d description – Provide a custom description to be used as the title in the x86 GRUB menu or the SPARC boot menu to describe the new boot environment. If this option is not used, BeName is used for the title.
-e non-activeBeName – Create a new boot environment from a specified existing, but inactive, boot environment. The default is to create the boot environment from the active boot environment.
-e BeName@snapshot – Create a new boot environment from a specified, existing snapshot of the boot environment.
-o property=value – Create the datasets for a new boot environment with specific ZFS properties. Multiple -o options can be specified. See the zfs(1M) man page for more information on the -o option.
-p zpool – Create the datasets for a new boot environment within a specified zpool. If this option is not provided, the default behavior is to create the new boot environment in the same pool as the original boot environment. The -p option is not supported within a non-global zone. This option can be combined with the other options.
For more information, see How to Use Your Assigned Administrative Rights in Oracle Solaris 11.1 Administration: Security Services.
# beadm create BeName
BeName is the name of the new boot environment. This new boot environment is inactive.
Note the following:
BeName cannot be a boot environment name that is already being used.
This command clones the active boot environment, unless the -e option is used to specify an inactive boot environment.
beadm create does not create a partial boot environment. The command either successfully creates a full boot environment, or the command fails.
# beadm mount BeName mount-point
You might mount the new boot environment, for example, if you want to modify some configuration files inside the new boot environment before rebooting into it.
The boot environment is mounted but remains inactive. You can upgrade a mounted, inactive boot environment.
Note - If the directory for the mount point does not exist, the beadm utility creates the directory, then mounts the boot environment on that directory.
If the boot environment is already mounted, the beadm mount command fails and does not remount the boot environment at the newly specified location.
# beadm activate BeName
BeName is the name of the boot environment to be activated.
On reboot, the newly active boot environment is displayed as the default selection in the x86 GRUB menu or the SPARC boot menu.
Note - The GRUB menu or boot menu always displays the most recently activated boot environment as the default.
The following examples illustrate how to create boot environments, and how the creation process varies depending on the zone and dataset structure. The first example illustrates how cloning operates in a system that includes global and non-global zones. The second example shows dataset specifics related to cloning.
Note - For zones and dataset information, see the following:
Example 3-1 Cloning a Boot Environment in a Global Zone That Contains Non-Global Zones
This example shows the zones impact of the beadm create command when you are cloning a boot environment in a global zone that contains non-global zones.
If the boot environment being cloned has an associated zone boot environment in a non-global zone, that associated boot environment is also cloned. For example, BE1 has an associated zone boot environment, BE2, in a non-global zone. If BE1 is cloned, BE2 is also cloned.
In this example, the original boot environment in the global zone is named solaris with its root dataset at rpool/ROOT/solaris.
A non-global zone named z1 exists that has the dataset rpool/zones/z1 as its zonepath. The original solaris boot environment in the global zone has an associated boot environment in the z1 non-global zone. This associated zone boot environment is named solaris, with a root dataset at rpool/zones/z1/rpool/ROOT/solaris.
In this example, you would issue the following command as root to clone the boot environment in the global zone and name the new boot environment solaris-1:
# beadm create solaris-1
The clone is named solaris-1, with a root dataset at rpool/ROOT/solaris-1.
Note that because the solaris boot environment in the global zone has an associated zone boot environment in the z1 non-global zone, the cloning process also clones the associated zone boot environment in z1. The new solaris-1 clone in zone z1 has its root dataset at rpool/zones/z1/rpool/ROOT/solaris-1.
Example 3-2 Creating a New, Cloned Boot Environment with Datasets
This example illustrates how datasets are set up in a newly created boot environment. This example does not involve multiple zones.
As root, you would type the following command.
# beadm create BE2
The original boot environment in this example is BE1 with a root dataset at rpool/ROOT/BE1 containing another dataset, var.
rpool/ROOT/BE1 rpool/ROOT/BE1/var
After BE1 is cloned, the new clone, BE2, contains a root dataset and other nested datasets, all cloned from BE1. Because BE1 contains the /var file system under the root dataset, /var was also cloned.
rpool/ROOT/BE2 rpool/ROOT/BE2/var
In contrast, if there was a shared file system outside of the root dataset, that shared file system would not have been cloned. The original boot environment and the clone would both “share” the original shared file system, as shown in the next example.
Example 3-3 Creating a New Boot Environment With Existing Shared Datasets
This example illustrates creating a new boot environment when there are existing shared datasets. In this example, the original boot environment is BE1, and the shared datasets are rpool/export and rpool/export/home. This example does not involve multiple zones.
As root, you would type the following command to clone BE1 and name the clone BE2:
# beadm create BE2
The shared datasets, rpool/export and rpool/export/home, are not cloned when the boot environment is cloned. The shared datasets are located outside the rpool/ROOT/BeName datasets and are referenced at their original locations by the cloned boot environment, BE2.
The original boot environment, BE1, and datasets are as follows:
rpool/ROOT/BE1 rpool/ROOT/BE1/var rpool/export rpool/export/home
The root dataset is at rpool/ROOT/BE1 and a /var dataset is located under the root dataset. The root dataset and /var are both cloned.
The cloned boot environment, BE2, has new root dataset and a new /var dataset, but the original shared datasets, rpool/export and rpool/export/home, are unchanged.
rpool/ROOT/BE2 rpool/ROOT/BE2/var rpool/export rpool/export/home