Skip to main content

Delete directories asynchronously from ONTAP FlexGroup volumes

Contributors netapp-lenida netapp-thomi netapp-ahibbard netapp-barbe netapp-aaron-holt netapp-aherbin

Beginning with ONTAP 9.8, you can 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.

About this task

You must be a cluster administrator or an SVM administrator using the advanced privilege mode.

Beginning with ONTAP 9.8, you can use asynchronous 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 ONTAP analytics in FSA.

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 asynchronously.

You can use the volume file async-delete show command to check the status of in-progress asynchronous delete jobs, and, beginning with ONTAP 9.17.1, the status of asynchronous delete jobs issued from clients is also displayed.

Delete directories asynchronously

You can use System Manager or the ONTAP CLI to delete directories asynchronously.

System Manager
Beginning with ONTAP 9.10.1 In ONTAP 9.9.1
  1. Select Storage > Volumes and select the desired volume name.

  2. In the individual volume page, select the File system tab, and then select the Explorer tab.

  3. In the Explorer view, select the desired directory.

  4. To delete, hover over a file or folder, and the delete Delete icon option 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.
  1. Select Storage > Volumes.

  2. Select the desired volume, then select Explorer.

  3. In the Explorer view, select the desired directory.

  4. To delete, hover over a file or folder, and the delete Delete icon option appears.

CLI

Use the CLI to perform an asynchronous delete

  1. Enter advanced privilege mode:

    set -privilege advanced

  2. Delete directories on a FlexVol or FlexGroup volume:

    volume file async-delete start -vserver <SVM_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. Lower throttle values use less resources, which can result in a slower deletion rate, while higher throttle values use more resources, but can result in a faster deletion rate.

    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. (Optional) Check the status of the in-progress async delete jobs:

    volume file async-delete show

  4. 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::*> event log show
    
    Time                Node             Severity      Event
    ------------------- ---------------- ------------- ---------------------------
    7/7/2025 09:04:04   cluster-vsim     NOTICE        asyncDelete.message.success: Async delete job on path d1/d2 of volume (MSID: 2162149232) was completed. Number of files deleted: 7, Number of directories deleted: 5. Total number of bytes deleted: 135168.

    Learn more about event log show in the ONTAP command reference.

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>