Confused on zvol size usage (too)

EtienneB

Explorer
Joined
Feb 19, 2018
Messages
78
I am lost with the ZVOL sizes, like many I read :smile:

The ZVOL for the 2 VMs were set at 20 and 48GB respectively upon creation (see table below).

I assume with the compression of 1.86 the 20GB turns into 36GB and the 48GB with 1.51 into 79GB?

But where does the Available space of these Volumes come from? That would turn my VMs in to 36+42=78GB and 79+64 = 143GB sizes, way different from the set 20GB and 48GB.
Inside the VM's, Ubuntu sees disk spaces of 20GB and 48GB only, so it can't expand there anyway automatically.
Snapshot usage of the VMs is around 4Gb, so not really of influence here.

I think the Available space of the VOLUME reduces the overall Available space on the pool?
I would like to reduce the free space of the VMs in order to have more overall free space on the pool.

I am lost here how free space works/manage that. Should I have set Force under the zvol option? Or set -S refreservation?

I ran into out-of-disk space on this pool last night, so I wiped 3 snapshots of around 5-9Gb each to get going again but I think the VMs are a big culprit here. Any explanations and suggestions are welcome.

I did read these links:



ssdpool(System Dataset Pool)ONLINE | 199.69 GiB (92%) Used | 17.31 GiB Free


NameTypeUsedAvailableCompressionCompression Ratio
ssdpool FILESYSTEM199.69 GiB17.31 GiBzstd1.70
iocage FILESYSTEM61.06 GiB17.31 GiBInherits (zstd)2.00
share FILESYSTEM22.48 GiB17.31 GiBInherits (zstd)1.03
virtual-machines FILESYSTEM115.44 GiB17.31 GiBInherits (zstd)1.60
freenasubuntu-w5xza VOLUME36.46 GiB42.53 GiBInherits (zstd)1.86
truenaspython-ev6kqg VOLUME78.98 GiB64.21 GiBInherits (zstd)1.51
 

Etorix

Wizard
Joined
Dec 30, 2020
Messages
2,134
"Free space" is not an easy notion in ZFS.

199.69 GiB used means just that: You have nearly 200 GiB of data in this pool (current data, older data in snapshots and metadata). "Compression ratio 1.70" means this would use 340 GiB if it were not compressed.
Inside your zvols, the guest OS sees exactly the space that was allocated to it—irrespective of how ZFS manages to compress it when storing on drive, or of how much ZFS has to store because it still retains data from older snapshots of the dataset.
I suspect you confuse the space occupied by snapshot metadata with the size of the data they refer to. 4 GB of snapshot metadata potentially refers to A LOT of (badly fragmented) data.

Incidentally, 92% is way too high for block storage—less than 50% is recommended for such applications.
 

EtienneB

Explorer
Joined
Feb 19, 2018
Messages
78
Thanks, after deleting the snapshots I went from 500Kbytes to this 17Gb.

The impression I have that the 42 and 62 GB Available is somehow limiting the iocage e.g. is untrue?

BTW, the cli gives this info
Code:
NAME      SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
ssdpool   224G   128G  95.9G        -         -    56%    57%  1.00x    ONLINE  /mnt
 

EtienneB

Explorer
Joined
Feb 19, 2018
Messages
78
As I have an external backup, I decided to remove all snapshots of this pool.
And indeed it freed up a lot more than I expected. The 4GB of snapshot space, has a lot of more underlying space, like 40Gb. Thanks for that!

ssdpool(System Dataset Pool)ONLINE check_circle | 129.98 GiB (60%) Used | 87.02 GiB Free

NameTypeUsedAvailableCompressionCompression RatioReadonlyDedup
ssdpool FILESYSTEM129.98 GiB87.02 GiBzstd1.54falseOFF
iocageFILESYSTEM32.76 GiB87.02 GiBInherits (zstd)1.84falseOFF
shareFILESYSTEM22.48 GiB87.02 GiBInherits (zstd)1.03falseOFF
virtual-machinesFILESYSTEM74.15 GiB87.02 GiBInherits (zstd)1.53falseOFF
freenasubuntu-w5xzaVOLUME25.39 GiB105.65 GiBInherits (zstd)1.79falseOFF
truenaspython-ev6kqgVOLUME48.75 GiB107.24 GiBInherits (zstd)1.47falseOFF
websiteFILESYSTEM1.04 MiB87.02 GiBInherits (zstd)1.56falseOFF

and the CLI:
Code:
NAME      SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
ssdpool   224G  91.1G   133G        -         -    46%    40%  1.00x    ONLINE  /mnt


(the CLI says only 40% cap utilization, the GUI 60%)

The only thing I can't get my head around to is the 105Gb and 107Gb of Available space, given the 87GB of the parent Virtual-Machines.
 
Top