How to Remove an Encrypted ZFS Cluster File System and Its Encryption Key

  1. Identify the encryption key that is associated with the file system that you want to remove.
    phys-schost# zfs get -r keysource zpoolname/fsname

    The following example command shows the keysource property value of the gpool/fs1 file system:

    phys-schost# zfs get -r keysource gpool/fs1
    NAME   PROPERTY   VALUE                  SOURCE
    gpool  keysource  hex,cluster:gpool-key  local
  2. Remove the file system.

    Use the zfs destroy or the zfs -r command to remove all the child file systems of the specified file system.

    phys-schost# zfs destroy zpoolname/fsname

    The following example command removes the gpool/fs1 file system:

    phys-schost# zfs destroy gpool/fs1
  3. Remove the encryption key.

    Use the cldevicegroup key-remove command to remove the specified encryption key. Specify the key name of the encryption key that you identified in Step 1.

    phys-schost# cldevicegroup key-remove -k key-name

    The following example command removes the gpool-key encryption key:

    phys-schost# cldevicegroup key-remove -k gpool-key
    WARNING: Please ensure keyname 'gpool-key' is not being used in any offlined Device Group.
    Are you sure you want to remove keyname 'gpool-key' (y/n) [n]? y