Destroying a Snapshot (CLI)

Use the following procedure to destroy a snapshot.

Before You Begin

  • To complete this procedure, you must have Super-User privileges or one of the following role authorizations within the projects and shares scope:

    • destroySnap - Allows users to only destroy snapshots.

    • destroy - Grants privileges to remove projects and shares, including snapshots.

  • To add authorizations to a role, see Editing Authorizations for a Role (CLI).

  • Before a manual snapshot with a retention hold can be destroyed, the hold type must be off. To modify a manual snapshot from unlocked to off, see Editing a Snapshot Retention Policy (CLI).

    To use the snapshot retention hold feature, apply deferred update "Support for Snapshot Retention." For information about deferred updates, see Deferred Updates in Oracle ZFS Storage Appliance Customer Service Manual, Release OS8.8.x.

  1. Go to shares and select the project, or select the project and then a share.

    Destroying a project snapshot also destroys its shares.

    hostname:> shares select myproject
    hostname:shares myproject> select demo_share
  2. Enter snapshots.
    hostname:shares myproject/demo_share> snapshots
  3. Enter list to view the list of snapshots for the project or share.
    hostname:shares myproject/demo_share snapshots> list
    demo_snap1
    demo_snap2
  4. Use the destroy command to delete an individual snapshot using one of two methods:
    • Select the snapshot you want to delete, then enter destroy.

      hostname:shares myproject/demo_share snapshots> select demo_snap1
      hostname:shares myproject/demo_share@demo_snap1> destroy
    • Type destroy followed by the snapshot name.

      hostname:shares myproject/demo_share snapshots> destroy demo_snap1

    If clones have been made of this snapshot, you are prompted with a list of the clones that will be affected. Destroying a snapshot also destroys any clones of that snapshot and descendants of those clones.

    If the snapshot or its children are actively changing, an error message indicates that the snapshot cannot be destroyed. Also, if a schedule contains locked automatic snapshots, the snapshot cannot be destroyed until the retention holds expire. If an automatic snapshot schedule has a retention hold but no snapshots have been generated, the snapshot can be destroyed.

  5. Type Y to confirm your action.
    This will destroy all data in "demo_snap1"! Are you sure? (Y/N) Y