Go to main content

Creating and Using Oracle® Solaris Zones

Exit Print View

Updated: August 2019

Boot Environments and Zones

This section describes zone boot environments (BEs), shared zones, alternate roots for zones, and orphaned zones.

beadm Command in Non-Global Zones

The beadm command is used to manage boot environments, called BEs. The beadm command performs tasks on a boot environment structure including a root dataset and all the datasets nested under that root dataset.

The beadm command is supported inside a non-global zone. The beadm command does not display zones information. Use the zoneadm command from the global zone to view changes in the zones in your boot environment. For example, use the zoneadm list command to display a list of all current zones on the system. For more information, see the beadm(8) man page.

Boot Environments in Global and Non-Global Zones

Both global zones and non-global zones contain boot environments. Each boot environment in a non-global zone is associated with a parent boot environment in the global zone. Each global zone boot environment is associated with one or more zone boot environments (ZBE) in each installed solaris zone. When the zone is detached, the references to the global zone remain. This enables the zone to be reattached to the same global zone while maintaining associations between global and non-global boot environments.

If a global zone boot environment is inactive, the related non-global zone boot environment is unbootable. However, if you boot into that parent boot environment in the global zone, the related boot environment in the non-global zone becomes bootable.

When you attach or migrate a zone, you can specify the ZBE to attach by name using the –z option or use one of several –x options to enable the system to select the appropriate ZBE. See the zones(7) man page for information about these options.

–x deny-zbe-clone Option

This option denies a zone boot environment (ZBE) clone, updates the ZBE, and mounts it as active boot environment.

By default, if either of the following are true, the selected zone boot environment is cloned and the clone is attached. The original zone boot environment continues to exist.

  • The selected zone boot environment is associated with another global zone boot environment.

  • The selected zone boot environment is an orphaned boot environment that is not associated with any global zone boot environment.

If the -x deny-zbe-clone option is used during attach or migration of a solaris zone, the chosen zone boot environment is updated in place and mounted as the active boot environment without cloning.

Note -  You can only use the -x deny-zbe-clone option on an inactive zone boot environment. To mark a boot environment inactive, see Chapter 4, Administering Boot Environments in Creating and Administering Oracle Solaris 11.4 Boot Environments.

–x destroy-orphan-zbes Option

During attach or migrate operations, this option destroys all zone boot environments that are not associated with any existing global zone. The current orphan boot environment you attach will be destroyed after it is cloned and updated.

–x force-zbe-clone Option

This option clones the selected zone boot environment (ZBE) and attaches the clone ZBE as the active boot environment. The original ZBE remains.

When attaching a zone, by default, the zone boot environment that is associated with the currently active global zone boot environment is selected. This option overrides this behavior and selects a different global zone boot environment.

Shared Zone State

The state of a zone is shared across all boot environments (BEs) on a host system. If the state of a zone is changed, it affects all BEs, not just the BE that is currently booted. It also affects all states, which includes changing the zone state from installed to configured. If a zone is uninstalled, it is uninstalled from all BEs. The only way to recover the uninstalled zone is from existing backup data.

Specifying an Alternate Root

Use the zoneadm command with the –R root option to specify an alternate root (boot environment). This option can only be used with the list and mark subcommands. See the zoneadm(8) man page for more information.

About Orphaned Zone Boot Environments and Clones

When migrated to different hosts, non-global zones can accumulate zone boot environments that are not associated with an existing global zone. A non-global zone boot environment that is not associated with a global zone is known as an orphaned boot environment.

Orphaned zone boot environments are of use only if you intend to reattach the zone on the original source system. If there is no intent to return the zone to a global zone to which it was previously attached, you can destroy the orphaned zone boot environment.

If an orphaned boot environment is selected to attach to a zone, it is cloned. This cloned boot environment will be updated and re-parented to the active global boot environment. The original orphaned boot environment will continue to exist by default. You can specify options to handle the boot environments differently.

Identifying Orphaned Boot Environments With the beadm Command

Orphaned boot environments are indicated in beadm list output by an O flag in the Active column. In the following example output, the solaris-0, solaris-1, and solaris-2 boot environments are orphaned.

$ beadm list
    BE        Active Mountpoint Space   Policy Created
    --        ------ ---------- -----   ------ -------
    solaris-0 !RO    -          3.40M   static 2014-01-17 15:04
    solaris-1 !RO    -          3.85M   static 2014-02-09 18:11
    solaris-2 !RO    -          39.0K   static 2014-02-10 04:54
    solaris-3 !R     -          2.19G   static 2014-02-12 16:56
    solaris-4 !R     -          3.0K    static 2014-02-19 19:18
    solaris-5 NR     /          2.43G   static 2014-03-20 04:38

Boot environments that are shown as orphaned can be destroyed with the beadm destroy command. To destroy all orphaned boot environments, include the –O option.

For more information about boot environments, see Creating and Administering Oracle Solaris 11.4 Boot Environments and the beadm(8) man page.

zoneadm Options for Orphaned Zone Boot Environments and Clones

    The following –x options are used to manage zone boot environments (ZBEs) during zoneadm attach of a zone. The same options are used similarly with the zoneadm migrate command and apply when an attach is performed on the target system during the migration.

  • destroy-orphan-zbes

  • force-zbe-clone

  • deny-zbe-clone

Note -  The force-zbe-clone and the deny-zbe-clone are mutually exclusive options.

The options attach-last-booted-zbe and destroy-orphan-zbes can be used with either the force-zbe-clone option or the deny-zbe-clone option.