Hi,
During the upgrade to Dragonfish, one of my pools (ssd-storage) went from 65% used to 15%. Is there a way to correct this?
There is very little information to go on here. It is unclear whether you have lost data from the SSD pool or not. It is unclear whether you were upgrading from SCALE Cobia or CORE or something else.
As a pure guess, the most likely reason seems to me that snapshots were deleted during the upgrade (in which case you will have lost backup copies but not the live copy).
Sorry yes, Scale Cobia to Dragonfish is when it happened. There is a 300gig VM on that pool.
No data is lost everything works as before, only the used space changed from 65% to 15%, and has actually gone down a few percent since.
So a 460GB pool actually has a 300GB Zvol on it - which would be c. 65%, whereas 15% seems to be about 70GB.
From inside the VM, what is the used space on the Zvol? Also please post a screenshot of the Dataset summary for the pool & zvol.
I am thinking that it is possible that the Zvol is defined as Sparse
.
Here are a couple of Zvols I defined for comparison:
Some technical background:
- A sparse Zvol is created small and expands as blocks in the Zvol are used.
- If a block is used by a file in the VM and is deleted and the block is freed, then (by default??) TrueNAS doesn’t know about it. However if Trim is enabled inside the VM for the volume, then the VM O/S will issue a Trim command.
- If the Zvol is sparse and the guest O/S / iSCSI issues a Trim, then ZFS will free the space in the Zvol and the Zvol used space will reduce. This has been supported by ZFS for more than 6 years, so presumably was in both Cobia and Dragonfish.
So my hypothesis (in the absence of the further data I have requested which may confirm or refute it) is that Trim was not working under Cobia, and is working under Dragonfish. But why it would have changed is a mystery.
Note: SATA Trim is the same as SCSI Unmap - and presumably TrueNAS will handle whatever is appropriate depending on how the Zvol is presented to the guest O/S.
The Zvol VPN-gunsgn
is clearly shown as sparse. Which means that although it is sized as 400GB, all the unused blocks are not using any disk space.
Why it previously used the full size is actually the real question?
As for how to measure it in Windows, you want drive properties e.g. …
Based on the above screen shots, I would expect this to say:
Used space: c. 22GB
Capacity: c. 400GB
ah ok, I misunderstood, here is the VM space, I think you have solved the mystery!
How it became Sparse I will never know, is there a way to change it?
I have no idea why it either:
- Changed from non-sparse to sparse; or
- Trim started being used by the guest OS or trim started working within TrueNAS.
But, no, you cannot simply turn sparse off. If you want to do this, then you will need to:
- Create a non-sparse Zvol
- Copy the sparse Zvol to the non-sparse one.
- Delete the sparse Zvol.
BUT, why would you want to do this? As far as I can guess, there shouldn’t be any performance hit from it being sparse, but rather it e.g. allows you to define large volumes for the O/S at the outset and avoid having to process data migrations from one Zvol to another when you outgrow it.
Ah ok, my poor brain would just find it easier to understand if all three pools behaved the same I guess. Now I know how it works I’ll probably leave it alone, thanks for the explanation.