Technical

Proxmox etckeeper: Set It Up Without Breaking /etc/pve

Proxmox etckeeper: Set It Up Without Breaking /etc/pve

Proxmox etckeeper setup is simple once you know the one thing that breaks it: /etc/pve. That’s the pmxcfs mount, not a normal directory, and letting git touch it causes permission errors and cluster state commits you don’t want.

A chaotic array of electrical wires in front of a brick building in Kathmandu, Nepal.

Install and init

Install etckeeper and initialize the repo. On Debian-based Proxmox:

apt install etckeeper
etckeeper init

That creates a git repo at /etc and commits the current state. Fine so far.

Exclude /etc/pve

Now the important part. /etc/pve is a FUSE mount for the Proxmox cluster filesystem. Git can’t handle it like a normal directory. Add this to /etc/.gitignore:

echo "/pve/" >> /etc/.gitignore

Then remove any tracked files under /etc/pve if they got committed by mistake:

git -C /etc rm -r --cached pve 2>/dev/null
git -C /etc commit -m "Stop tracking /etc/pve"

That stops the permission errors and the noise from cluster state changes.

A network of power lines stretched against a vibrant blue sky, creating geometric patterns.

Hook the package manager

etckeeper already adds hooks for apt. Every time you install or remove a package, it commits /etc changes automatically. That’s the whole point. No extra config needed on Proxmox.

Manual commits

When you edit a config file by hand, commit it yourself:

cd /etc
git add -A
git commit -m "Changed something"

Or just use etckeeper commit which does the same and picks a message for you.

Why bother

Proxmox has its own backup for /etc/pve via the cluster filesystem, but the rest of /etc is not versioned. If you break a network config or a cron job, etckeeper lets you diff and revert. It’s cheap insurance. Just don’t let it near /etc/pve and you’re fine.

If you’re already fighting NFS storage issues on Proxmox, check this fix for error 500.

Leave a comment

Comments are reviewed before they appear. Your email is never published.