# ZFS disk space



## Sylhouette (May 5, 2009)

Hello all 
I am running 8.0 Current from today and started to use ZFS.

I have 5 250GB disks

I have labeled them using glabel like ad5 = disk01, ad6 = disk02 to disk05

I have created a raidz2 pool named storage.

```
zpool create -f storage raidz2 label/disk01 label/disk02 label/disk03 label/disk04 label/disk05
```

zpool status give's me the following

```
zpool status
  pool: storage
 state: ONLINE
 scrub: none requested
config:

        NAME              STATE     READ WRITE CKSUM
        storage           ONLINE       0     0     0
          raidz2          ONLINE       0     0     0
            label/disk01  ONLINE       0     0     0
            label/disk02  ONLINE       0     0     0
            label/disk03  ONLINE       0     0     0
            label/disk04  ONLINE       0     0     0
            label/disk05  ONLINE       0     0     0

errors: No known data errors
```

i created some mountpoints and filesystems on the storage pool 

zpool list shows me the following


```
zpool list
NAME      SIZE   USED  AVAIL    CAP  HEALTH  ALTROOT
storage  1.13T   368M  1.13T     0%  ONLINE  -
```

All looks good.
But when i do a df -h on my system i get a total of 680M for my /storage pool?


```
df -h
Filesystem                 Size    Used   Avail Capacity  Mounted on
/dev/ad4s1a                496M    242M    214M    53%    /
devfs                      1.0K    1.0K      0B   100%    /dev
/dev/ad4s1e                989M     12K    910M     0%    /tmp
/dev/ad4s1f                217G    2.9G    197G     1%    /usr
/dev/ad4s1d                2.8G    844K    2.6G     0%    /var
storage                    680G    128K    680G     0%    /storage
storage/ncvs               680G    128K    680G     0%    /storage/ncvs
storage/www                680G    128K    680G     0%    /usr/local/www
storage/ports              680G    217M    680G     0%    /usr/ports
storage/ports/distfiles    680G    1.3M    680G     0%    /usr/ports/distfiles
```


zpool list shows me a pool of 1.13T Bytes
as where df gives me a size of 680G Bytes 

Now my main question, what is the actual size of the storage pool??

regards,
Johan


----------



## benkelly76 (May 5, 2009)

According to the zpool(1M) man page the space rules for a raidz2 are:



> A  raidz group with N disks of size X with P parity disks can hold  approximately  (N-P)*X  bytes ...



So in your case N=5, X=250GB, and P=2 and you get (5-2)*250GB = 750GB.  When you factor in filesystem overhead your value of 680GB doesn't seem too unreasonable.


----------



## SirDice (May 5, 2009)

5 * 250GB = +/- 1.13TB without accounting for the raidz.


----------



## phoenix (May 5, 2009)

*zpool list* shows you the size of all your disks (5 * 250 GB=~1.2 TB) including parity space.

*zfs list* shows you the space available to filesystems/volumes, after all the parity is accounted for.  With 2 parity disks, you get 3 * 250 GB = ~750 GB.  Add in ZFS overhead for redundant metadata and other info, and you get what you see.


----------



## Sylhouette (May 5, 2009)

Thanks all 

I knew it had something to do with the parity, but i just wanted to be sure.


regards,
Johan


----------

