From owner-freebsd-fs@freebsd.org Mon Jan 11 23:44:19 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 90C7CA6C289 for ; Mon, 11 Jan 2016 23:44:19 +0000 (UTC) (envelope-from bfriesen@simple.dallas.tx.us) Received: from blade.simplesystems.org (blade.simplesystems.org [65.66.246.74]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 606881882 for ; Mon, 11 Jan 2016 23:44:18 +0000 (UTC) (envelope-from bfriesen@simple.dallas.tx.us) Received: from freddy.simplesystems.org (freddy.simplesystems.org [65.66.246.65]) by blade.simplesystems.org (8.14.4+Sun/8.14.4) with ESMTP id u0BNiHdt004582; Mon, 11 Jan 2016 17:44:17 -0600 (CST) Date: Mon, 11 Jan 2016 17:44:17 -0600 (CST) From: Bob Friesenhahn X-X-Sender: bfriesen@freddy.simplesystems.org To: kpneal@pobox.com cc: FreeBSD Filesystems Subject: Re: Restore only several files from ZFS snapshot without creating copy of them? In-Reply-To: <20160111222911.GF88498@neutralgood.org> Message-ID: References: <133976260.20160110023807@serebryakov.spb.ru> <20160111203257.GB88498@neutralgood.org> <20160111222911.GF88498@neutralgood.org> User-Agent: Alpine 2.01 (GSO 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (blade.simplesystems.org [65.66.246.90]); Mon, 11 Jan 2016 17:44:17 -0600 (CST) 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 23:44:19 -0000 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/