Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Jan 2016 15:39:08 -0600
From:      "Eric A. Borisch" <eborisch@gmail.com>
To:        Paul Kraus <paul@kraus-haus.org>
Cc:        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:  <CAASnNnpGPoqQjNthvSKBkpEpkTW5wBSY_1OK8Sux0cCYdmByZA@mail.gmail.com>
In-Reply-To: <C6068E3B-39EA-44FF-A8E6-E8067E51DE63@kraus-haus.org>
References:  <133976260.20160110023807@serebryakov.spb.ru> <C6068E3B-39EA-44FF-A8E6-E8067E51DE63@kraus-haus.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Jan 11, 2016 at 3:20 PM, Paul Kraus <paul@kraus-haus.org> wrote:
> On Jan 9, 2016, at 18:38, Lev Serebryakov <lev@FreeBSD.org> wrote:
>
>> Hello FreeBSD,
>>
>>   I have a ZFS filesystem, which have daily snapshots. User removed seve=
ral
>> multi-gigabyte files by accident and need to get them back. These files =
are
>> present in old daily snapshots, allright. But as far as I understnad, if=
 I
>> do
>>
>> cp /fs/.zfs/snapshots/old-snapshot/file /fs/file
>>
>>   I got TWO copies of this file (one in live filesystem and future snaps=
hots
>> and other one in old snapshots). As files in question are multi-gigabyte
>> (about 100G alltogether) I don't want such duplication (dedup is turned =
off,
>> as it is very memory-consuming).
>>
>> Is it possible to restore these files without such data duplication?
>
> Could you leverage a CLONE of the snapshot until such time as other snaps=
hots of these large files have expired (assuming you are expiring and destr=
oying old snapshots after a certain amount of time) ? I am trying to think =
out of the box here and have to completely thought all this through.

I think you'll find a combination of Paul's and Bob's answers will be
your best bet; clone, then rsync (or some other update tool) into the
clone from the 'current' (with appropriate --exclude rules to not
delete the files in question, likely any other deletions will be
desired) and then rename/promote/delete when ready.

 - Eric



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