Delete directories asynchronously from ONTAP FlexGroup volumes
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.
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.
Beginning with ONTAP 9.10.1 | In ONTAP 9.9.1 | ||
---|---|---|---|
|
|
Use the CLI to perform an asynchronous delete
-
Enter advanced privilege mode:
set -privilege advanced
-
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
-
(Optional) Check the status of the in-progress async delete jobs:
volume file async-delete show
-
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
-
Enter advanced privilege mode:
set -privilege advanced
-
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.
-
Cancel the directory delete:
volume file async-delete cancel -vserver <SVM_name> -volume <volume_name> -jobid <job_id>