From owner-freebsd-fs@freebsd.org Mon Jan 11 20:42:54 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 23284A6C8B3 for ; Mon, 11 Jan 2016 20:42:54 +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 E8C201435; Mon, 11 Jan 2016 20:42:53 +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 u0BKgka2004072; Mon, 11 Jan 2016 14:42:46 -0600 (CST) Date: Mon, 11 Jan 2016 14:42:46 -0600 (CST) From: Bob Friesenhahn X-X-Sender: bfriesen@freddy.simplesystems.org To: kpneal@pobox.com cc: Lev Serebryakov , FreeBSD Filesystems Subject: Re: Restore only several files from ZFS snapshot without creating copy of them? In-Reply-To: <20160111203257.GB88498@neutralgood.org> Message-ID: References: <133976260.20160110023807@serebryakov.spb.ru> <20160111203257.GB88498@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 14:42:46 -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 20:42:54 -0000 On Mon, 11 Jan 2016, kpneal@pobox.com wrote: > > I believe you are stuck between the proverbial rock and a hard place. You > have two options: > > 1) Have two copies of the files by making a copy from the snapshot like > you said OR 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). Use 'zfs diff' to quickly see which files have changed. Bob -- Bob Friesenhahn bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/ GraphicsMagick Maintainer, http://www.GraphicsMagick.org/