From owner-freebsd-fs@freebsd.org Tue Jan 16 14:56:03 2018 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 54314E74337 for ; Tue, 16 Jan 2018 14:56:03 +0000 (UTC) (envelope-from Mark.Martinec+freebsd@ijs.si) Received: from mail.ijs.si (mail.ijs.si [IPv6:2001:1470:ff80::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 117D27D16A for ; Tue, 16 Jan 2018 14:56:02 +0000 (UTC) (envelope-from Mark.Martinec+freebsd@ijs.si) Received: from amavis-ori.ijs.si (localhost [IPv6:::1]) by mail.ijs.si (Postfix) with ESMTP id 3zLYFC5Q51z4jl for ; Tue, 16 Jan 2018 15:55:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ijs.si; h= user-agent:message-id:references:in-reply-to:organization :subject:subject:from:from:date:date:content-transfer-encoding :content-type:content-type:mime-version:received:received :received:received; s=jakla4; t=1516114555; x=1518706556; bh=Vm/ PejeaRFEiiyg8a7FkRV9cZOWOqVZYyehvOEwgL2c=; b=LUwSrgTl2uh/XbQuf7/ +ld1bQfGHs5PCSlTyz32cXBy/Z7Bmqr8LvbT5+Pfh/qgbawHjNrKbYrMmNl5t6Qh GhSKk3N5sk+mTQudW1rzRdR6W6Mh+jjUpxXXo1RFSMjF4y0Y9EXO9M4/YhkHeF8f 1+WfjBfMz0SlXJjtITyM4iAE= X-Virus-Scanned: amavisd-new at ijs.si Received: from mail.ijs.si ([IPv6:::1]) by amavis-ori.ijs.si (mail.ijs.si [IPv6:::1]) (amavisd-new, port 10026) with LMTP id QI5RZFvEibBG for ; Tue, 16 Jan 2018 15:55:55 +0100 (CET) Received: from mildred.ijs.si (mailbox.ijs.si [IPv6:2001:1470:ff80::143:1]) by mail.ijs.si (Postfix) with ESMTP id 3zLYF710vlz4jk for ; Tue, 16 Jan 2018 15:55:54 +0100 (CET) Received: from nabiralnik.ijs.si (nabiralnik.ijs.si [IPv6:2001:1470:ff80::80:16]) by mildred.ijs.si (Postfix) with ESMTP id 3zLYF66TVGzGW for ; Tue, 16 Jan 2018 15:55:54 +0100 (CET) Received: from neli.ijs.si (2001:1470:ff80:88:21c:c0ff:feb1:8c91) by nabiralnik.ijs.si with HTTP (HTTP/1.1 POST); Tue, 16 Jan 2018 15:55:54 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 16 Jan 2018 15:55:54 +0100 From: Mark Martinec To: freebsd-fs@freebsd.org Subject: Re: Reducing ZFS fragmentation by copying to larger disk Organization: Jozef Stefan Institute In-Reply-To: References: Message-ID: <2bd5694830649fbe243daf533049d9d3@ijs.si> X-Sender: Mark.Martinec+freebsd@ijs.si User-Agent: Roundcube Webmail/1.3.1 X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 14:56:03 -0000 >> 1. attach new disks to a ZFS mirror and let them resilver, ... > > I don't think this would help with fragmentation at all. Thank you for confirming my guess! >> 2. use zfs send / receive to make a copy > > [...] It will even work within the same pool if there is enough free > space. Nice, this is helpful! Mark 2018-01-16 01:28, je Bob Friesenhahn wrote: > On Tue, 16 Jan 2018, Mark Martinec wrote: >> Having a ZFS filesystem with two 4 TB disks in a mirror that >> is 85 % full and apparently pretty much fragmented (scrubs >> or a resilver takes excessively long time), I intend to move >> its contents to a new pair of disks twice the size. >> >> My question is what method to use so that in the end the copy will >> be less fragmented: >> >> 1. attach new disks to a ZFS mirror and let them resilver, then >> remove the old disks (Would the copied content be any less >> fragmented, or perhaps would the added free space just >> relieve some of the problem?) > > I don't think this would help with fragmentation at all. > >> 2. use zfs send / receive to make a copy >> (is this any better than method #1 ?) > > This will work well as long as there is enough space to send to. It > will even work within the same pool if there is enough free space. > > Bob