Understanding Snapshots
Posted: 24 Apr 2023, 21:28
I'm trying to. I'm hoping contributors here will be able to help me, although this section of the forum seems to be rather sparsely attended. Which is a pity, because snapshots seem (to me) to be a really important feature of TOS 5.
I have a Multimedia shared folder on a BTRFS+TRAID NAS which I've set up to be snapshotted daily. The snapshots live inside the Multimedia folder in a subfolder called @snapshot.
I was recently messing with a directory merge app which I didn't fully understand, something I came to realise on discovering many of the multimedia files within their subfolders had disappeared. I didn't want to restore the entire Multimedia directory, just the missing files. So I opened the @snapshot folder, found the snapshot immediately previous to my unfortunate merge experiment and began helping myself to replacements using copy and paste.
This worked well until my NAS suddenly completely ran out of space. I realised what was happening: a snapshot is just a pointer to where the file is to be found and takes up little space on its own. But every time you copy that snapshot and paste it elsewhere you're recreating the entire file, effectively duplicating the file so it takes up twice the space.
What I was looking for, it seemed to me, was a restore method that simply restored the directory information while still pointing to the original file. This would look like a copy and paste exercise except that it would be very much faster and wouldn't increase the amount of used space.
As far as I can make out, this is exactly what the restore inside the Terramaster Snapshot app does. Except that it does it to the entire snapshot, not allowing you to cherry-pick individual files. So, having added a new drive to the NAS to expand the storage pool and the volume within it I restored an entire snapshot and (as far as I could make out) didn't see any increase in the use of storage space.
If my interpretation was right, the restore had recreated the directory information without duplicating the files.
But now I want to cherry pick individual files and replace them in the Multimedia directory. Copying and pasting would return us to the duplication problem. The Terramaster WebUI's File Manager offers no Move option. But how about Cut and Paste? And once I've cherry-picked my restore files using cut and paste, I'll simply delete all the other unwanted files the snapshot has created, leaving the snapshot target directory clean for future reuse.
So, questions:
1. Is there a way of restoring individual files from a snapshot that doesn't duplicate the file?
2. When I use Snapshot Restore to restore an entire snapshot, am I right in assuming this takes up no extra drive space?
3. Does cutting and pasting individual files from this restored snapshot also not increase used drive space?
4. In summary, is the preferred way of restoring individual files: a) restore the entire snapshot, b) cut and paste individual files from that restoration, and c) delete the remaining files restored from the snapshot?
--
Chris
I have a Multimedia shared folder on a BTRFS+TRAID NAS which I've set up to be snapshotted daily. The snapshots live inside the Multimedia folder in a subfolder called @snapshot.
I was recently messing with a directory merge app which I didn't fully understand, something I came to realise on discovering many of the multimedia files within their subfolders had disappeared. I didn't want to restore the entire Multimedia directory, just the missing files. So I opened the @snapshot folder, found the snapshot immediately previous to my unfortunate merge experiment and began helping myself to replacements using copy and paste.
This worked well until my NAS suddenly completely ran out of space. I realised what was happening: a snapshot is just a pointer to where the file is to be found and takes up little space on its own. But every time you copy that snapshot and paste it elsewhere you're recreating the entire file, effectively duplicating the file so it takes up twice the space.
What I was looking for, it seemed to me, was a restore method that simply restored the directory information while still pointing to the original file. This would look like a copy and paste exercise except that it would be very much faster and wouldn't increase the amount of used space.
As far as I can make out, this is exactly what the restore inside the Terramaster Snapshot app does. Except that it does it to the entire snapshot, not allowing you to cherry-pick individual files. So, having added a new drive to the NAS to expand the storage pool and the volume within it I restored an entire snapshot and (as far as I could make out) didn't see any increase in the use of storage space.
If my interpretation was right, the restore had recreated the directory information without duplicating the files.
But now I want to cherry pick individual files and replace them in the Multimedia directory. Copying and pasting would return us to the duplication problem. The Terramaster WebUI's File Manager offers no Move option. But how about Cut and Paste? And once I've cherry-picked my restore files using cut and paste, I'll simply delete all the other unwanted files the snapshot has created, leaving the snapshot target directory clean for future reuse.
So, questions:
1. Is there a way of restoring individual files from a snapshot that doesn't duplicate the file?
2. When I use Snapshot Restore to restore an entire snapshot, am I right in assuming this takes up no extra drive space?
3. Does cutting and pasting individual files from this restored snapshot also not increase used drive space?
4. In summary, is the preferred way of restoring individual files: a) restore the entire snapshot, b) cut and paste individual files from that restoration, and c) delete the remaining files restored from the snapshot?
--
Chris