Configuring backups directory

For backup purposes LXD uses /var/snap/lxd/common/lxd/backups.
Since I don’t have enough space on my disk, what is the recommended way to make LXD use another directory (on another disk) while preparing a backup?

Have a look at the storage.backups_volume setting on the LXD server:

https://linuxcontainers.org/lxd/docs/master/server

You can create a custom storage volume, using a dir pool at a specific directory, or any of the driver types we support, and then specify that custom volume be used for backups.

thanks!
this is what I did and it worked for me

lxc storage create bkp_pool dir source=/data/lxdbkp 
lxc storage volume create bkp_pool bkp_vol  
lxc config set storage.backups_volume bkp_pool/bkp_vol

backup procedure uses /data/lxdbkp dir on a separate partition now

I intentionally put commands I executed here, and while I think that documentation is good, it could benefit from more examples, especially for newcomers

2 Likes