proxmox-autosnap icon indicating copy to clipboard operation
proxmox-autosnap copied to clipboard

Note creation of lots of files in /etc/lvm/archive

Open valankar opened this issue 1 year ago • 3 comments

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.

valankar avatar Oct 29 '24 13:10 valankar

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.)

lowell80 avatar Oct 30 '24 20:10 lowell80

Unfortunately not. These are minimum settings, not maximum.

https://serverfault.com/questions/653261/lvm-archive-and-backup-files-not-purging

valankar avatar Oct 31 '24 05:10 valankar

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.

jocelynj avatar Nov 07 '24 17:11 jocelynj

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.

apprell avatar Apr 20 '25 11:04 apprell