Niclas Sodergard
2006-Aug-31 12:44 UTC
[zfs-discuss] Find the difference between two snapshots
Hi everyone, Is there an easy way to find out which files has changed between two snapshots? Currently I''m doing a # rsync -arvn <snapshot1> <snapshot2> and it creates a list. But rsync needs to go through the whole filesystem and compare files. It would be nice if zfs would have this option builtin. Regards, Nickus
Niclas Sodergard
2006-Aug-31 13:00 UTC
[zfs-discuss] Find the difference between two snapshots
On 8/31/06, Tim Foster <Tim.Foster at sun.com> wrote:> Hi Nickus, > > On Thu, 2006-08-31 at 15:44 +0300, Niclas Sodergard wrote: > > Is there an easy way to find out which files has changed between two > > snapshots? Currently I''m doing a > > > > # rsync -arvn <snapshot1> <snapshot2> > > > > and it creates a list. But rsync needs to go through the whole > > filesystem and compare files. It would be nice if zfs would have this > > option builtin. > > Nope, unfortunately not - you''re interested in bug > http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6425091 > > - it''d be pretty handy for the zfs desktop integration stuff I was > playing with too...Thanks for the quick answer. It looks like the problem is much more complex than I first thought. cheers, Nickus
Hi Nickus, On Thu, 2006-08-31 at 15:44 +0300, Niclas Sodergard wrote:> Is there an easy way to find out which files has changed between two > snapshots? Currently I''m doing a > > # rsync -arvn <snapshot1> <snapshot2> > > and it creates a list. But rsync needs to go through the whole > filesystem and compare files. It would be nice if zfs would have this > option builtin.Nope, unfortunately not - you''re interested in bug http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6425091 - it''d be pretty handy for the zfs desktop integration stuff I was playing with too... cheers, tim -- Tim Foster, Sun Microsystems Inc, Operating Platforms Group Engineering Operations http://blogs.sun.com/timf
Nicolas Williams
2006-Aug-31 16:32 UTC
[zfs-discuss] Find the difference between two snapshots
On Thu, Aug 31, 2006 at 02:55:27PM +0100, Tim Foster wrote:> On Thu, 2006-08-31 at 15:44 +0300, Niclas Sodergard wrote: > > Is there an easy way to find out which files has changed between two > > snapshots? Currently I''m doing a > > Nope, unfortunately not - you''re interested in bug > http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6425091See also: 6370738 zfs diffs filesystems The idea is that SEEK_HOLE[*] could be used to find block-level diffs for individual files that have changed. [*] Or SEEK_DIFF, to avoid aliasing holes and diffs. Dealing with renames/links/unlinks is... harder. The idea is that a diffs filesystem would only show directories and files that have changed or are part of a path where some directory/file has changed, and all unchanged things would be hidden. You''d still have to do a fair bit of work at the app level to deal with renames/links/unlinks generally. Partly what is difficult here is that ZFS tracks differences between snapshots/filesystems at the block level, so you can find out that some dnode changed, but mapping that dnode to its name(s) in the filesystem, if it can have hardlinks (i.e., it''s not a directory) is as hard as it''s ever been to map inode #s back to paths. It''d be nice if there was a background dnode->paths indexer that could asynchronously maintain such an index (synchronously at snapshot time, so a snapshot could capture this index as it should be). Asynchronous so as not to slow down meta-data operations unnecessarily. If that''s too hard, then make it synchronous but let running it be optional per-filesystem. Nico --