kobol-wiki/docs/helios64/install/lxd-zfs.md
Przemyslaw Kwiatkowski 1d2c31a15a ZFS on HDD
2020-12-21 09:21:53 +01:00

1.1 KiB

LXD with ZFS pool

When you already have working ZFS pool (see here) and want to use LXD - it is good idea to use them togeter.

Step 1 - Prepare filesystem

sudo zfs create -o mountpoint=none mypool/lxd-pool

Step 2 - Install LXD

sudo apt install lxd

You might want this:

sudo usermod -aG lxd your-user

Step 3 - Configure LXD

sudo lxc init

Configure ZFS this way:

Do you want to configure a new storage pool (yes/no) [default=yes]?  yes
Name of the new storage pool [default=default]: 
Name of the storage backend to use (dir, btrfs, ceph, lvm, zfs) [default=zfs]: zfs
Create a new ZFS pool (yes/no) [default=yes]? no
Name of the existing ZFS pool or dataset: mypool/lxd-pool
[...]

Step 4 - Optional

If you use zfs-auto-snapshot, you might want to consider this:

sudo zfs set com.sun:auto-snapshot=false mypool/lxd-pool
sudo zfs set com.sun:auto-snapshot=true mypool/lxd-pool/containers
sudo zfs set com.sun:auto-snapshot=true mypool/lxd-pool/custom
sudo zfs set com.sun:auto-snapshot=true mypool/lxd-pool/virtual-machines