If NFS is not available cant start Container

lpereira

New Member
Nov 20, 2022
10
0
1
Hi,
I have 2 containers one privileged and another unprivileged both have the same configuration on /etc/fstab
They both start if the NFS storage is available. However, when NFS storage is not available, the unprivileged container fails to start and the privileged starts but never connects to the NFS storage once it has connection.


The first container, privileged container, has the following configuration on /etc/fstab
Code:
//192.168.1.X/media /mnt/Media cifs username=username,password=password
h,uid=998,gid=998,file_mode=0777,dir_mode=0777 0 0
//192.168.1.X/media2 /mnt/Media2 cifs username=username,password=password,uid=998,gid=998,
file_mode=0777,dir_mode=0777 0 0

The problem is that when the 192.168.1.x is not available on container startup, it will never retry once is available. Therefore, I have to restart it to have access to the NFS.

The second container which is unprivileged, does not start when there is no connection to the NFS storage.
In this container, I can see the mount points under resources (container interface).

What am I doing wrong?
I just want the container to start even if there is no connection to the NFS, and when the connection is once again established reconnect to it.
 
The problem is that when the 192.168.1.x is not available on container startup, it will never retry once is available. Therefore, I have to restart it to have access to the NFS.
fstab does not have a retry mechanism, either it is able to mount on boot, or you have to do "mount -a" (or other more targeted variant) after boot.
If you want retries, switch to using "systemd" unit if you can. Or create a boot script/loop.

I dont know what the deal is with your unpriv container, but if in the end it relies on fstab - it has the same problem as above.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
The first container, privileged container, has the following configuration on /etc/fstab
Code:
//192.168.1.X/media /mnt/Media cifs username=username,password=password
h,uid=998,gid=998,file_mode=0777,dir_mode=0777 0 0
//192.168.1.X/media2 /mnt/Media2 cifs username=username,password=password,uid=998,gid=998,
file_mode=0777,dir_mode=0777 0 0
FYI: NFS and CIFS are both network file systems, yet NFS (which is the acronym for network file system) is a protocol as is CIFS, so those are not synonyms.