Snapshots - size on disk - is this a reliable backup?

Status
Not open for further replies.

flycast

Cadet
Joined
Dec 28, 2012
Messages
6
I have heard of snapshots but don't understand them very well. It looks to me like file data and directory listings are kept in blocks with a date/time stamp on the disk. If you take a snapshot it does not get rid of any blocks needed to recreate the file at that date/time stamp. If I change a file and I am taking a snapshot every 15 minutes then the filesystem will keep the blocks that are needed to recreate that file at every snapshot date/time. My questions:

1) Is the above basically right?
2) A snapshot itself takes almost no space since it is basically a record of date/time?
3) The disk may only have 1Gb of files but for every snapshot I "save" it will be saving the additional blocks needed to recreate the files at any one snapshot. Depending upon how many snapshots and how often I change files the additional space needed may grow quite a bit. I am guessing that these additional blocks are "stored" as an additional file somewhere?
4) Are snapshots a good backup plan?
5) Is there a way that I can use snapshots to create an offsite "backup" of a share?
 

Stephens

Patron
Joined
Jun 19, 2012
Messages
496
4) If you're trying to protect against accidental overwrite or deletion, yes. If you're trying to protect against a failed pool, no.
 

bollar

Patron
Joined
Oct 28, 2012
Messages
411
1. Basically yes.
2. Right. Snapshots when created are basically metadata, which includes the exact disk blocks used by each file. These blocks can't be copied over as the file changes and are reserved space.
3. ZFS is a copy on write system, so chanes to files are always written in a new location. The data is simply left in the old location and referred to by the snapshot.
4. On their own, no, snapshots are not a backup plan. Yes, they allow you to recover files that have been accidentally deleted, but don't protect you from hardware failure, theft, or some other issue that makes the data unaccessible. IMO, replication to another system is a form of backup, but it also has limitations.
5. Yes. ZFS replication takes those snapshots and creates a file that can be sent to another ZFS system. It's a lock-level transfer, so only changes to blocks are sent.
 
Status
Not open for further replies.
Top