SOLVED Beginner snapshot disk usage question

vaewyn

Cadet
Joined
Mar 8, 2022
Messages
6
Simple setup and I am not understanding ZFS's disk usage (or TrueNAS's reporting of it maybe?)

I have 1Tib of reserved space and then 4 zvols that are 12TiB each on a datastore that is 63.78TiB usable. My "Usage" graph in storage shows that I am using 77% of the space and is happy.

I put a chunk of data into each of these 4 zvols... the first zvol for example has 7TiB of data in it. If I do a single manual snapshot (no existing automatic or manual snapshots in the system at all before this) of this zvol my "Usage" graph jumps instantly from 77% to 88% and goes into the red.

So.... I thought the whole zfs snapshot idea was that you only "paid" for changes... yet a single snapshot in the system with 0 changes is charging me for 7TiB of additional space in the usage graph instantly.

When I look at 'zfs list -o space' it looks more logical to me and the usedsnap says '447K' for the zvol... but the "used" on it jumped from 12.0T to 18.9T also. (screenshot attached)

I ask all this because I have accidentally run that usage graph to 100% before and paid the price of restoring everything. I am not keen to do it again. :D

Thanks for any help/insight you folk can provide.
 

Attachments

  • Screenshot from 2023-02-07 09-24-25.png
    Screenshot from 2023-02-07 09-24-25.png
    64.5 KB · Views: 56

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
So.... I thought the whole zfs snapshot idea was that you only "paid" for changes... yet a single snapshot in the system with 0 changes is charging me for 7TiB of additional space in the usage graph instantly.
Only with regular datasets, not with zvols. I think with zvols, it will take up at least the "REFER" amount (may have to double check this).
 

vaewyn

Cadet
Joined
Mar 8, 2022
Messages
6
I think you may be right after doing some Googling... that makes zero sense though... zvols are still copy-on-write... and taking another snapshot doesn't eat an additional 7TiB of space again. Also... when I took the snapshot it didn't take enough time or have enough disk activity to have actually physically used another 7TiB of space so this strictly has to be a reservation type thing. Which once again shouldn't take space unless I change things in that reserved area. I can see having 7T on a zvol and zeroing all the data on it taking 14T then... but it shouldn't take the space until it is used.
This technically means I can never go above 40% utilization if I ever want to snapshot these zvols when they are full :/
 

vaewyn

Cadet
Joined
Mar 8, 2022
Messages
6
Reading some more.... it appears that a zvol always guaranties writes for the entirety of the assigned space. So if you ask for a 4T zvol and then a snapshot it is going to place any data used by the snapshot outside the zvol in the pool. It's basically guaranteeing that the zvol can never not do it's job no matter how much data changes before/after/between snapshots. So yes... if you want optimum performance, and you are using all zvols, keep your usage below around 40%.

Thanks for the prompt point in the right direction :)
 

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
Reading some more.... it appears that a zvol always guaranties writes for the entirety of the assigned space. So if you ask for a 4T zvol and then a snapshot it is going to place any data used by the snapshot outside the zvol in the pool. It's basically guaranteeing that the zvol can never not do it's job no matter how much data changes before/after/between snapshots. So yes... if you want optimum performance, and you are using all zvols, keep your usage below around 40%.

Thanks for the prompt point in the right direction :)
I guess that makes sense since zvols are mostly used for VM's and it needs to be able to guarantee to the VM's that it can always provide that empty space otherwise you'd run into all kinds of stability issues.
 
Top