From owner-freebsd-fs@FreeBSD.ORG Sat Feb 16 12:07:59 2013 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 12D76E26 for ; Sat, 16 Feb 2013 12:07:59 +0000 (UTC) (envelope-from nowakpl@platinum.linux.pl) Received: from platinum.linux.pl (platinum.edu.pl [81.161.192.4]) by mx1.freebsd.org (Postfix) with ESMTP id CBFE27F3 for ; Sat, 16 Feb 2013 12:07:58 +0000 (UTC) Received: by platinum.linux.pl (Postfix, from userid 87) id 1D9B047E1A; Sat, 16 Feb 2013 13:01:02 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on platinum.linux.pl X-Spam-Level: X-Spam-Status: No, score=-1.3 required=3.0 tests=ALL_TRUSTED,AWL autolearn=disabled version=3.3.2 Received: from [10.255.0.2] (c38-073.client.duna.pl [83.151.38.73]) by platinum.linux.pl (Postfix) with ESMTPA id 1B47D47E0F for ; Sat, 16 Feb 2013 13:01:00 +0100 (CET) Message-ID: <511F74F5.2050900@platinum.linux.pl> Date: Sat, 16 Feb 2013 13:00:53 +0100 From: Adam Nowacki User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: freebsd-fs@freebsd.org Subject: Re: Calculating ZFS pool sizes at different ashift values References: <20130216112328.GA416@server.rulingia.com> In-Reply-To: <20130216112328.GA416@server.rulingia.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Feb 2013 12:07:59 -0000 On 2013-02-16 12:23, Peter Jeremy wrote: > I am trying to work out the impact of converting my ZFS pools from > ashift=9 to ashift=12. In theory, that's just a matter of getting a > list of the sizes of each object, rounding each size up to 4KiB and > summing the total but I'm having problems with the "each object" bit. Assuming single disk or mirror. For raidz parity and alignment has to be counted too. > "zdb -dd" reports each object and the 'dsize' column gives the on-disk > size. But it lists the objects in each filesystem snapshot so the > same object can appear multiple times in the output. And object > numbers are only unique within a filesystem, though they don't appear > to correlate with znode numbers for files. Further, the following > appears to show that the same object can have different sizes in > different snapshots: > Dataset zroot/var/obj@r242865a [ZPL], ID 8205, cr_txg 10094330, 820M, 75640 objects > Object lvl iblk dblk dsize lsize %full type > 54536 2 16K 128K 55.5K 256K 100.00 ZFS plain file > Dataset zroot/var/obj@r237444 [ZPL], ID 30, cr_txg 7939066, 573M, 64913 objects > 54536 1 16K 10.0K 2.50K 10.0K 100.00 ZFS plain file > > Does this represent a total of 55.5K on disk (the 2.5K in the second > snapshot is part of the 55.5K in the first snapshot) or 58K on disk > (the two objects are distinct despite having the same number)? > > Can anyone explain how to identify unique objects and their sizes within > a zpool? > 'zdb -vvvv zroot/var/obj@r242865a' and count unique DVAs. If both snapshots have same DVA then this particular block is shared. DVA is 'vdev number : offset : size' (in hex).