Go to main content

Creating and Administering Oracle® Solaris 11.4 Boot Environments

Exit Print View

Updated: November 2019
 
 

Examples of Cloning Boot Environments

Example 1  Cloning a Boot Environment in a Global Zone That Contains Non-Global Zones

If the BE being cloned has an associated zone BE in a non-global zone, that associated BE is also cloned.

    This example makes the following assumptions:

  • The original BE on the global zone is solaris. Its root dataset at rpool/ROOT/solaris.

  • The non-global zone z1 exists with its dataset at rpool/zones/z1.

  • The global zone BE solaris has an associated BE in z1. The zone BE is also named solaris, whose root dataset is rpool/zones/z1/rpool/ROOT/solaris.

$ zfs list -r rpool
NAME                                    USED  AVAIL  REFER MOUNTPOINT
rpool                                  11.5G  3.89G  4.46M  /rpool
rpool/ROOT                             8.47G  3.89G    31K  legacy
rpool/ROOT/solaris                     2.98M  3.89G  2.49G  /
rpool/dump                             1.03G  3.92G  1.00G  -
rpool/export                            120K  3.89G    32K  /export
rpool/export/home                      88.5K  3.89G    32K  /export/home
rpool/export/home/user1                56.5K  3.89G  56.5K  /export/home/user1
rpool/swap                             1.03G  3.92G  1.00G  -
rpool/zones                             672M  3.89G    32K  /zones
rpool/zones/z1                          672M  3.89G    32K  /zones/z1
rpool/zones/z1/rpool                    671M  3.89G    31K  /rpool
rpool/zones/z1/rpool/ROOT               671M  3.89G    31K  legacy
rpool/zones/z1/rpool/ROOT/solaris       671M  3.89G   591M  /zones/z1/root
rpool/zones/z1/rpool/export              62K  3.89G    31K  /export
rpool/zones/z1/rpool/export/home         31K  3.89G    31K  /export/home

To clone the global BE and create test, you would proceed as follows. The results are highlighted in the output.

$ beadm create test
$ zfs list -r rpool
NAME                                      USED  AVAIL  REFER MOUNTPOINT
rpool                                    11.5G  3.89G  4.46M  /rpool
rpool/ROOT                               8.47G  3.89G    31K  legacy
rpool/ROOT/solaris                       2.98M  3.89G  2.49G  /
rpool/ROOT/test                            71K  3.89G  2.50G  /
rpool/dump                               1.03G  3.92G  1.00G  -
rpool/export                              120K  3.89G    32K  /export
rpool/export/home                        88.5K  3.89G    32K  /export/home
rpool/export/home/user1                  56.5K  3.89G  56.5K  /export/home/user1
rpool/swap                               1.03G  3.92G  1.00G  -
rpool/zones                               672M  3.89G    32K  /zones
rpool/zones/z1                            672M  3.89G    32K  /zones/z1
rpool/zones/z1/rpool                      671M  3.89G    31K  /rpool
rpool/zones/z1/rpool/ROOT                 671M  3.89G    31K  legacy
rpool/zones/z1/rpool/ROOT/solaris         671M  3.89G   591M  /zones/z1/root
rpool/zones/z1/rpool/ROOT/test              2K  3.89G   591M  /
rpool/zones/z1/rpool/export                62K  3.89G    31K  /export
rpool/zones/z1/rpool/export/home           31K  3.89G    31K  /export/home
  

The clone is named test, with a root dataset at rpool/ROOT/test.

Likewise, the associated BE solaris in z1 is also cloned as test, whose dataset is zones/z1/rpool/ROOT/test.

Example 2  Cloning a New Boot Environment with Datasets

This example illustrates how datasets are set up in a newly created BE. This example does not involve multiple zones.

Suppose that the original BE called OracleSolaris had a root dataset rpool/ROOT/OracleSolaris with a nested dataset var.

If you create the clone BE2, the nested dataset of the original BE is also cloned.

$ zfs list
NAME                           USED  AVAIL  REFER  MOUNTPOINT
rpool                         42.5G  24.4G  4.65M  /rpool
rpool/ROOT                    25.6G  24.4G    31K  legacy
rpool/ROOT/OracleSolaris      8.91M  24.4G  4.17G  /
rpool/ROOT/OracleSolaris/var  3.96M  24.4G   276M  /var

$ beadm create BE2
$ zfs list

NAME                           USED  AVAIL  REFER  MOUNTPOINT
rpool                         42.5G  24.4G  4.65M  /rpool
rpool/ROOT                    25.6G  24.4G    31K  legacy
rpool/ROOT/OracleSolaris      8.91M  24.4G  4.17G  /
rpool/ROOT/OracleSolaris/var  3.96M  24.4G   276M  /var
rpool/ROOT/BE2                8.91M  24.4G  4.17G  /
rpool/ROOT/BE2/var            3.96M  24.4G   276M  /var

In the case of a system that has non-global zones, the cloning of nested datasets also applies if the global zone BE has associated BEs in the non-global zone. Specifically, if a global zone BE with nested datasets is cloned, the nested datasets of the associated BE in the non-global zone are also cloned.

Suppose that the original BE information is as follows:

$ zfs list -r rpool
NAME                                    USED  AVAIL  REFER MOUNTPOINT
rpool                                  11.5G  3.89G  4.46M  /rpool
rpool/ROOT                             8.47G  3.89G    31K  legacy
rpool/ROOT/solaris                     2.98M  3.89G  2.49G  /
rpool/ROOT/solaris/var                  428K  3.89G   298M  /var
...
rpool/zones                             672M  3.89G    32K  /zones
rpool/zones/z1                          672M  3.89G    32K  /zones/z1
rpool/zones/z1/rpool                    671M  3.89G    31K  /rpool
rpool/zones/z1/rpool/ROOT               671M  3.89G    31K  legacy
rpool/zones/z1/rpool/ROOT/solaris       671M  3.89G   591M  /zones/z1/root
rpool/zones/z1/rpool/ROOT/solaris/var   79.3M  3.89G 78.4M  /zones/z1/root/var

After cloning solaris to newBE, the new information would be as follows:

$ zfs list -r rpool
NAME                                    USED  AVAIL  REFER MOUNTPOINT
rpool                                  11.5G  3.89G  4.46M  /rpool
rpool/ROOT                             8.47G  3.89G    31K  legacy
rpool/ROOT/solaris                     2.98M  3.89G  2.49G  /
rpool/ROOT/solaris/var                  428K  3.89G   298M  /var
rpool/ROOT/newBE                       2.98M  3.89G  2.49G  /
rpool/ROOT/newBE/var                    428K  3.89G   298M  /var
...
rpool/zones                             672M  3.89G    32K  /zones
rpool/zones/z1                          672M  3.89G    32K  /zones/z1
rpool/zones/z1/rpool                    671M  3.89G    31K  /rpool
rpool/zones/z1/rpool/ROOT               671M  3.89G    31K  legacy
rpool/zones/z1/rpool/ROOT/solaris       671M  3.89G   591M  /zones/z1/root
rpool/zones/z1/rpool/ROOT/solaris/var  79.3M  3.89G 78.4M   /zones/z1/root/var
rpool/zones/z1/rpool/ROOT/newBE           2K  3.89G   591M  /zones/z1/root
rpool/zones/z1/rpool/ROOT/newBE/var       1K  3.89G  78.4M  /zones/z1/root/var
Example 3  Creating a New Boot Environment With Existing Shared Datasets

In this example, BE1 is the original BE, and the shared datasets are rpool/export and rpool/export/home. This example does not involve multiple zones.

When you clone BE1, its datasets are also cloned but not the shared datasets Instead, both BE1 and its clone would have access and use of rpool/export and rpool/export/home.

$ zfs list
NAME                      USED  AVAIL  REFER  MOUNTPOINT
rpool                    42.5G  24.4G  4.65M  /rpool
rpool/ROOT               25.6G  24.4G    31K  legacy
rpool/ROOT/BE1           8.91M  24.4G  4.17G  /
rpool/ROOT/BE1/var       3.96M  24.4G   276M  /var
rpool/export             450K   457G    18K  /rpool/export
rpool/export/home        315K   457G    21K  /rpool/export/home

$ beadm create BE2

$ zfs list
NAME                      USED  AVAIL  REFER  MOUNTPOINT
rpool                    42.5G  24.4G  4.65M  /rpool
rpool/ROOT               25.6G  24.4G    31K  legacy
rpool/ROOT/BE1           8.91M  24.4G  4.17G  /
rpool/ROOT/BE1/var       3.96M  24.4G   276M  /var
rpool/ROOT/BE2           8.91M  24.4G  4.17G  /
rpool/ROOT/BE2/var       3.96M  24.4G   276M  /var
rpool/export             450K   457G    18K  /rpool/export
rpool/export/home        315K   457G    21K  /rpool/export/home