Question regarding LXC's & Proper use of MP

Chieflewus

New Member
Aug 23, 2023
11
1
3
I've read a few separate articles regarding this and I leave more confused each time. I've successfully accomplished what I set out to do it seems but I wanted to verify this is proper before I get to far down the road and have to start over with each LXC.

A little background on my setup.... I've got two servers. One is my PVE and the other is a NAS. My goal was to run services like nextcloud and immich in there own LXC's but my problem was I didn't have enough storage available to my PVE host. So I made separate smb/cifs shares for each service and attached them to my PVE. {Looking back it probably would of been better for one shared smb/cifs for the PVE host instead of a bunch of different ones} The containers are all unprivileged as well.

While creating the lxc's I installed the OS and main software on a root disk via local-zfs and mounted each cifs share via the GUI. Then pointed the data portion of each service to that mp path in the docker compose files. Everything works as expected, the root disk holds the OS and software portion while the data is stored in the cifs share. What has me confused is when I was researching this prior to trying it myself it seemed as if this would not work and was not the proper way to go about it due to root privileges and such. Is there an error in my setup that will hurt me down the road or is all well? Looking back I may go back and just make a mass cifs share to mount to my PVE and just use one instead of making multiple for each LXC service.

I don't know why I'm worried about it... They all work as expected it just seemed like it was going to be a lot more in depth upon my initial research.
 
There are at least two ways of doing this:
  • mounting the share on your host and do bind-mounting (what you did)
  • mount the share directly in your LX(C) container with proper settings in PVE to allow this (default is deny)
Both ways work, yet are configured on different levels. The main problem I see at the moment that you may run into are the permissions of files on the share. If everything works inside of your container, you're good to go.
 
There are at least two ways of doing this:
  • mounting the share on your host and do bind-mounting (what you did)
  • mount the share directly in your LX(C) container with proper settings in PVE to allow this (default is deny)
Both ways work, yet are configured on different levels. The main problem I see at the moment that you may run into are the permissions of files on the share. If everything works inside of your container, you're good to go.
I appreciate your reply! I'll stop worrying about it as it seems I lucked out and everything worked fine with my permissions.