"Trash" for Deleted Files in a Share

Hello. I just started to use Rockstor earlier this week. It seems to be an excellent NAS tool and has all of the features I’m looking for.
I’ve been able to create the pools, shares, users and everything else to use it with an AFP share to my Mac.

I’ve been through the forums, but I can’t figure out if there is a “trash” feature for deleted files.
Meaning if I am mapped to a Rockstor share through AFP, SMB, SFTP… and I delete a file, is there a trash where I can see the deleted files?

Hopefully, I’m just missing something obvious and there is a straight forward way to enable it.

Thanks in advance,
asood

Hi @asood,

By default, when a file is deleted on Linux, it is removed permanently.
Rockstor, however does have a limited capability for deleted files through BTRFS Snapshots.

These are only implemented in Rockstor to the degree of being able to completely rollback the subvolume (or, as the UI calls it, the share), meaning that all changes between share creation and rollback would be lost.

Fret not though, with some command-line fu, you can mount the snapshot on a seperate mountpoint and copy-back the deleted data you wish to retrieve.
Myself, and other forum members can help you with this process.

This not only works for data deletion, but can also be used to rollback changes on a file to an earlier date.

Please note that this is only available on shares that you have manually created a snapshot of, or configured scheduled snapshots. You cannot rollback to any time before a snapshot was created.

To create a snapshot schedule, navigate in the Rockstor UI to System -> Scheduled Tasks -> Schedule a task.

From there, you will need to:

  • Enter a name of your choice for the task (IE: “Weekly snapshot”)
  • set type to BTRFS Snapshot
  • Select the share to snapshot
  • Enter a text prefix of your choice for the task (IE: “”)
  • Enter a maximum number of snapshots to keep (try to not make this too large!)
  • Probably leave the checkboxes as default
  • Select an appropriate run frequency

Please note, every snapshot uses slightly more space than the changes they are tracking. If your filesystem changes a lot, then your snapshots may take up quite a bit of space on the pool that the share is allocated to.

There are multiple sources of information regarding snapshot sizing, This one makes a reasonable attempt to try and make some simplified sense of a complex operation.

I hope this helps!

Hello and thanks for the response.

I currently use a QNAP NAS which has a “trash” folder for deleted files which allows me to easily and quickly recover a file in case I deleted it by accident or just changed my mind and needed to restore it. Basically the same as the trash on my Mac or Windows 10.

If I understand your answer correctly, Rockstar doesn’t have a “trash” feature. Do you know why and/or if it’s on the roadmap?
If not, that’s fine, at least I know it’s not an option.

asood

Hi @asood,

Please note that I’m not a Rockstor developer, I’m just a user like you.

That being said…

That’s correct.
This is because Rockstor is largely a UI and framework around a normal Linux server installation.
Linux does not (by default) provide this functionality. It’s also not a default feature of NFS and Samba sharing.

It’s assumed that QNAP have developed their own drivers for NFS and Samba in order to implement this functionality.

While it would be nice to have this functionality, Rockstor is developed by a small team, and I sincerely doubt they’ll be going down the path of writing their own NFS/Samba userspace framework.

There is the possibility of implementing a UI based undelete (IE: Trash) based on a filesystem tree diff between the current subvolume (share) and a snapshot, however this would be a lot of work, and it would be very slow to compile the change list.

I don’t see this capability being on the roadmap beyond the status of ‘wishful thinking’ for a long time.