1

I am not able to understand how refreservation works. From the docs:

Sets the minimum amount of disk space that is guaranteed to a dataset, not including descendents, such as snapshots and clones. When the amount of disk space used is below this value, the dataset is treated as if it were taking up the amount of space specified by refreservation. [...]

As I understand it, refreservation should be effective only when being higher than the space which is already referenced by the dataset, or, the other way around, should do nothing when being lower than that. As an example, if I have a ZVOL which already refers 60 GB, and I add a refreservation of 50 GB to that ZVOL, what should this do? After all, by adding the refreservation, I am guaranteeing this ZVOL that it can refer at least 50 GB, but since it already refers 60 GB anyway, that shouldn't change anything, should it?

In my case, that action is eating available space in the parent dataset. Please consider the following list of commands and their output (I have removed lines regarding some other ZVOLs and datasets, because they would be distracting and wouldn't help understand the behavior):

root@cerberus:~/qemu-kvm# zfs list -o name,type,creation,volsize,available,used,referenced,reservation,refreservation,usedbydataset,usedbyrefreservation,usedbysnapshots,usedbychildren
NAME                    TYPE        CREATION               VOLSIZE  AVAIL   USED  REFER  RESERV  REFRESERV  USEDDS  USEDREFRESERV  USEDSNAP  USEDCHILD
rpool                   filesystem  Mon Jan 16  9:45 2017        -   672G  1.10T    96K    none       none     96K              0         0      1.10T
rpool/zvol-morn-system  volume      Tue Sep 15 20:43 2020      72G   722G   113G  63.0G    none        50G   63.0G          49.8G      238M          0
root@cerberus:~/qemu-kvm# zfs set refreservation=none rpool/zvol-morn-system
root@cerberus:~/qemu-kvm# zfs list -o name,type,creation,volsize,available,used,referenced,reservation,refreservation,usedbydataset,usedbyrefreservation,usedbysnapshots,usedbychildren
NAME                    TYPE        CREATION               VOLSIZE  AVAIL   USED  REFER  RESERV  REFRESERV  USEDDS  USEDREFRESERV  USEDSNAP  USEDCHILD
rpool                   filesystem  Mon Jan 16  9:45 2017        -   722G  1.05T    96K    none       none     96K              0         0      1.05T
rpool/zvol-morn-system  volume      Tue Sep 15 20:43 2020      72G   722G  63.2G  63.0G    none       none   63.0G              0      258M          0

In the first output, rpool/zvol-morn-system references 63 GB and has a refreservation of 50 GB, giving an overall usage of 113 GB (which is the first thing I don't understand), and the available space in the parent rpool is 672 GB. In the second output, I have removed the refreservation, which increased the space available in the parent rpool by those 50 GB. I don't understand why, because the actually referred space of that ZVOL already is more than 50 GB, so a refreservation of 50 GB should not have any effect.

Could somebody please explain where I am wrong?

I have studied ZFS's docs and man pages, and have studied several questions on SO and related sites. I have found a lot of information about ZFS space accounting, but couldn't find an explanation to this specific understanding problem.

1 Answer 1

0

The issue seems to be blocks that are referred from both snapshots and your dataset itself (hence, the space they consume would show under USEDSNAP if you delete the files but until then, they show under REFER).

I guess, despite that, they still fall under "disk space consumed by snapshots and clones" and thus don't decrease your USEDREFRESERV. You can check for them with zfs list -t snapshot in a situation like the one you described.

The answer to your first question is simpler: Refreservations by all means fall under the definition of "used" and thus increase USED, just like all the other USED* columns.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .