Calculating ZFS pool sizes at different ashift values

Adam Nowacki nowakpl at platinum.linux.pl
Sat Feb 16 12:07:59 UTC 2013


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 at 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 at 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 at 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).



More information about the freebsd-fs mailing list