# actual pool size vs free space



## _martin (Nov 16, 2012)

I've a ZFS pool portal with the following setup: 


```
(~)# zpool list portal
NAME     SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
portal  3.62T  3.34T   294G    92%  1.00x  ONLINE  -
(~)#

(~)# zpool status portal
  pool: portal
 state: ONLINE
 scan: scrub repaired 0 in 3h44m with 0 errors on Fri Nov  9 02:28:30 2012
config:

        NAME        STATE     READ WRITE CKSUM
        portal      ONLINE       0     0     0
          raidz1-0  ONLINE       0     0     0
            ada5    ONLINE       0     0     0
            ada2    ONLINE       0     0     0
            ada3    ONLINE       0     0     0
            ada4    ONLINE       0     0     0

errors: No known data errors
(~)#

(~)# for i in 5 2 3 4; do smartctl -i /dev/ada$i; done | grep -i device\ m
Device Model:     MAXTOR STM31000340AS
Device Model:     MAXTOR STM31000340AS
Device Model:     MAXTOR STM31000340AS
Device Model:     ST31000525SV
(~)#
```

Now when I check the actual FS: 


```
(~)# zfs list portal
NAME     USED  AVAIL  REFER  MOUNTPOINT
portal  2.50T   176G  31.4K  none
(~)#
```

According to zpool man page:


```
A raidz group with N disks of size X with P parity disks  can
                 hold   approximately   (N-P)*X  bytes  and  can  withstand  P
                 device(s) failing before data integrity is  compromised.
```

Which means I've 4N,1P in this setup. 4 disks together give capacity of 3.62TB (0.905TB per disk). Usable size should be (4-1)*0.905 = 2.715TB. 

zfs list command indicates I've used 2.50TB. I'd assume I still have 2.715 - 2.50 = 0.215 TB ~= 220GB free of space. 

But now I'm confused - which value is actually true here ? One from zpool, zfs or one I've tried to figure out myself ?

Thanks.


----------



## usdmatt (Nov 16, 2012)

http://cuddletech.com/blog/pivot/entry.php?id=1013
http://mail.opensolaris.org/pipermail/zfs-discuss/2011-June/048903.html

Your overall pool size is 3.62T.
Available space after raidz is 2.715T.
ZFS is reserving 1/64th giving you availble space of approx 2.672T (2.715 - 1/64th)
ZFS command shows used of 2.5T + avail of 176G, so 2.5T + 176G = 2.676T

Seems about right.

The man page is just covering the overall pool size, it doesn't seem to mention the reserved space.


----------

