Go to main content

Creating and Administering Oracle® Solaris 11.4 Boot Environments

Exit Print View

Updated: November 2019
 
 

Destroying a Boot Environment

Destroy unused BEs to free space on the system. The command has the following syntax:

beadm destroy [[-fF] BeFMRI | BeFMRI@snapshot]|[-fF] -O

    beadm destroy destroys the specified BE or snapshot. The command prompts the user to provide confirmation before destroying the BE.

  • –f – Forces destruction of the BE even if it is mounted.

  • –F – Forces destruction of the BE without prompting for confirmation.

  • –O – Destroys all orphan non-global zone BEs. Only works in a non-global zone.

Destroying a BE removes its entry from the x86 GRUB menu or the SPARC boot menu. Any zone BEs that are associated with that BE are also destroyed.


Note - You cannot destroy the boot environment that is currently booted.

In the following example, the /tank and /tank/home are shared datasets, which are unaffected when BE2 is destroyed.

$ 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
tank                      450K   457G    18K  /export
tank/home                 315K   457G    21K  /export/home

$ beadm destroy 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
tank                      450K   457G    18K  /export
tank/home                 315K   457G    21K  /export/home

The command also destroys nonshared datasets of the BE. Shared datasets outside the BE root dataset area remain intact.

For more information about destroying orphaned BEs see About Orphaned Zone Boot Environments and Clones in Creating and Using Oracle Solaris Zones.