Using Ubuntu 16.04 LTS as host and in LXD containers with ZFS storage.
I wanted to test out reclaiming unused space. In a container I created a 10gb file with dd. Saw the space taken up in both the container as well as in the host.
Upon deleting the 10gb file the container shows that space is no longer used/allocated. Host also shows that the space is no longer used by the lxd container mount, however, the host OS still shows that space in use.
I’ve tried a variety of ways to get that unused space released, but have only really found one way which is not really optimal. So far, the way I’ve figured out how to do this is basically to shutdown & delete all containers, delete images, unset zfs.storage_pool_name, destroy the zfs pool and then finally delete the zfs image file at /var/lib/lxd/zfs.img Doing that last step is what finally releases the unused space. But that’s basically restarting from scratch, which isn’t really optimal.
Is there another way to reclaim that unused space in the host OS that will not require deleting containers, images, zfs pool or the zfs.img file?
Thanks in advance for any help and advice.