Trash Folder (for Rapid Parallel File Deletion)

Prev Next

When you need to delete a large number of files and folders, serial deletion by running rm -rf across a large directory tree can take a while. The trash folder gives you a faster method.

The trash folder is a hidden folder named .vast_trash into which you can move any files and folder that you want to delete. The files and folders are automatically deleted for you from the trash folder asynchronously.

The trash folder is supported for clients using NFSv3 and NFSv4 on Linux and for S3 clients. (For information about usage via S3, see Using Trash Folder for S3 Objects).

Access to the trash folder is granted to NFSv3 and NFSv4 hosts per view policy. It also requires the no squash policy to be enabled for the host, and a global trash access setting to be enabled on the cluster.

Note

Trash folder cannot be used for ABAC-tagged views.

The operation of moving files into the trash folder is supported for the root user only by default. It is also possible to allow other users access by adding them to a specific user group and specifying the group's GID.

Enabling Trash Access

The trash folder feature must be enabled globally in the VAST Web UI. Permission may be granted to hosts through either the VAST Web UI or the VAST CLI.

Enabling Trash Access in VAST Web UI

In the VAST Web UI, the option to grant trash folder access is disabled by default and needs to be separately enabled in the cluster settings.

  1. Enable the global ability to grant trash folder access:

    1. In the VAST Web UI, select Settings from the left navigation menu and then select Cluster.

    2. Under General, enable the Trash folder access setting.

    3. If you want to allow non-root users access to the trash folder, enter the GID you are using for this purpose in the Trash folder GID field.

    4. Click Save.

  2. The option to grant trash folder access now appears in the Host-Based Access tab of Add Policy and Update Policy dialogs (Element Store -> View Policies -> choose to create or edit a view policy):

    trash_enabled_policy_dialog.png

    To grant trash folder access to a host, add the host to both the Trash Folder Access and No Squash access type lists. Note that a more restrictive access type overrides a less restrictive access type. Therefore, if the host is also listed for Root Squash or All Squash, trash folder access will effectively be disabled on the host for the root user.

Using the Trash Folder

Once trash folder access is enabled for the host machine, the root user can delete files and folders by moving them into the trash folder:

$ sudo mv /export/path/to/folder /export/.vast_trash