From owner-freebsd-current@FreeBSD.ORG Mon Jan 28 21:44:28 2013 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4B5FCD8B; Mon, 28 Jan 2013 21:44:28 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from email2.allantgroup.com (email2.emsphone.com [199.67.51.116]) by mx1.freebsd.org (Postfix) with ESMTP id D7B1EE60; Mon, 28 Jan 2013 21:44:27 +0000 (UTC) Received: from dan.emsphone.com (dan.emsphone.com [172.17.17.101]) by email2.allantgroup.com (8.14.5/8.14.5) with ESMTP id r0SLfD5F000686 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 28 Jan 2013 15:41:13 -0600 (CST) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (smmsp@localhost [127.0.0.1]) by dan.emsphone.com (8.14.6/8.14.6) with ESMTP id r0SLfCYg060240 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 28 Jan 2013 15:41:12 -0600 (CST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.14.6/8.14.6/Submit) id r0SLfBWT060239; Mon, 28 Jan 2013 15:41:11 -0600 (CST) (envelope-from dan) Date: Mon, 28 Jan 2013 15:41:11 -0600 From: Dan Nelson To: Fabian Keil Subject: Re: Zpool surgery Message-ID: <20130128214111.GA14888@dan.emsphone.com> References: <20130127103612.GB38645@acme.spoerlein.net> <1F0546C4D94D4CCE9F6BB4C8FA19FFF2@multiplay.co.uk> <20130127201140.GD29105@server.rulingia.com> <20130128085820.GR35868@acme.spoerlein.net> <20130128205802.1ffab53e@fabiankeil.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20130128205802.1ffab53e@fabiankeil.de> X-OS: FreeBSD 9.1-STABLE User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: clamav-milter 0.97.6 at email2.allantgroup.com X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (email2.allantgroup.com [172.17.19.78]); Mon, 28 Jan 2013 15:41:13 -0600 (CST) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on email2.allantgroup.com X-Scanned-By: MIMEDefang 2.73 Cc: Peter Jeremy , current@freebsd.org, fs@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2013 21:44:28 -0000 In the last episode (Jan 28), Fabian Keil said: > Ulrich Spörlein wrote: > > On Mon, 2013-01-28 at 07:11:40 +1100, Peter Jeremy wrote: > > > On 2013-Jan-27 14:31:56 -0000, Steven Hartland wrote: > > > >----- Original Message ----- > > > >From: "Ulrich Spörlein" > > > >> I want to transplant my old zpool tank from a 1TB drive to a new > > > >> 2TB drive, but *not* use dd(1) or any other cloning mechanism, as > > > >> the pool was very full very often and is surely severely > > > >> fragmented. > > > > > > > >Cant you just drop the disk in the original machine, set it as a > > > >mirror then once the mirror process has completed break the mirror > > > >and remove the 1TB disk. > > > > > > That will replicate any fragmentation as well. "zfs send | zfs recv" > > > is the only (current) way to defragment a ZFS pool. > > It's not obvious to me why "zpool replace" (or doing it manually) > would replicate the fragmentation. "zpool replace" essentially adds your new disk as a mirror to the parent vdev, then deletes the original disk when the resilver is done. Since mirrors are block-identical copies of each other, the new disk will contain an exact copy of the original disk, followed by 1TB of freespace. -- Dan Nelson dnelson@allantgroup.com