Lars-Erik Bjørk
2007-May-11 14:57 UTC
[zfs-code] zfs_rollback(zfs_handle_t *zhp, zfs_handle_t *snap, int flag)
Hi all! I see that the zfs_rollback(zfs_handle_t *zhp, zfs_handle_t *snap, int flag) function destroys the more recent snapshots no matter what. Does anybody know a good way to avoid this if there are newer snapshots than the one specified? What is the meaning of the flag parameter in this function? Best regards, Lars-Erik -- Using Opera''s revolutionary e-mail client: http://www.opera.com/mail/
James Dickens
2007-May-11 15:21 UTC
[zfs-code] zfs_rollback(zfs_handle_t *zhp, zfs_handle_t *snap, int flag)
On 5/11/07, Lars-Erik Bj?rk <Lars-Erik.Bjork at sun.com> wrote:> > Hi all! > > I see that the zfs_rollback(zfs_handle_t *zhp, zfs_handle_t *snap, int > flag) function destroys the more recent snapshots no matter what. > Does anybody know a good way to avoid this if there are newer snapshots > than the one specified? What is the meaning of the flag parameter in this > function?you can copy/rsync from the previous snapshot to the current files without destroying snapshots, or you can clone the snapshot and work from that, though rollback is probably faster. Best regards,> Lars-Erik > > > > -- > Using Opera''s revolutionary e-mail client: http://www.opera.com/mail/ > _______________________________________________ > zfs-code mailing list > zfs-code at opensolaris.org > http://opensolaris.org/mailman/listinfo/zfs-code >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/zfs-code/attachments/20070511/bc641aa7/attachment.html>
Lars-Erik Bjørk
2007-May-11 15:36 UTC
[zfs-code] zfs_rollback(zfs_handle_t *zhp, zfs_handle_t *snap, int flag)
Is there an easy way to check if more recent snapshots exists? If you do a rollback using the CLI you''ll be told to use the -r option in order to rollback to older snapshots. I was hoping there was a similar library routine that would just result in an error if I tried to rollback to an older snapshot. On Fri, 11 May 2007 17:21:54 +0200, James Dickens <jamesd.wi at gmail.com> wrote:> On 5/11/07, Lars-Erik Bj?rk <Lars-Erik.Bjork at sun.com> wrote: >> >> Hi all! >> >> I see that the zfs_rollback(zfs_handle_t *zhp, zfs_handle_t *snap, int >> flag) function destroys the more recent snapshots no matter what. >> Does anybody know a good way to avoid this if there are newer snapshots >> than the one specified? What is the meaning of the flag parameter in >> this >> function? > > > you can copy/rsync from the previous snapshot to the current files > without > destroying snapshots, or you can clone the snapshot and work from that, > though rollback is probably faster. > > > Best regards, >> Lars-Erik >> >> >> >> -- >> Using Opera''s revolutionary e-mail client: http://www.opera.com/mail/ >> _______________________________________________ >> zfs-code mailing list >> zfs-code at opensolaris.org >> http://opensolaris.org/mailman/listinfo/zfs-code >>-- Using Opera''s revolutionary e-mail client: http://www.opera.com/mail/
Noël Dellofano
2007-May-11 19:21 UTC
[zfs-code] zfs_rollback(zfs_handle_t *zhp, zfs_handle_t *snap, int flag)
You may want to check out ''rollback_check''. It''s a callback function called by zfs_iter_children in zfs_do_rollback to tell if more recent snapshots exist than the one specified. It returns an error (providing you didn''t use the ''-r'' flag) if there are more recent snapshots. Noel On May 11, 2007, at 8:36 AM, Lars-Erik Bj?rk wrote:> Is there an easy way to check if more recent snapshots exists? If > you do a rollback using the CLI you''ll be told to use the -r option > in order to rollback to older snapshots. I was hoping there was a > similar library routine that would just result in an error if I > tried to rollback to an older snapshot. > > > On Fri, 11 May 2007 17:21:54 +0200, James Dickens > <jamesd.wi at gmail.com> wrote: > >> On 5/11/07, Lars-Erik Bj?rk <Lars-Erik.Bjork at sun.com> wrote: >>> >>> Hi all! >>> >>> I see that the zfs_rollback(zfs_handle_t *zhp, zfs_handle_t *snap, >>> int >>> flag) function destroys the more recent snapshots no matter what. >>> Does anybody know a good way to avoid this if there are newer >>> snapshots >>> than the one specified? What is the meaning of the flag parameter >>> in this >>> function? >> >> >> you can copy/rsync from the previous snapshot to the current files >> without >> destroying snapshots, or you can clone the snapshot and work from >> that, >> though rollback is probably faster. >> >> >> Best regards, >>> Lars-Erik >>> >>> >>> >>> -- >>> Using Opera''s revolutionary e-mail client: http://www.opera.com/ >>> mail/ >>> _______________________________________________ >>> zfs-code mailing list >>> zfs-code at opensolaris.org >>> http://opensolaris.org/mailman/listinfo/zfs-code >>> > > > > -- > Using Opera''s revolutionary e-mail client: http://www.opera.com/mail/ > _______________________________________________ > zfs-code mailing list > zfs-code at opensolaris.org > http://opensolaris.org/mailman/listinfo/zfs-code