NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
GFNV
Apr 24, 2018Tutor
Backup, snapshots Best Practices
Looking for best practices for both Backups and Snapshots - including:
- a clear differentiation between the two, why use backup vs. snapshot
- why & when to use each,
- snapshot & bac...
StephenB
Apr 24, 2018Guru - Experienced User
Snapshots first:
Snapshots are a feature of the BTRFS file system that the NAS uses. They are functionally similar to the "previous versions" function in windows - and in fact, if you right-click on a NAS file from Windows you can restore older versions of the file.
When you create a snapshot of a share, initially it uses no space. Instead, the snapshot and the main share both reference exactly the same files. Over time, as you change the share (particularly deleting and changing files), the snapshot and the main share will begin to diverge, and the snapshot will begin to use space. There is an example I posted a couple of years back that might help you understand how this works: https://community.netgear.com/t5/ReadyNAS-in-Business/ReadyNAS-312-Need-Help-Understanding-Snapshots/m-p/936586#M3041
Snapshots are a handy way to retrieve older versions of files, but they do have some drawbacks. If you modify a file that is also in the snapshot, then the main copy of the file becomes fragmented. That can hurt NAS performance, so if a share contains a lot of files that are constantly re-written, you should leave snapshots turned off. Two examples: a share that is used for downloading torrents (say with transmission) is a bad candidate for snapshots, because the random blocks downloaded by the torrent will heavily fragment the share. Similarly, a share that holds an active SQL database is a bad candidate for snapshots, because the database updates will fragment the database. An iSCSI LUN also shouldn't use snapshots for similar reasons.
Snapshots are managed using the share settings wheel. Personally I use the "custom" snapshot settings on the NAS, because that gives me control over retention. For most shares, I use the settings shown in the screenshot below.
These settings take snapshots daily (around midnight) if the share contents have changed since the previous snapshot was taken. Retention is three months. I can roll back to older versions from the NAS web UI or by right-clicking in Windows and using it's previous versions function. What I can't do is browse the snapshots directly from Windows (which I see no need to do).
Some people might prefer snapshots taken more frequently, but daily works out well for me.
The NAS also offers "smart" snapshots. These are taken frequently and over time are "thinned out".
- Hourly snapshots are kept for 48 hours.
- Daily snapshots are kept for four weeks.
- Weekly snapshots are kept for eight weeks.
- Monthly snapshots are kept for as long as there is sufficient capacity. (The last weekly snapshot in a month becomes the monthly snapshot for that month.)
The indefinite retention of the monthly snapshots is why I don't like "smart" snapshots. Over time they take up a lot of space, and I need to manually delete them.
BTW, if you do want to delete snapshots to free up space, the best strategy is to delete the oldest snapshots first. They are the ones that are most diverged from the current share, so you free up the most space by doing that.
If you are running a backup job on the NAS, and the source of the backup is also on that same NAS, then the backup job will make a snapshot, and then back up that snapshot. That ensures that the backup is coherent (no files change while the backup is made). After the backup, that snapshot is deleted. If your backup source is remote, then this technique isn't used, so you do want to make sure the backups are scheduled off-hours.
Snapshots can't be used as backups because
- they are stored on the same machine, so will be lost if the NAS or it's RAID volume fails.
- data that hasn't changed is held in common with the main share (and other snapshots). So any damage in the main share usually also damages the snapshot.
- they will be automatically be deleted by the NAS if the file system gets too full.
Related Content
NETGEAR Academy
Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!