How to mount a read-only samba to share across nodes and then bind-mount on LXC

danielo515

Member
Nov 20, 2020
32
1
13
38
Hello.
I'm looking for a way to share a read-only samba across nodes. I tried to mount it on the UI but even if I just select it as container data it tries to create subfolders within the share, which is not permitted and not what I want.

I want to mount a shamba share in the cluster, that at least 2 of the 3 nodes can see and mount that in a LXC container.
Is it possible to do it in a way that it is automatically mounted on any reboot?

Also, I would like to have a shared samba rw where several containers can write to, but without the "private" subofolders, just write to the root.

Is this possible on the UI in proxmox 7 (my version)?
 
Hello.
I'm looking for a way to share a read-only samba across nodes. I tried to mount it on the UI but even if I just select it as container data it tries to create subfolders within the share, which is not permitted and not what I want.

I want to mount a shamba share in the cluster, that at least 2 of the 3 nodes can see and mount that in a LXC container.
Is it possible to do it in a way that it is automatically mounted on any reboot?

Also, I would like to have a shared samba rw where several containers can write to, but without the "private" subofolders, just write to the root.

Is this possible on the UI in proxmox 7 (my version)?
Hi,

while you can achieve this, there is no option in the WebUI to do this. You will have to mount the cifs share without being managed by ProxmoxVE. You can do this by setting the corresponding entry in the /etc/fstab, e.g:
Code:
//<hostname-or-ip/<share> /<path-to-mountpoint>   cifs   username=<user>,password=<passwd>,domain=WORKGROUP   0   0

It might be better to use a credentials file instead of username and password by passing credentials=<path-to-credential-file> instead.

Once the entry is mounted by mount -a, you can set the bind-mount to the containers.
 
Hello, thanks for your response.
I already have the entry in the fstab, and it mounts nicely without problems:

Code:
//192.168.0.110/pihole_db /media/pihole_share/ cifs rw,vers=3.0,credentials=/root/.smbcredentials 0 0

However, I don't see any option to mount that in the container. Also, this makes the container tied to the specific node it is at now, and I would prefer it to be 'moveable', but let's fix one thing at a time.
How do I mount the share now in the LXC container?
 

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!