I have a Debian 10 as host via LXD of several Debian, the problem is that in its day a Pool of 17GB LVM was made t now I do not know how to expand it, I also need to know how to pass it to ZFS that from what I have seen in forums and others Is it better and easier to manipulate than the pool in LVM, which you recommend, can you switch from LVM to ZFS?
You can create a new storage pool, which is bigger in size, and then move all the containers there.
Finally, switch to the new storage pool as the default one, and release the original pool.
For this to work, you need to have a recent LXD (i.e. the snap package with channel stable and not the LXD 3.0.x). To verify, run lxc move --help and check whether there is a --storage option.
It does not matter whether you use LVM or ZFS or btrfs. They all work. Since you use Debian and has ZFS only through DKMS, you may safely choose LVM or btrfs.
Here we go.
$ lxc storage list
+------+-------------+--------+--------+---------+
| NAME | DESCRIPTION | DRIVER | SOURCE | USED BY |
+------+-------------+--------+--------+---------+
| lxd | | zfs | lxd | 73 |
+------+-------------+--------+--------+---------+
$ lxc storage create secondpool zfs size=2GB
Storage pool secondpool created
$ lxc stop mycontainer
$ lxc move mycontainer mycontainer-tobemoved
$ lxc move mycontainer-tobemoved mycontainer --storage=secondpool
$ lxc start mycontainer
Once you have moved all the containers to the new storage pool, you can remove the original storage pool and keep using the new one. With lxc storage list, you can see how many containers are located in each pool.
Thanks for answering and helping me, when creating the ZFS pool I get the following error:
Error: The “zfs” tool is not enabled
And when you try to install it with apt-get you can’t find it in the repositories but in the snap they are.
I was really thinking of going to ZFS because in the documentation they recommend it in front of LVM but I don’t know whether to expand the size of the LVM that I have or change to ZFS
The ZFS error is that you do not have the zfsutils-linux package installed.
If you do not have the ZFS kernel support in the kernel, then it might be simpler to use btrfs.
Note that for your lvm storage pool you are currently using a loop file instead of a partition.
If you search this forum you will find similar discussions that used truncate to expand a file and then use a filesystem tool to fix the inner filesystem. This might or might not apply to LVM.
My suggestion though is to create a new storage pool with a storage backend of your choice, and move over all the containers.
Note that to create a storage pool to use a partition or drive, you specify the device name. Otherwise, it will use a loop file.
First, let’s make sure you are using the snap package of LXD.
$ which lxc
/snap/bin/lxc
$ which lxd
/snap/bin/lxd
Then, we check which channel you are tracking for the LXD snap package. In my case, I am tracking stable, which means LXD 3.18. For your case, it says 3.0.4, which means you are likely tracking 3.0/stable.