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? 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? Andy
On Fri, Sep 21, 2012 at 6:31 AM, andy thomas <andy at 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.
On Fri, Sep 21, 2012 at 12:05 AM, Stefan Ring <stefanrin at gmail.com> wrote:> On Fri, Sep 21, 2012 at 6:31 AM, andy thomas <andy at 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. --Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/zfs-discuss/attachments/20120921/3912e1bd/attachment.html>
On Sep 20, 2012, at 10:05 PM, Stefan Ring <stefanrin at gmail.com> wrote:> On Fri, Sep 21, 2012 at 6:31 AM, andy thomas <andy at 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.This is not correct. Every snapshot is a complete point-in-time view of the dataset. You can send differences between snapshots that can be received, thus satisfying a requirement for incremental replication. Internally, this is easy to do because the birth order (in time) of a block is recorded in the metadata.>> 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.Yes, rollback is not used very frequently. It is more common to copy out or clone the older snapshot. For example, you can clone week03, creating what is essentially a fork. -- richard -- illumos Day & ZFS Day, Oct 1-2, 2012 San Fransisco www.zfsday.com Richard.Elling at RichardElling.com +1-760-896-4422 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/zfs-discuss/attachments/20120921/30ecdb61/attachment.html>