Categories
Latest News

What is a snapshot and how is it different than a backup?

What does a snapshot do?

In short snapshots are versioning, or the ability to undo a change. If you take a snapshot every hour, for example, then all your files or folders can be reverted back to the state they were at the time of any of your snapshots. So, if you get a virus, then you can just revert your files, folders, or whole volume to the state it was before you got the virus

How is this different than a backup?

A backup is a complete copy of your data. So, if you have 5TB of data each copy will take up an additional 5TB of space. If you make a backup every 1 hour, then after just 10 hours, your backups would take 50TB of space. For this reason, it is not common to save many versions of your backups and backups are not good for versioning.

Snapshots are great for versioning because they are not backups and they can have many versions without taking up much space. A snapshot only needs to save enough information to undo a change and that makes it take less space than a backup.

How do QNAP’s block-level snapshots work?

When you take a snapshot, the metadata recording where each block of data is stored is copied to the snapshot. This takes very little space and the snapshot is created very quickly. From then on, any time you change a block of data, that block is written to a designated snapshot space. The current metadata is updated to reflect the change as well. This procedure is called “Redirect on write”.

Because your snapshot has the metadata, it can recognize what blocks of data have been added or changed since the creation of the snapshot. If you revert to one of your snapshots, every block of data that was added or changed since the snapshot was taken is removed from where it is saved in the snapshot. Then every block of data is as it was at the time the snapshot was taken. And since your files are made up of blocks of data, every file is now as it was when the snapshot was taken.

This allows you to undo changes to your files, folders, and even volume, or to bring back files you have deleted accidentally.

What is good about the way QNAP does snapshots?

Easy to navigate interface:

Just click on what snapshot you want to load, and then you can revert the whole volume or select a specific file or folder to restore.

You can also easily schedule snapshots or take one manually at any time on the same interface.

Block-level:

Because QNAP does block level snapshots, they are more space efficient than file level snapshots. With file level snapshots, if you make even a small change to a file, you need to save the whole file to the snapshot. But with block level snapshots, you only need to save the blocks within the file that have been changed.

Much better for iSCSI LUNs:

Block level snapshots let you take snapshots of any volumes or LUNs on your NAS including a block level iSCSI LUN. Other snapshots that rely on BTRFS cannot do this because they can only take a snapshot of a volume & a thin LUN managed by the BTRFS file system.

Control snapshot space allocation to keep your NAS functional:

QNAP built their snapshots from the ground up and gave you more control of how space for the snapshots is allocated. You control how much storage to reserve for the snapshots. And other files and applications will have priority over the space that you did not allocate to snapshots.

For other NAS providers that rely on BTRFS, you have less control, and sometimes the snapshots can take up so much space that the NAS is no longer functional as a file server.

When are snapshots small?

When you only add files to the NAS, you don’t need to save blocks of data to the snapshot. The Snapshot just needs to have the metadata recording what blocks have been added to the NAS since the creation of the snapshot.

What makes a snapshot big?

When you delete files, the snapshot needs to be able to restore the files you deleted. To do that, any block of data you delete and overwrite will be saved to the snapshot. Saving blocks of data to the snapshot takes much more space than just saving metadata. So, deleting files makes your snapshot size grow much more than adding file

Conclusion:

Most people delete some files and make some changes to their files, but not enough to make the snapshots get too big. The default for QNAP is to allocate 20% of your storage space for snapshots and this is usually more than enough to have 256 snapshots. You could never get close to this many complete backups without taking up huge amounts of space. That is why snapshots are much better than backups for versioning. But snapshots don’t protect you from drive failure so it is still good to have RAID redundancy and at least one backup of your data to another device.

(Originally posted on April 24, 2018; contents updated by Michael Wang)

8 comments

  1. How does this work for Thick Volumes? I have a Pool with a 20TB volume and 12.1TB free space. The volume is using about 8TB of data. But I can’t take a snapshot because it tells me there’s not enough space. Why?

    1. Hi Neil, snapshots are stored in the storage pool (outside the volume). If you’ve already allocated all pool space to the thick volume, then you need to resize the volume to free up some space for snapshots. Thanks!

  2. I have a TS-453D with 4x6TB disks in it, set up with Thick volume. Would it be possible to add a external USB 3-drive for example a Seagate backup drive (external) where the snapshot is stored? If yes, how big disk would be needed?

    If no, could you point me to a tutorial how i can resize my thick volume to accomplish snapshot?

    Last question, could you put reference to how tutorial how to check for current setup of snapshot and how to set up snapshots on the system? When i browse to the QNAP and the shares i have on it i see a @Recently-Snapshot-camera together with @Recycle-bin , does this means i have it setup already or this there by default? Please advice me on this (or link to tutorial if you have one)

    Thank you for a great guide, i really appreciate it. It gave me a better understanding if snapshots.

    1. Hi Frank,
      Your snapshot needs to be stored in the NAS storage pool first. You can then export the stored snapshot as a backup.
      To resize the volume, follow the steps in the below image. Thanks.
      Steps for resizing a volume

      1. Hi Michael,
        Thank you so much for getting back to me regarding the steps to resize, i really appreciate that. The screenshot is a bit tiny so i am not able to make out all the steps given here, but i think i will manage roughly.

        Question 1: Based on my previous statement, of 4x6TB disk, what size do you recommend me to shrink down the volume to? I would like to maximize my storage volume, but at same time accomplish for good space for snapshots?

        Question 2:
        Would it be a good idea to only do snapshot-ing on for example shared folder i have setup, like pictures and documents or other folders that is important to me.

        1. Hi Frank,
          First of all, you can use this link (https://blog.qnap.com/wp-content/uploads/2020/12/resize_volume_steps.png) to display the screenshot we’ve provided in its full size. As to your inquiries:
          A1: We generally recommend 20% pool space for snapshots. However if your data does not change a lot (just like what we’ve described in the blog post) then you can consider a 10% value.
          A2: We have a “Snapshot Shared Folder” feature which allows you to only snapshot the desired folder. To set up a snapshot shared folder, go to Control Panel – Privilege – Shared Folders, click the Create button and select the “Snapshot Shared Folder” option.

Leave a comment

Your email address will not be published. Required fields are marked *