|Skip Navigation Links|
|Exit Print View|
|Booting and Shutting Down Oracle Solaris on x86 Platforms Oracle Solaris 11 Information Library|
The following tasks describe how to create and administer boot environments, snapshots, and datasets by using the beadm utility.
A boot environment (BE) is a ZFS file system that is designated for booting. A boot environment is essentially a bootable instance of the Oracle Solaris OS image, plus any other software packages that are installed into that image. You can maintain multiple boot environments on a single system. Each boot environment can have different OS versions installed. When you install Oracle Solaris, a new boot environment is automatically created during the installation.
A snapshot is a read-only image of a dataset or boot environment that is taken at a given point in time. Note that a snapshot is not bootable. However, you can create a boot environment that is based on a particular snapshot and then activate that new boot environment so that it becomes the default boot environment upon the next system reboot.
A dataset is a generic term that is used to identify a ZFS file system, clone, snapshot, or volume.
Shared datasets are user-defined directories, such as /export, 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.
A boot environment's critical datasets are included within the root dataset area for that environment.
For more information about the beadm utility, see the beadm(1M) man page. For more information about managing boot environments, see Creating and Administering Oracle Solaris 11 Boot Environments. For specific information about using the beadm utility in a global or non-global zones environment, see Chapter 2, beadm Zones Support, in Creating and Administering Oracle Solaris 11 Boot Environments.
# beadm create beName
where beName is a variable for the name of the new boot environment. This new boot environment is inactive.
Note - The beadm create command does not create a partial boot environment. Either a new, full boot environment is successfully created, or the command fails.
# beadm mount beName mountpoint
If the directory for the mount point does not exist, the beadm command 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 new location.
The boot environment is mounted, but remains inactive. Note that you can upgrade a mounted, inactive boot environment. Also, remember to unmount the boot environment before rebooting your system.
# beadm activate beName
where beName is a variable for the name of the boot environment to be activated. Upon reboot, the newly active boot environment becomes the default boot entry that is listed in the GRUB menu.
Example 7-1 Creating a Cloned Boot Environment With Shared Datasets
The following example shows the datasets in a newly created boot environment named BE2. The original boot environment in this example is BE1. The new boot environment, BE2, contains separate datasets that were cloned from BE1. If BE1 contains separate datasets for traditional file systems, such as /opt, then those datasets are also cloned.
# beadm create BE2 # beadm list -a BE2 BE/Dataset/Snapshot Active Mountpoint Space Policy Created ------------------- ------ ---------- ----- ------ ------- BE2 rpool/ROOT/BE2 - - 42.0K static 2011-04-07 10:56
As shown in the previous output, the name of the storage pool is rpool. The pool already exists on the system, as it was previously set up by the initial installation or an 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.
# beadm create beName@snapshot
Example snapshot names include the following:
# beadm create -e BEname@snapshotdescription beName
Replace BEname@snapshotdescription with the name of an existing snapshot and beName with a custom name for the new boot environment.
# beadm create -e BE1@now BE2
This command creates a new boot environment named BE2 from the existing snapshot named BE1@now. You can then active the boot environment. For instructions, see How to Activate a Newly Created Boot Environment.
You can activate a newly created boot environment so that upon reboot it is the default boot environment that is booted. Note that only one boot environment can be active at any given time.
# beadm activate beName
where beName is a variable for the boot environment to be activated.
Note the following:
The beadm activate beName command activates the boot environment by setting the bootfs bootable pool property to the value of the ROOT dataset of the boot environment that is being activated.
The beadm activate command sets the newly activated boot environment as the default in the menu.lst file.
The newly activated boot environment is now the default entry in the x86 GRUB menu.
Note - If the boot environment fails to boot, reboot and select the previous boot environment from the GRUB menu or the boot menu.
To display available boot environments, snapshots, and datasets that were created by using the beadm command, use the beadm list command.
# beadm list option
Lists all available information about the boot environment. This option includes subordinate snapshots and datasets.
Lists information about a boot environment's datasets.
Lists information about a boot environment's snapshots. This option is used in conjunction with the -d option.
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.
For example, to list all of the available datasets in the oracle-solaris boot environment, you would type the following command:
# beadm list -a oracle-solaris BE/Dataset/Snapshot Active Mountpoint Space Policy Created ------------------- ------ ---------- ----- ------ ------- oracle-solaris rpool/ROOT/solaris - - 14.33M static 2011-01-20 07:45
Example 7-2 Viewing Snapshot Specifications
The following beadm list example includes the -s option, which displays information for any snapshots that exist on the current image.
In the following sample results, each snapshot title includes a time stamp, indicating when that snapshot was taken.
# beadm list -s test-2
The sample results are displayed.
BE/Snapshot Space Policy Created ----------- ----- ------ ------- test-2 test-2@2010-04-12-22:29:27 264.02M static 2010-04-12 16:29 test-2@2010-06-02-20:28:51 32.50M static 2010-06-02 14:28 test-2@2010-06-03-16:51:01 16.66M static 2010-06-03 10:51 test-2@2010-07-13-22:01:56 25.93M static 2010-07-13 16:01 test-2@2010-07-21-17:15:15 26.00M static 2010-07-21 11:15 test-2@2010-07-25-19:07:03 13.75M static 2010-07-25 13:07 test-2@2010-07-25-20:33:41 12.32M static 2010-07-25 14:33 test-2@2010-07-25-20:41:23 30.60M static 2010-07-25 14:41 test-2@2010-08-06-15:53:15 8.92M static 2010-08-06 09:53 test-2@2010-08-06-16:00:37 8.92M static 2010-08-06 10:00 test-2@2010-08-09-16:06:11 193.72M static 2010-08-09 10:06 test-2@2010-08-09-20:28:59 102.69M static 2010-08-09 14:28 test-2@install 205.10M static 2010-03-16 19:04
If you want to make more disk space available on your system, you can use the beadm command to destroy (remove) an existing boot environment.
Note the following:
You cannot destroy the boot environment that is currently booted.
The beadm destroy command automatically removes the destroyed boot environment's entry from the x86 GRUB menu.
The beadm destroy 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.
# beadm destroy beName
You are prompted for confirmation before destroying the boot environment.
Destroys the boot environment that is specified by beName.
Forces the destruction of the boot environment without a confirmation request.
Forces the destruction of the boot environment, even if it is mounted.