Skip to main content

We've Moved!

Product Documentation has moved to docs.hitachivantara.com
Hitachi Vantara Knowledge

Deleting a tree directory with tree-delete

The tree-delete feature provides a mechanism to immediately remove a directory tree from its position in the file system and to perform the deletion as a background job. A directory tree consists of a specified directory and the hierarchy of subdirectories and files below it. When a directory tree is targeted for deletion, a tree-delete job is created and added to the job queue. The targeted directory tree is immediately removed from the file system namespace, moved to the system trash directory, and scheduled for background deletion.

The tree-delete interfaces are provided in the form of management APIs and CLI commands. No license is required.

The tree-delete feature provides the following benefits, compared to deleting a directory tree via a network client:

  • The instantaneous removal of a directory tree from the listing of the parent directory, allowing the client to proceed with further actions.

  • The server-side delete eliminates the need for a client to recursively delete the directory tree over the network, therefore using less system resources.

  • The multi-threaded implementation allows parallel deletion of the contents of the directory tree.

Important considerations when using tree-delete

NoteThe tree-delete feature can destroy user data.
Although the targeted directory tree is immediately removed from the file system namespace and the listing of the parent directory, the client continues to have access to parts of the directory tree it had acquired access to prior to deletion, until these parts are actually deleted in the background. Users should be mindful of the fact that changes to a directory tree (creation and deletion of files/directories) after submission for deletion are detected by tree-delete, and all such new content is deleted before tree-delete considers its job done.
NoteQuotas only reflect the physical deletion happening in the background.

Unmounting a file system and tree-delete

When a file system is unmounted, all related tree-deletion activity is suspended and resumed on a subsequent re-mount.

Tree-deletion activity on other mounted file systems remains unaffected.

Undeletable directories

The following directories cannot be deleted using tree-delete:

  • Root directory and system directories.

  • Virtualization root or its sub-directory.

  • Regular directory containing virtualization root(s). See the warning on deletion attempts of such a directory tree in the tree-delete-job-submit man page

  • Sub-directory of a virtual volume.

NoteYou can run logtrace dump tree-delete for more details about deleted files.

Maximum supported tree depth

Tree-delete supports deletion of trees maximum 1000 levels deep.

Using tree-delete

tree-delete is implemented with the commands:

  • tree-delete-job-abort
  • tree-delete-job-list
  • tree-delete-job-reschedule
  • tree-delete-job-status
  • tree-delete-job-submit

Please see the man pages for details.

Submitting a tree-delete job

Note the following factors when using the tree-delete-job-submit command:

  • The main activities pertaining to a submitted tree-delete job, such as its start and end, are logged to the event log..

  • A maximum of 160 jobs can be handled by the system at any given time.

Troubleshooting tree-delete

Run logtrace dump tree-delete for details about deleted files. Contact customer support if necessary.

 

  • Was this article helpful?