From owner-freebsd-questions@FreeBSD.ORG Thu Jan 23 02:29:28 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92136AF1 for ; Thu, 23 Jan 2014 02:29:28 +0000 (UTC) Received: from ipmail04.adl6.internode.on.net (ipmail04.adl6.internode.on.net [IPv6:2001:44b8:8060:ff02:300:1:6:4]) by mx1.freebsd.org (Postfix) with ESMTP id 28A251F75 for ; Thu, 23 Jan 2014 02:29:27 +0000 (UTC) Received: from ppp121-45-52-62.lns20.adl2.internode.on.net (HELO leader.local) ([121.45.52.62]) by ipmail04.adl6.internode.on.net with ESMTP; 23 Jan 2014 12:58:47 +1030 Message-ID: <52E07E5D.4080900@ShaneWare.Biz> Date: Thu, 23 Jan 2014 12:58:45 +1030 From: Shane Ambler User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Chris Stankevitz , Dan Nelson Subject: Re: ZFS: pool vs FS References: <20140122204828.GA6033@dan.emsphone.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jan 2014 02:29:28 -0000 On 23/01/2014 08:31, Chris Stankevitz wrote: > On Wed, Jan 22, 2014 at 12:48 PM, Dan Nelson wrote: >> "zpool create" does create a filesystem > > Dan, > > Thank you. I suspected this was the case (the FreeBSD handbook > certainly implies this). Now that we have that out of the way I can > ask my real question: > > Can you identify the concept I am missing as evidenced by this failure: > > === > > # truncate -s 100m disk1 > # truncate -s 100m disk2 > # zpool create pool1 /root/disk1 > # zpool create pool2 /root/disk2 > > So far so good... however, the next lines concern me. Some people > seem to say "Wait, /pool1 is not a good filesystem to start using you > need to uze 'zfs create' first". However your comment leads me to > believe that /pool1 is okay to start using right away. > > # echo asdf > /pool1/file.txt > # zfs snapshot pool1@123 > > Let's try to replicate: > > # zfs send pool1@123 | zfs recv pool2 > cannot receive new filesystem stream: destination 'pool2' exists > must specify -F to overwrite it > > Okay we have a problem. This is the heart of my misunderstanding. > But I'll try to power through: > > # zfs send pool1@123 | zfs recv -F pool2 > # zfs list -t snapshot > NAME USED AVAIL REFER MOUNTPOINT > pool1@123 18.5K - 31.5K - > pool1@124 0 - 31.5K - > pool2@123 0 - 31.5K - > > So far so good. And let's try another replication: > > # echo qwer > /pool1/file.txt > # zfs snapshot pool1@124 > # zfs send pool1@124 | zfs recv pool2 > cannot receive new filesystem stream: destination 'pool2' exists > must specify -F to overwrite it > # zfs send pool1@124 | zfs recv -F pool2 > cannot receive new filesystem stream: destination has snapshots (eg. pool2@123) > must destroy them to overwrite it The filesystem specified as the destination for recv must not exist therefore the need to -F the destination. The next snapshots should then be incremental or sent to a different filesystem. So we end up with the following steps - # zfs snapshot pool1@123 # zfs send pool1@123 | zfs recv pool2/pool1snaps # zfs snapshot pool1@124 # zfs send -i 123 pool1@124 | zfs recv pool2/pool1snaps this sends snapshot 124 as an incremental change from 123 # zfs snapshot pool1@125 # zfs send -i 124 pool1@125 | zfs recv pool2/pool1snaps this sends snapshot 125 as an incremental change from 124