Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Jan 2016 22:40:35 +0000
From:      Gary Palmer <gpalmer@freebsd.org>
To:        kpneal@pobox.com
Cc:        "Eric A. Borisch" <eborisch@gmail.com>, FreeBSD Filesystems <freebsd-fs@freebsd.org>, lev@freebsd.org, Paul Kraus <paul@kraus-haus.org>
Subject:   Re: Restore only several files from ZFS snapshot without creating copy of them?
Message-ID:  <20160111224035.GA1019@in-addr.com>
In-Reply-To: <20160111222436.GE88498@neutralgood.org>
References:  <133976260.20160110023807@serebryakov.spb.ru> <C6068E3B-39EA-44FF-A8E6-E8067E51DE63@kraus-haus.org> <CAASnNnpGPoqQjNthvSKBkpEpkTW5wBSY_1OK8Sux0cCYdmByZA@mail.gmail.com> <20160111222436.GE88498@neutralgood.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Jan 11, 2016 at 05:24:36PM -0500, kpneal@pobox.com wrote:
> On Mon, Jan 11, 2016 at 03:39:08PM -0600, Eric A. Borisch wrote:
> > 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 several
> > >> 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 snapshots
> > >> 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 snapshots of these large files have expired (assuming you are expiring and destroying 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.
> 
> But can a clone be promoted to the "head" of a dataset? I thought a clone
> was always backed by a snapshot. The goal as I understood it was to get
> the files back into the normal dataset.

zfs promote
 
Regards

Gary

> Now, having a clone mounted with symlinks from the normal dataset to the
> mounted clone may work. It depends on whether or not the files get changed.
> (The point of the clone is to avoid having the snapshot deleted out from
> under you.)
> 
> Another idea would be to copy the files from the snapshot into the normal
> dataset and then to delete the old snapshots. This will leave you without
> the safety net of the old snapshots, but it will also leave you with one
> copy of the files in the normal location. It's not my place to say if that
> is acceptable or not.
> 
> -- 
> Kevin P. Neal                                http://www.pobox.com/~kpn/
> 
> "It sounded pretty good, but it's hard to tell how it will work out
> in practice." -- Dennis Ritchie, ~1977, "Summary of a DEC 32-bit machine"
> _______________________________________________
> freebsd-fs@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-fs
> To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org"
> 



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