Sunday, August 8, 2010

ZFS diff

A really nice feature have been implemented for ZFS, which allows you to list all file changes between two snapshots of a ZFS filesystem. The PSARC was filled in March but it has now been implemented. It will have a simple syntax just like diff(1):
# zfs diff zpool01/fs01@snap01 zpool01/fs02@snap02

With output in this format:
M       /myfiles/
M /myfiles/link_to_me (+1)
R /myfiles/rename_me -> /myfiles/renamed
- /myfiles/delete_me
+ /myfiles/new_file
From the PSARC:
" There is a long-standing RFE for zfs to be able to describe
what has changed between the snapshots of a dataset.
To provide this capability, we propose a new 'zfs diff'
sub-command. When run with appropriate privilege the
sub-command describes what file system level changes have
occurred between the requested snapshots. A diff between the
current version of the file system and one of its snapshots is
also supported.

Five types of change are described:

o File/Directory modified
o File/Directory present in older snapshot but not newer
o File/Directory present in newer snapshot but not older
o File/Directory renamed
o File link count changed

PSARC/2010/105 zfs diff

No comments: