Secondary volume on BTRFS and backup/export

Hello,

I have several questions about adding volume to a container:

  1. Is it possible to add a second volume to a container?
  2. Can the second volume be on the BTRFS pool configured with “lxd init”?
  3. Is it possible to exclude this disk from snapshots and “lxc export”?
pulsar@zira:~$ snap list
Name    Version    Rev    Tracking       Publisher   Notes
core    16-2.44.3  9066   latest/stable  canonical✓  core
core18  20200311   1705   latest/stable  canonical✓  base
lxd     4.0.1      14804  latest/stable  canonical✓  -
pulsar@zira:~$ lxc storage list
+-------+-------------+--------+-----------+---------+
| NAME  | DESCRIPTION | DRIVER |  SOURCE   | USED BY |
+-------+-------------+--------+-----------+---------+
| local |             | btrfs  | /dev/sda4 | 15      |
+-------+-------------+--------+-----------+---------+

Thank you for your time.

Custom storage volumes can be attached to containers and those are not part of any snapshots/backups of the container itself.

  • lxc storage volume create local some-name
  • lxc config device add container-name some-name disk source=some-name pool=local path=/srv/some-name

This would create a volume called some-name on your local pool and attach it at /srv/some-name in the container.

Hello,

Thank you very much for your answer! It works very well!