Creating and Using Oracle® Solaris Zones

Exit Print View

Updated: May 2015
 
 

How to Uninstall a Zone


Caution

Caution  -  Use this procedure with caution. The action of removing all of the files in the zone's root file system is irreversible.


The zone cannot be in the running state. The uninstall operation is invalid for running zones.

You must be the global administrator or a user with appropriate authorizations in the global zone to perform this procedure.

  1. Become an administrator.

    For more information, see Using Your Assigned Administrative Rights in Securing Users and Processes in Oracle Solaris 11.2 .

  2. List the zones on the system.
    global# zoneadm list -v

    You will see a display that is similar to the following:

    ID  NAME     STATUS       PATH                           BRAND      IP
     0  global   running      /                              solaris    shared
     -  my-zone  installed    /zones/my-zone                 solaris    excl  
  3. Use the zoneadm command with the –z uninstall option to remove the zone my-zone.

    You can also use the –F option to force the action. If this option is not specified, the system will prompt for confirmation.

    global# zoneadm -z my-zone uninstall -F

    Note that when you uninstall a zone that has its own ZFS file system for the zonepath, the ZFS file system is destroyed.

  4. List the zones on the system again, to verify that my-zone is no longer listed.
    global# zoneadm list -iv

    You will see a display that is similar to the following:

    ID  NAME     STATUS       PATH                           BRAND      IP
     0  global   running      /                              solaris    shared

Troubleshooting

If a zone uninstall is interrupted, the zone is left in the incomplete state. Use the zoneadm uninstall command to reset the zone to the configured state.

If the zonepath is not removed, this could be an indication that this zone is installed in another boot environment. The zonepath and various datasets that exist within the zonepath dataset are not removed while a boot environment exists that has an installed zone with a given zonepath. See beadm(1M) for more information about boot environments.

Use the uninstall command with caution because the action is irreversible.