[SOLVED] LXC: More than 10 mount points possible?

bogo22

Well-Known Member
Nov 4, 2016
54
6
48
Hello,
i am using a linux container (samba server). I wanted to mount all zfs datasets from proxmox host with mount points to the linux-container to share them via samba.
I wondered why not all datasets are shared correlty (mp0 to mp9 is shared correctly and mp10 to mp22 isn't shared).
I finally
found the answer (which is kind of disappointing): "and you can configure up to 10 additional mount points".
So I can't use more than 10 mount points? Do you know a good alternative way to share more than 10 datasets? Only way I know is to install samba-server directly on proxmox and share them there.

thanks
 
Last edited:
I have no other way, so I patched PVE to be able to have more. You can just edit the file /usr/share/perl5/PVE/LXC/Config.pm directly, yet here is a more automatic way

Code:
--- /tmp/Config.pm    2016-07-17 18:59:28.884082554 +0200
+++ /usr/share/perl5/PVE/LXC/Config.pm    2016-07-17 18:59:36.811969832 +0200
@@ -16,7 +16,7 @@
 my $lockdir = "/run/lock/lxc";
 mkdir $lockdir;
 mkdir "/etc/pve/nodes/$nodename/lxc";
-my $MAX_MOUNT_POINTS = 10;
+my $MAX_MOUNT_POINTS = 32;
 my $MAX_UNUSED_DISKS = $MAX_MOUNT_POINTS;

 # BEGIN implemented abstract methods from PVE::AbstractConfig

Create a file with the contents in /root/pct_increase_max_mount_points_to_32.diff and apply with:

Code:
cd / && patch -p1 < /root/pct_increase_max_mount_points_to_32.diff

I'm working (if I have more time) on an easier way to apply own PVE patches that are update-aware.
 
I'm working (if I have more time) on an easier way to apply own PVE patches that are update-aware.

I know it can sometimes be cumbersome or seem like unnecessary extra work, but in the long-term you are almost always better off trying to upstream custom patches. even if you script a way to auto-apply them after updates, "patch applies" does not equal "patch is working as intended" ;)
 
Thanks for the patch and pointing to the mailing list.

@fabian It would be really great to be able to setup more than 10 mount points so the patch should be upstreamed.

PS: I read the mailing list and here is my modest opinion it: Even If more than 10 mount points really slows down the system i would accept that because for me it is more important to be able to mount all zfs datasets than the possible decrease in performance. So maybe you just add a note on the WIKI or inside the proxmox webgui (where i can add a mount point) that multiple mount points can slow down the container a bit. So every user can decide it by themself. LnxBil said that he doesn't noticed a performance slowdown though.
 

indeed, it sometimes takes some perseverance to convince devs to merge changes for which they themselves don't see an immediate use.

maybe we can re-evaluate offering recursive bind mounts? if I understand you correctly, that would be exactly what you need? bind mounts are already a root only feature, but still the security implications need to be thoroughly evaluated.. (just take a peek at the current bind mount related checks needed to prevent symlink based shenanigans). maybe we should take this to pve-devel again? ;)
 
We just ran into the limit of 10 mount points per container. Would it be sufficient to adjust $MAX_MOUNT_POINTS on all servers in the cluster? Could this become a per-cluster configuration option?
 
I am still waiting that $MAX_MOUNT_POINTS will be increased by default too. So far i have to manually edit it after update. Currently i have over 20 mount points inside one lxc and it works great (no errors or slow startup/high CPU usage etc). What is the progress of that? If i am correct we just have to increase the default $MAX_MOUNT_POINTS and update the webgui so it can display all / more than 9 mount points under LXC->Resources
 
Which lines do you change for the mount points to be visible in the GUI. Do have a diff to be applied to the Proxmox code? Do you automatically re-apply it after every update?
 
As far as I understand, the mp options and lxc.mount.entry are the same except for the /var/lib/lxc/$VMID prefix. Are both variants reflected in the GUI? Is mixing problematic?
 
Which lines do you change for the mount points to be visible in the GUI. Do have a diff to be applied to the Proxmox code? Do you automatically re-apply it after every update?

i don't have a patch, I only wanted to point out what must be done by the dev team. So, as far as I know there are really some users who would love to be able to set more than 10 mount points so I hope the dev team will change it. I don't know what the blocker of this change is, I only can say that the performance is pretty good and there is not delay in lxc boot etc if this is what the dev's are concerned about.
 
@fabian I would like to ask the status of it or what the final decision of increasing the default mount points ist. Like i said i set my $MAX_MOUNT_POINTS = 40; without any issues/delay.
 
Seems like the new default for $MAX_MOUNT_POINTS is increased to 256, so this should not be a problem anymore. Thread can be closed IMO. Thanks
 

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!