Skip to main content

Re: zfs list reports wrong size when working with files

  • From: Tim Kennedy < >
  • To:
  • Subject: Re: zfs list reports wrong size when working with files
  • Date: Tue, 2 Apr 2013 09:27:59 -0400




On Tue, Apr 2, 2013 at 3:05 AM, Peter Wood < " target="_blank"> > wrote:
I've been testing zfs configurations on OI 151a7 using 128MB files and I noticed that I'm getting the wrong pool sizes when using raidz.

<snip>
 
root@oiserver1:~# zpool list mypool
NAME     SIZE  ALLOC   FREE  EXPANDSZ    CAP  DEDUP  HEALTH  ALTROOT
mypool   492M   484K   492M         -     0%  1.00x  ONLINE  -
root@oiserver1:~#
==========

With raidz3 I'm expecting the size of 4 drives pool to be equal to the size of one drive but in the example above "zpool list" reported size that is close to a stripe configuration.

I'm getting the same behavior  for raidz and raidz2 with different number of drives.

Is this because I'm using files instead of real drives or am I missing something?

In zpool list, the SIZE column, is essentially the sum of the raw size of all the vdevs.  In this case, you have 1 raidz3 VDEV made from 4 128MB (MiB really) files.  The sum of the 4 files sizes, or the 'disk sizes' as it is, equals 512MiB.

libzfs_util.c has a function zfs_nicenum() that converts numbers to human readable forms.  it seems to have the effect of taking your "disk" sizes, and assuming they're decimal numbers, and converting them to binary.  In effect, it assumes that your 128MiB files are in fact 128MB files, and does the math, repetitively dividing by 1024 to convert them to MiB numbers.

128 MB = 122 MiB.  
512 MB = 488 MiB.

Your numbers aren't that far off from there, and the difference could be attributed to rounding happening somewhere.  I'd be interested to know if you can squeeze more than 492MiB worth of data into your raidz3 mypool, since you do, actually, have 512MB. 

At least, that's how I read it. :)

-Tim


zfs list reports wrong size when working with files

Peter Wood 04/02/2013

Re: zfs list reports wrong size when working with files

Ian Collins 04/02/2013

Re: zfs list reports wrong size when working with files

Peter Wood 04/02/2013

Re: zfs list reports wrong size when working with files

Eric Sproul 04/02/2013

Re: zfs list reports wrong size when working with files

Cindy Swearingen 04/02/2013

Re: zfs list reports wrong size when working with files

Peter Wood 04/02/2013

Re: zfs list reports wrong size when working with files

Tim Kennedy 04/02/2013
 
 
Close
loading
Please Confirm
Close