Note creation of lots of files in /etc/lvm/archive
Thanks for this script, it's quite useful.
Something I noticed recently is when LVM snapshots are made, every old config is stored in /etc/lvm/archive by default. When running the snapshot script hourly, this directory can fill up with a lot of files, which surprised me. I ended up having a cron to delete old files in that directory. Might be worthwhile to just note it in the readme. Ideally I would prefer to skip snapshots for LVM, but this is probably not possible since vms/containers could have a combination of both LVM and ZFS resources.
Does tweaking the backup section of /etc/lvm/lvm.conf help at all? Specifically the retain_min and retain_days values could be helpful.
(I'm not associated with this project at all. I just started using it stubbled upon this question.)
Unfortunately not. These are minimum settings, not maximum.
https://serverfault.com/questions/653261/lvm-archive-and-backup-files-not-purging
As far as I know, ZFS snapshots are automatically removed by Proxmox itself when a lxc snapshot is removed. So, should these LVM metadata be automatically removed by Proxmox?
You could skip snapshots for LVM by using some tags on Proxmox, and exclude them on the command line.
Thanks for the feedback! I've added a note to the README about the accumulation of files in /etc/lvm/archive when using frequent LVM snapshots. It includes a suggestion to clean up old files periodically using a cron job.