Are remnants of old LXC in /var/lib/lxc safe to delete?

jsabater

Member
Oct 25, 2021
102
10
23
48
Palma, Mallorca, Spain
Hey everyone!

I had a problem with one of my nodes (proxmox3) on my LXC-only, 5-node, v7.4 cluster which lead to data corruption (filesystem) inside the LXC. I am still trying to figure out exactly what happened, but rebooting the machine triggered fsck on the main disks and the node was sort-of working correctly again.

The LXC using the local pool (ext4) as storage all had problems so I just ended up deleting and recreating them via Ansible playbooks, and restoring previous database backups (fortunately they were not critical).

But because I've been having intermitent network problems when trying to recreate these LXC in other nodes, and the big LXC with MinIO still in that node (using the zfspool pool) is taking longer than usual to start up, I have this feeling that there's garbage left behind that is confusing some of the mechanisms Proxmox uses to run things. Both inside the LXC and in the node.

So I've been digging and I just realised that there's a lot of things inside /var/lib/lxc that should not be there (there are just two LXC left on that node at the moment):

Code:
# ls -ha /var/lib/lxc/
.  ..  100  102  106  108  109  110  111  112  113  114  115  116  117  118  119  120  125  126  132  133  134  146  174  200  .pve-staged-mounts

Only 106 and 108 are actually there right now. So, my questions would be:

1. Is it safe to delete all the folders belonging to previous LXC that are no longer there?
2. Where else in the node should I be looking for garbage that may have been left over due to the data corruption, that may be affecting the way Proxmox handles things?

Thanks in advance.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!