Restore only several files from ZFS snapshot without creating copy of them?

Bob Friesenhahn bfriesen at simple.dallas.tx.us
Mon Jan 11 20:42:54 UTC 2016


On Mon, 11 Jan 2016, kpneal at pobox.com wrote:
>
> I believe you are stuck between the proverbial rock and a hard place. You
> have two options:
>
> 1) Have two copies of the files by making a copy from the snapshot like
> you said OR

The rock is somewhat softer than that.  All that is needed to remove 
most of the duplication is a file copy program which operates at the 
filesystem blocksize (e.g. 128k) and only copies blocks for existing 
files if the data in that block has changed.

Absent writing a dedicated copy program, rsync with options '-a 
--inplace --no-whole-file' comes close to copying the file without 
duplication since it compares blocks and only writes changed blocks 
(but not necessarily aligned to zfs blocks).

Use 'zfs diff' to quickly see which files have changed.

Bob
-- 
Bob Friesenhahn
bfriesen at simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/


More information about the freebsd-fs mailing list