All Products
Search
Document Center

File Storage NAS:Recycle bin

Last Updated:Jan 30, 2026

The recycle bin feature protects files on General-purpose NAS file systems from accidental deletion. When enabled, deleted files and directories are retained in the recycle bin for a specified period, during which they can be restored along with their metadata (UIDs, GIDs, and ACLs).

How it works

When enabled, the recycle bin captures the following types of deleted files and directories:

  • Files manually deleted on compute nodes (ECS instances, containers). Example: rm -f test01.text moves test01.text to the recycle bin.

  • Files or directories deleted by applications. Example: os.remove("test02.text") in Python moves test02.text to the recycle bin.

  • Files overwritten by POSIX rename operations. Example: running mv test_a.txt test_b.txt when both test_a.txt and test_b.txt exist moves the original test_b.txt to the recycle bin.

  • Temporary files generated by applications. Example: editing a file with vim moves .swp and .swpx files to the recycle bin.

  • Log files removed during rotation. Example: when NGINX rotates test.log.19 to test.log.20, the original test.log.20 is moved to the recycle bin.

Note

Overwriting file content without deletion does not trigger recycle bin storage. Example: writing to a file with open() in w+ mode keeps the original file in place.

Usage notes

Enable the recycle bin feature

To enable the recycle bin feature:

  1. Log on to the NAS console.

  2. In the left-side navigation pane, choose File System > File System List.

  3. In the top navigation bar, select a region.

  4. On the File Systems page, click the ID of the file system.

  5. On the details page of the file system, click the Recycle Bin tab and then click Enable Recycle Bin.

  6. In the Enable Recycle Bin dialog box, set Select a retention period.

  7. Click OK.

Restore files from the recycle bin

Files in the recycle bin can be restored within the specified retention period. Before running restore jobs, note the following:

  • Only one restore job can run at a time per file system.

  • Each restore job handles one file or directory. Restoring a directory also restores all files within it.

    Note

    If the number of hard links to a file in the directory exceeds 511, NAS randomly restores 511 of these files. The excess files cannot be restored, and the restore job status displays as Partially Completed.

  • The restore time increases with the number of files or directories being restored.

To restore files from the recycle bin:

  1. Log on to the NAS console.

  2. In the left-side navigation pane, choose File System > File System List.

  3. In the top navigation bar, select a region.

  4. On the File Systems page, click the ID of the file system.

  5. On the details page of the file system, click Recycle Bin.

  6. On the Deleted Files and Directories tab, find the file that you want to restore and click Restore.

  7. In the Select Restoration Path dialog box, select the path to which you want to restore the file and click Select Restoration Path.

    • Restore to the original path: If the original path still exists, the file is restored to that path. If the original path no longer exists, select a custom path.

    • Restore to the following custom path: Select an existing path to which you want to restore the file.

    Note
    • If the restore job is in the Defragmenting state, read performance may be slightly degraded. Avoid changing the directory structure of the file system during this state to prevent defragmentation delays.

    • If the job status is Completed but the restored files are not visible when running the ls command on the ECS instance, run the sudo sysctl -w vm.drop_caches=2 command to clear the cache. The files will be visible after the cache is cleared.

More operations

Operation

Description

Procedure

Empty Recycle Bin

Empty the recycle bin to reduce storage costs when the files are no longer needed.

Warning

Emptying the recycle bin permanently deletes all files. Permanently deleted files cannot be retrieved.

  1. On the Recycle Bin page, click Empty Recycle Bin.

  2. In the message that appears, confirm that you no longer need the files in the recycle bin and click OK.

Change File Retention Period

Adjust the retention period based on your file system usage to reduce storage costs for files in the recycle bin.

  1. On the Recycle Bin page, click Modify.

  2. In the Modify Retention Period dialog box, change the retention period and click OK.

Disable and Empty

Disable and empty the recycle bin when the files or the feature is no longer needed.

Warning
  • Disabling the recycle bin permanently deletes all files in the recycle bin.

  • After disabling and re-enabling the recycle bin, the recycle bin is empty. Files deleted before re-enabling cannot be retrieved.

  1. On the Recycle Bin page, click Disable and Empty.

  2. In the message that appears, confirm that you no longer need the files in the recycle bin or that you no longer want to use the recycle bin feature. Then, click OK.

Query files in the recycle bin

Files in the recycle bin are not accessible from compute nodes. Use the NAS console to view them.

On the Recycle Bin page, view the files in the recycle bin and their deletion times.

Permanently delete files from the recycle bin

Permanently deleting a directory also permanently deletes all files within it.

Warning

Permanently deleted files from the recycle bin cannot be retrieved.

  1. On the Recycle Bin page, find the file that you no longer need and click Permanently Delete.

  2. In the message that appears, confirm that you no longer need the file and click OK.

Query the jobs of the recycle bin

View data restore jobs or permanent deletion jobs from the past seven days in the NAS console. Up to 50 job records are displayed.

  1. On the Recycle Bin page, click Task Management.

  2. On the Task Management tab, view the completed data restore jobs or permanent deletion jobs.

Cancel a permanent deletion job or a data restore job

Cancel running restore or deletion jobs in the NAS console.

  • After canceling a restore job, restored files remain in the file system while unrestored files stay in the recycle bin.

  • After canceling a deletion job, deleted files cannot be retrieved, but remaining files stay in the recycle bin.

  1. On the Recycle Bin page, click Task Management.

  2. On the Task Management tab, find the job that you want to cancel and click Cancel.

References

  • To prevent NAS data loss or damage, use Cloud Backup to back up all directories or files in NAS file systems. For more information, see Backup and restoration.

  • For advanced Extreme NAS file systems, use snapshots to back up data and restore data from a snapshot at a point in time to an existing file system. For more information, see Snapshots.

FAQ