Re: free space considerations writing bhyve image to a zvol

From: Martin Simmons <martin_at_lispworks.com>
Date: Wed, 18 Oct 2023 16:05:57 UTC
>>>>> On Wed, 18 Oct 2023 13:58:12 +0100, void  said:
> 
> A linux file-backed vm was created initially like this:
> 
> truncate -s 2T linuxvm.img
> 
> Within the vm, df -h reports 1.1Tb used in total.
> Externally, on the freebsd host, the linuxvm.img is 2Tb.

How did you measure this external size?  The truncate command will create a
file taking 0 bytes of space initially.  You need to use du linuxvm.img on the
host to see how much is being used at the moment.

> If i write the vm to a 1.6Tb zvol with compression set (lz4),
> would it be feasible to expect the vm to work?
> 
> I expect it might break the vm's filesystem internally,
> now, thinking about it.

If the writing succeeds then I don't see how it would affect the vm's
filesystem, because that just sees the same data regardless of how it is
actually stored by the host.

More interesting is what will happen if the vm's filesystem becomes fuller and
the compressed size exceeds 1.6Tb.  The host will report an error, but I don't
know if the vm will handle it gracefully (it might see it as the equivalent of
a disk write error).

__Martin