[SOLVED] Proxmox trying to mount network shares before network is up

spiceygas

New Member
Mar 11, 2023
9
1
3
Proxmox: 7.3-6, 5.15.85-1-pve

I've got a network share setup in fstab:
//10.10.1.5/media /media/media cifs credentials=/root/.smbcredentials,iocharset=utf8,gid=0,uid=0,vers=3.0,rw 0 0

If I mount it manually then it works perfectly
mount -a

When I reboot the server then it doesn't mount. Looking at dmesg, it looks like Proxmox is trying to mount the cifs network share before the network is up, which will obviously fail. In fact, the network appears to be the very last thing done.

Question: How can I control the timing of mounting shares (and/or network) during boot to get things in the correct order?
 
normally systemd should recognize remote mounts automatically, but you can try _netdev as mount option in fstab. this tells systemd to mount after network is online.
I tried that. Didn't work.

I'm contemplating a cron @reboot task to do the mounting with a time delay, but that seems like a hacky band-aid.
 
Last edited:
Well, I solved it by putting an @reboot command in cron. It's not elegant, but it works. In case anyone else has a similar problem and wants to copy my solution, here's what I added to /etc/crontab.

@reboot root sleep 15 && mount -a

I also set VMs to have a startup delay to make sure network shares are mounted before they try to connect.
 
Last edited:
  • Like
Reactions: ChiquiFornari