Delete directories asynchronously on the cluster
Beginning with ONTAP 9.8, you can use asynchronous 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 an 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 asynchronously.
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 analytics.
-
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.
|
When directories and files are deleted, the new storage capacity values are not displayed immediately. |
Use the CLI to perform an asynchronous delete
-
Enter advanced privilege mode:
-privilege advance
-
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
-
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
-
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