It is a little strange that although I explained the problem, people keep stating, that they suppose I didn't understand ZFS-(thin-provisioning). I just want to repeat that I DID fully understand ZFS in this respect. Unfortunately they didn't get the problem.
.
that is because you keep insisting that you understand how it should work, better, than people who are trying to point out for you that in fact you do not understand how it actually works. sorry but that is how your post,including one I am quoting, looks.
To repeat (assume compression disabled):
1) A new thin-provosioned ZVOL occupies (almost) no real space in ZFS. When reading from such a ZVOL, ZFS delivers zeros for every non-existing block, i.e. it delivers "virtual zeros" for "virtual blocks".
.
let start with this pearl of misunderstanding,
just because ZVOL, ZFS or any other FS returns zero for unused block, doesn't mean there is actually a zero there.
while there is such thing as "virtual blocks", there is no such thing as "virtual zero" .
and a file system even on a real device can have a virtual block, when you drop a partition table on a device you create a table and tell the file system that this is what you have on this disk. when you write something to a disk, 2 things happens,
first FS decides where to put the data and fills in the table with location info. i.e. this bit-go-here kind of things.
than it actually writes the data based on what it wrote in the table.
hence when you query the FS for info it simply reads a table and returns the value. since NULL is not a very good value to work with,
on table read it simply converts any null value to implied zero just for show. it knows very well that there is actually NULL there.
NULL as in absence of value, not zero as in a value of "0" , remember 4th grade algebra? "0" is still a value.
2) Only by writing to the ZVOL blocks get allocated. Further ZVOL (unfortunately) makes no difference between bllocks filled with real data and blocks filled with zeros, so even filling a ZVOL with only zeros allocated the full size of the ZVOL from the pool. From a filesystem and application view however the ZVOL didn't change, because it contains only zeroes, which are "virtual zeros" before filling the volume and "stored zeroes" after filling the volume with zeros.
.
and now we got here. and you are right, "ven filling a ZVOL with only zeros " will force the ZFS and any other FS to allocate a full size to the volume. that is because you are WRITING ACTUAL DATA to the volume. Remeber? a "0" is still a value , hence it is a REAL data.
now on a more polite note, you may try writing a NULL instead of zeros to the volume.
as in
!!!WARNING THIS WILL DESTROY YOUR DATA !!! "
dd if=/dev/NULL of=/dev/<my volume here> bs=500M count=1"
and than shrink the volume.