LXC fails starting container when a mount point's "maximum mount count" is reached

rkk2025

Well-Known Member
Jul 11, 2018
34
4
48
33
My LXC containers are failing to start with segfault exceptions. It seems that the root cause for this is a mount that is not available when the LXC container is starting.

So what happens is that I have an external drive mounted at /mnt/external and that folder I have mounted in my LXC containers by using Mount Points. So the issue is that that external drive uses "Maximum mount count: 1", which means that every time the drive is mounted, it first runs fsck on it. This delays the mount and the LXC container fails to start. Is there some way to delay the LXC container from starting before the fsck is completed? I'm aware that setting Maximum mount count to -1 solves the issue, but then the drives are not checked for errors, which is not what I need.

As a suboptimal solution would be to use the "Startup delay" option from the containers, but that seems to not work properly. I can set startup delays of 60 seconds, and it will start anyway immediately and fail.

Any ideas or suggestions?
 
hi,

do you really need fsck to run every time?
you can use tune2fs with -c max-mount-counts flag and set it to 0

that will make the kernel disregard the number of times it has been mounted (so no fsck will be run for this reason, and that's ok)
 

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!