From owner-freebsd-fs@freebsd.org Mon Jan 11 21:39:09 2016 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D74D9A6C036 for ; Mon, 11 Jan 2016 21:39:09 +0000 (UTC) (envelope-from eborisch@gmail.com) Received: from mail-qg0-x236.google.com (mail-qg0-x236.google.com [IPv6:2607:f8b0:400d:c04::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A45BF1616; Mon, 11 Jan 2016 21:39:09 +0000 (UTC) (envelope-from eborisch@gmail.com) Received: by mail-qg0-x236.google.com with SMTP id e32so324981102qgf.3; Mon, 11 Jan 2016 13:39:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=hPvqO/SM7UVcbvCtak38KvjEOLgmk+SmUUwypGvk8wY=; b=F1FP7eYTlEMgi3OeHgFCzuZEk8ufdbuDcSZwHBCqyhmYREC6keQN9gKBwdD5JUR119 CuOUJdASeHXQGKdLzQwrxX47hKdbw4lDg0rrPYqoU6IbJY95ues/rOlUCtACus3kfELe Fcc36y0v9D8CQ87bL02XIRl1ckU19KU2g0vbBs9Oar/RL7l1w0xkdDhYCF3mVtoAiJgb oKMCJDhh1hmB4+Pzj8XOsGqzZzaln3O21rW8PeAWdy7f3jOT78Iwjtu57SMfW5cJvQU/ tgjvWkZDUSb8VKfM9R1JS18tQvDNzu6E8bFCB63+GSocNpsJJkbxkCUW5rQW855Q2GZF /INg== MIME-Version: 1.0 X-Received: by 10.140.232.78 with SMTP id d75mr158713096qhc.27.1452548348734; Mon, 11 Jan 2016 13:39:08 -0800 (PST) Received: by 10.55.214.4 with HTTP; Mon, 11 Jan 2016 13:39:08 -0800 (PST) In-Reply-To: References: <133976260.20160110023807@serebryakov.spb.ru> Date: Mon, 11 Jan 2016 15:39:08 -0600 Message-ID: Subject: Re: Restore only several files from ZFS snapshot without creating copy of them? From: "Eric A. Borisch" To: Paul Kraus Cc: lev@freebsd.org, FreeBSD Filesystems Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 21:39:09 -0000 On Mon, Jan 11, 2016 at 3:20 PM, Paul Kraus wrote: > On Jan 9, 2016, at 18:38, Lev Serebryakov 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