Skip to main content

Delete directories rapidly on the cluster

Contributors netapp-lenida netapp-thomi netapp-ahibbard

Beginning with ONTAP 9.8, you can use low-latency fast-directory delete functionality to delete directories from Linux and Windows client shares asynchronously (that is, in the background). Cluster and SVM administrators can perform asynchronous delete operations on both FlexVol and FlexGroup volumes.

If you are using a version of ONTAP earlier than ONTAP 9.11.1, you must be a cluster administrator or a SVM administrator using the advanced privilege mode.

Beginning with ONTAP 9.11.1, a storage administrator can grant rights on a volume to allow NFS and SMB clients to perform asynchronous delete operations. For more information, see Manage client rights to delete directories rapidly.

Beginning with ONTAP 9.8, you can use fast directory delete functionality using the ONTAP CLI. Beginning with ONTAP 9.9.1, you can use this functionality with System Manager. For more information about this process, see Take corrective action based on analytics.

System Manager
  1. Click Storage > Volumes, then click Explorer.

    When you hover over a file or folder, the option to delete appears. You can only delete one object at a time.

Note When directories and files are deleted, the new storage capacity values are not displayed immediately.
CLI

Use the CLI to perform a fast directory delete

  1. Enter advanced privilege mode:

    -privilege advance

  2. Delete directories on a FlexVol or FlexGroup volume:

    volume file async-delete start -vserver vserver_name -volume volume_name -path file_path -throttle throttle

    The minimum throttle value is 10, the maximum is 100,000, and the default is 5000.

    The following example deletes the directory named d2, which is located in the directory named d1.

    cluster::*>volume file async-delete start -vserver vs1 -volume vol1 -path d1/d2
  3. Verify that the directory was deleted:

    event log show

    The following example shows output for the event log when the directory is successfully deleted.

    cluster-cli::*> event log show
    Time                 Node             Severity      Event
    -------------------  ---------------- ------------- --------------------
    MM/DD/YYYY 00:11:11  cluster-vsim     INFORMATIONAL asyncDelete.message.success: Async delete job on path d1/d2 of volume (MSID: 2162149232) was completed.

Cancel a directory delete job

  1. Enter advanced privilege mode:

    set -privilege advanced

  2. Verify that the directory delete is in progress:

    volume file async-delete show

    If the SVM, volume, JobID, and path of your directory is displayed, you can cancel the job.

  3. Cancel the directory delete:

    volume file async-delete cancel -vserver SVM_name -volume volume_name -jobid job_id