.vast_trash), which is the recommended approach for bulk deletions. It’s intended for cluster administrators with root (superuser) access to a CKS cluster that has a Distributed File Storage volume mounted.
You can delete files from Distributed File Storage using either the VAST trash directory or the rm command. The VAST trash directory supports asynchronous deletion of files and folders in bulk. Serial rm -rf on large directories is slow and can block, so moving files marked for removal to the trash folder (.vast_trash) is faster.
.vast_trash is only accessible from a full volume mount. Pods that use a Kubernetes subPath mount can’t access .vast_trash. For details and migration options, see Work with subPath mounts.Prerequisites
- You have an active CKS cluster with a Distributed File Storage volume mounted.
- You have
rootuser access to the cluster.
Access VAST trash
The VAST trash directory (.vast_trash) is located at the root of each volume’s mount point. For example, if your volume is mounted at /mnt/vast, the VAST trash directory is at /mnt/vast/.vast_trash.
.vast_trash doesn’t appear in directory listings (ls). To verify it exists, replace [VOLUME-MOUNT-PATH] with the path where your volume is mounted (for example, /mnt/vast) and run:
No such file or directory, you likely have a subPath mount, which means no .vast_trash directory exists. Use the full volume mount instead.
Move files to VAST trash
Moving files to.vast_trash triggers asynchronous deletion by VAST, which avoids the long-running blocking behavior of rm -rf on large directories. The root user can delete files by moving them to the VAST trash directory:
mv: cannot overwrite non-directory '.vast_trash/<name>' with directory '<name>' can occur if the same directory name was previously deleted and VAST is still finalizing metadata cleanup. Try a different directory name or wait a few seconds before retrying.
Listing the contents of the trash directory returns an empty list, which confirms that the move succeeded and the contents are no longer addressable:
Example output
Work with subPath mounts
.vast_trash isn’t available when you use Kubernetes subPath mounts, because subPath only exposes a subdirectory of the volume, not the root where .vast_trash exists. If your workload relies on subPath, change how the volume is mounted before you use trash-based deletion.
If you need .vast_trash access but currently use a subPath mount, you can:
- Mount the full volume at a different location and then update your workloads to use the new mount point.
- Use symlinks to organize subdirectories within a full volume mount instead of
subPath.
subPath mount, replace [NAMESPACE] and [POD-NAME] with your namespace and pod name, then run:
Mounts section, look for entries with path="...". This indicates a subPath mount.
Diagnose mixed subPath and full volume mounts
You might have a configuration where some directories are full volume mounts and others are subPath mounts. This can cause confusion when you use .vast_trash, because the trash directory appears to work in some locations but not others within the same pod.
In this example, you have a full volume mount at /mnt/datasets and a subPath mount at /mnt/experiments:
Example output
Mounts section, look for entries with path="...". This indicates a subPath mount. In this example, /mnt/experiments is a subPath mount, so it doesn’t have its own VAST trash directory.
When you delete files in this setup, the behavior depends on the mount type:
-
Deleting from the full volume mount at
/mnt/datasetsworks: -
Deleting from the
subPathmount at/mnt/experimentsfails:
subPath, like the experiments directory, you have two options:
- Use standard deletion:
rm -rf /mnt/experiments/run-001. - Migrate to a full volume mount to gain trash access. See Work with
subPathmounts.