Great stuff!
I have followed the instructions given and it does indeed seem to have worked; my container’s space is now larger! Thank you.
To confirm, this is what I did:
sudo apt install zfsutils-linux # to get the zfs command
zfs list -t all
# this lists loads of stuff, but "default" is at the top
# and shows the amount of space I had, which was 27GB
sudo ls /var/snap/lxd/common/lxd/disks/default.img
# this file exists, confirming that I have ZFS, it's using a loop file,
# it's called "default", and I'm using the snapped LXD
lxc stop cbuild # stop my LXD instance; unsure if this is required
sudo snap stop lxd # for non-snap this might be sudo service stop lxd?
# unsure if stopping lxd is required before fiddling with the ZFS stuff
sudo truncate -s +10G /var/lib/lxd/disks/default.img
# I wanted to add 10G of space because, as above, I told
# the container it had 40GB rather than the 30GB it had already
# for the below the docs say "lxd", not "default", as the pool name
# if you put the wrong name you get "cannot open 'lxd': no such pool"
sudo zpool set autoexpand=on default
sudo zpool online -e default /var/lib/lxd/disks/default.img
sudo zpool set autoexpand=off default
sudo snap start lxd # and restart lxd
lxc start cbuild # and my instance
and everything worked. So thank you for that!