Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Jan 2016 14:42:46 -0600 (CST)
From:      Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
To:        kpneal@pobox.com
Cc:        Lev Serebryakov <lev@freebsd.org>, FreeBSD Filesystems <freebsd-fs@freebsd.org>
Subject:   Re: Restore only several files from ZFS snapshot without creating copy of them?
Message-ID:  <alpine.GSO.2.01.1601111436190.2727@freddy.simplesystems.org>
In-Reply-To: <20160111203257.GB88498@neutralgood.org>
References:  <133976260.20160110023807@serebryakov.spb.ru> <20160111203257.GB88498@neutralgood.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 11 Jan 2016, kpneal@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@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.GSO.2.01.1601111436190.2727>