On Fri, Sep 21, 2012 at 12:05 AM, Stefan Ring <stefan...@gmail.com> wrote:

> On Fri, Sep 21, 2012 at 6:31 AM, andy thomas <a...@time-domain.co.uk>
> wrote:
> > I have a ZFS filseystem and create weekly snapshots over a period of 5
> weeks
> > called week01, week02, week03, week04 and week05 respectively. Ny
> question
> > is: how do the snapshots relate to each other - does week03 contain the
> > changes made since week02 or does it contain all the changes made since
> the
> > first snapshot, week01, and therefore includes those in week02?
> Every snapshot is based on the previous one and store only what is
> needed to capture the differences.
> > To rollback to week03, it's necesaary to delete snapshots week04 and
> week05
> > first but what if week01 and week02 have also been deleted - will the
> > rollback still work or is it ncessary to keep earlier snapshots?
> No, it's not necessary. You can rollback to any snapshot.
> I almost never use rollback though, in normal use. If I've
> accidentally deleted or overwritten something, I just rsync it over
> from the corresponding /.zfs/snapshots directory. Only if what I want
> to restore is huge, rollback might be a better option.
I wasn't going to jump into this quagmire, but I will.  To the second
question, if you've got snaps 1-5, and you roll back to snap 3, you will
lose snaps 4 and 5.  As part of the rollback, they will be discarded.  As
will any other changes made since snap 3.  If you delete snap 1 or snap 2,
any blocks they have in common with snapshot 3 will be retained, you will
simply see snap 3 "grow" because those blocks will now be accounted for
under snap 3 instead of snap 1 or snap 2.  Any blocks that were not shared
with snap 3 will be discarded.

Another point since you seem to be new to snapshots that I'll illustrate
with an example.

Say you've got snap 1, and in snap 1 you've got file 1.  File 1 is made up
of 20 blocks.  If you overwrite blocks 1-10 of file 1 50 times before you
take snapshot 2, snapshot 2 will only capture the final state of the file.
 You will not get 50 revisions of the file.  This is not continuous data
protection it's a point in time copy.

zfs-discuss mailing list

Reply via email to