Periodically run fsck on LXC

jsabater

Member
Oct 25, 2021
126
12
23
49
Palma, Mallorca, Spain
Good day everyone!

So I have a number of LXC on a Proxmox VE version 7.4 cluster with 5 nodes at the moment, and recently I had a file corruption problem on one of the nodes that affected the LXC in it (both SSD-ext4 pool and ZFS pool). That's in the past, but it got me thinking how am I supposed to periodically run pct fsck <id> if it needs to be stopped. I was looking for some option to run it on read-only mode or similar, just to detect the issues and inform about them. Is there any way to do so?

Code:
# pct fsck 111
cannot run fsck when container is running

Thanks in advance.
 
I use ZFS in two of the five nodes. Especifically, the one that had the filesystem corruption was using both SSD disks using software RAID 1 with ext4 and also ZFS disks in RAID 1. I had LXC on both storages, and all of them suffered from corruption.

Unfortunately, I never managed to figure out why it happened. Is there anything specific you'd advise me to look for, or a place to look at?

P.D. Especifically I had a PostgreSQL server on ZFS and it was refusing connections. Fortunately, I had very recent dumps of the databases, which were not critical at all.
 
Unfortunately, I never managed to figure out why it happened. Is there anything specific you'd advise me to look for, or a place to look at?
zpool status -v and zdb for debugging if it is an internal error. also everything else a linux system offers including syslog and dmesg