Perform a fast directory delete by deleting files and directories asynchronously

Contributors

It is recommended that you use the REST API to delete your directory. Starting with ONTAP 9.8, you can also use the volume file async-delete command to delete files and directories from Linux and Windows client shares in the background. You can perform asynchronous delete on both FlexVol and FlexGroup volumes.

About this task

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

Starting with ONTAP 9.9.1, you can also use System Manager to perform a fast directory delete. For more information, see Take corrective action based on analytics.

Steps
  1. Enter advanced privilege mode: -privilege advance

  2. Delete files or 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.