The actual capacity of my filesystem is smaller than what I expected/calculated, and I'd like to better understand why. I suspect this may have something to do with some facet of ZFS like ashift or recordsize that I'm forgetting to account for. Please note that I do not believe this is related to misinterpreting the results returned by
Quick background:
I've been using ZFS on several OSes (OpenSolaris, FreeBSD, Linux) for a little over 8 years now, and am knowledgeable of the differences between the various sizes reported by
My understanding of those differences are, briefly:
As for my setup, I'm using the default recordsize=128K. My zpool was created with ashift=12 and contains a single RAID-Z2 vdev comprised of 11x8TB drives:
Each drive is exactly 8001563222016 bytes large, or roughly 8002GB|7452GiB, or 8TB|7.27TiB.
11 of these drives should yield a total capacity of 88017195442176 bytes, or roughly 88017GB|81972GiB, or 88TB|80.05TiB. The base2 value seems to agree well with
Since this is a RAID-Z2, I would expect 2*8TB|7.27TiB = 16TB|14.54TiB to be lost to parity, bringing the total capacity available to the filesystem down to 72TB|65.51TiB.
The actual value of 59T (15.5T used + 43.5T avail; not sure if it's base2 or base10) that I'm seeing reported is much smaller than the expected 72T|65.51TiB I calculated above:
Assuming zfs is reporting in base2, where am I losing those 6.51TiB (65.51TiB-59T) in expected vs. actual capacity? That's 9.93%!
The pool has deduplication disabled and has no snapshots. It does have lz4 compression enabled, though all data in the pool at the moment is incompressible.
zpool list
vs. zfs list
.Quick background:
I've been using ZFS on several OSes (OpenSolaris, FreeBSD, Linux) for a little over 8 years now, and am knowledgeable of the differences between the various sizes reported by
zpool list
, zfs list
, and df
. My understanding of those differences are, briefly:
zpool list
returns the number of bytes in use and the number of bytes available across all storage devices in a pool. It does not care about how those bytes are used (could be data, could be parity, could be housekeeping like the metaslab), it just simply returns how many bytes are used and how many are available.zfs list
returns the total number of bytes required by the filesystem. It intelligently understands parity devices (by not including them), filesystem metadata (by including it), compression (by returning the space required to store all files uncompressed), and deduplication (by returning the space required to store all duplicates).df
could return a value smaller or larger thanzfs list
since it does not understand how to interpret compression, snapshots, etc.
As for my setup, I'm using the default recordsize=128K. My zpool was created with ashift=12 and contains a single RAID-Z2 vdev comprised of 11x8TB drives:
Code:
# zdb | grep "ashift"
ashift: 12
# zfs get recordsize backuptank0
NAME PROPERTY VALUE SOURCE
backuptank0 recordsize 128K default
# zpool status
pool: backuptank0
state: ONLINE
scan: scrub repaired 0 in 0h0m with 0 errors on Sun Jul 31 03:33:54 2016
config:
NAME STATE READ WRITE CKSUM
backuptank0 ONLINE 0 0 0
raidz2-0 ONLINE 0 0 0
Z840BYL8-enc ONLINE 0 0 0
Z840BYSH-enc ONLINE 0 0 0
Z840BYXA-enc ONLINE 0 0 0
Z840BZA6-enc ONLINE 0 0 0
Z840BZG7-enc ONLINE 0 0 0
Z840BZK0-enc ONLINE 0 0 0
Z840CVPP-enc ONLINE 0 0 0
Z840DW23-enc ONLINE 0 0 0
Z840E0SR-enc ONLINE 0 0 0
Z840KHKL-enc ONLINE 0 0 0
Z840KK3X-enc ONLINE 0 0 0
errors: No known data errors
Each drive is exactly 8001563222016 bytes large, or roughly 8002GB|7452GiB, or 8TB|7.27TiB.
11 of these drives should yield a total capacity of 88017195442176 bytes, or roughly 88017GB|81972GiB, or 88TB|80.05TiB. The base2 value seems to agree well with
zpool list
, though ZFS's use of "T" to denote units is ambiguous:
Code:
# zpool list
NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
backuptank0 80T 20.9T 59.1T - 16% 26% 1.00x ONLINE -
Since this is a RAID-Z2, I would expect 2*8TB|7.27TiB = 16TB|14.54TiB to be lost to parity, bringing the total capacity available to the filesystem down to 72TB|65.51TiB.
The actual value of 59T (15.5T used + 43.5T avail; not sure if it's base2 or base10) that I'm seeing reported is much smaller than the expected 72T|65.51TiB I calculated above:
Code:
# zfs list
NAME USED AVAIL REFER MOUNTPOINT
backuptank0 15.5T 43.5T 15.5T /backuptank0
Assuming zfs is reporting in base2, where am I losing those 6.51TiB (65.51TiB-59T) in expected vs. actual capacity? That's 9.93%!
The pool has deduplication disabled and has no snapshots. It does have lz4 compression enabled, though all data in the pool at the moment is incompressible.