Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Jan 2016 17:44:17 -0600 (CST)
From:      Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
To:        kpneal@pobox.com
Cc:        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.1601111739350.2727@freddy.simplesystems.org>
In-Reply-To: <20160111222911.GF88498@neutralgood.org>
References:  <133976260.20160110023807@serebryakov.spb.ru> <20160111203257.GB88498@neutralgood.org> <alpine.GSO.2.01.1601111436190.2727@freddy.simplesystems.org> <20160111222911.GF88498@neutralgood.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 11 Jan 2016, kpneal@pobox.com wrote:
>>
>> 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).
>
> I don't think that will work to restore files from snapshots as snapshots
> appear as different filesystems to applications if I'm not mistaken. That's
> also why using "ln" to create a hard link won't work. Unless I'm mistaken.

Rsync just copies files from one location to another, and/or tries 
make the copy as similar to the original with minimal work.  It is 
easy to rsync from a snapshot (from 
/filesystem/.zfs/snapshot/snapshotname).

If there have been large changes to the file and there are 
intermediate snapshots, then even using rsync with '--inplace 
--no-whole-file' will still result in losing the space attributed to 
those intermediate snapshots.

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.1601111739350.2727>