ZVOL why is it so confusing?

jinu

Dabbler
Joined
Feb 11, 2021
Messages
15
Hi Folks

I am confused about a ZVOL i created in TRUE NAS. When i look at the properties of the ZVOL some the properties that are puzzling me are shown below. This is from the output of zfs get all <ZVOL NAME>.

PROPERTY VALUE SOURCE used 115G - available 16.0T - referenced 21.3G - compressratio 1.33x - reservation none default volsize 100G local volblocksize 32K - checksum on default compression lz4 inherited from VDEV1 refreservation 115G local usedbysnapshots 0B - usedbydataset 21.3G - usedbychildren 0B - usedbyrefreservation 93.7G -

My queries

  • How is it that used value at 115G is greater that vol size of 100G
  • How is Available 16T when ZVOL size is 100G
  • What is usedbyrefreservation and how do i reduce the size of it.
  • How do i find out what is the actual usage so that i know when to step in and increase the ZVOL Size
 

jinu

Dabbler
Joined
Feb 11, 2021
Messages
15
Anybody any advice ?
 

ornias

Wizard
Joined
Mar 6, 2020
Messages
1,458
Suggestion:
You might want to email the creators of ZFS instead/too, because the command you used isn't specific for TrueNAS.
Try the OpenZFS mailinglist ;-)
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
How do i find out what is the actual usage so that i know when to step in and increase the ZVOL Size
You don't, at least not through ZFS. That's the whole point of a virtual block device, you have someone running something on it. That something needs to know how full its given space (the nominal size of the zvol) is.
Ok, sure, there's TRIM/UNMAP, but relying on that working correctly to determine how full a device is is not something I'd recommend.

How is it that used value at 115G is greater that vol size of 100G
100 GB is the logical size, which does not include ZFS metadata or other overheads.

How is Available 16T when ZVOL size is 100G
ZFS has no robust way of knowing how much is used inside the zvol. Since "avail=0" is more than weird, reporting space available to any dataset that would be in the zvol's place is the less-weird option.

What is usedbyrefreservation and how do i reduce the size of it.
ZFS reserves space for zvols by default. This is a measure intended to keep you from shooting your feet off. If you feel you can do without it, the option exists.
 

jinu

Dabbler
Joined
Feb 11, 2021
Messages
15
Thanks. since i have a windows VM in the ZVOL, it will be easy to monitor that than the ZVOL
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
ZFS reserves space for zvols by default. This is a measure intended to keep you from shooting your feet off. If you feel you can do without it, the option exists.
zfs inherit -S refreservation pool/path/to/zvol

This will turn your zvol into the equivalent of a "thin provisioned" virtual disk in VMware.
 
Top