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

spiceygas

New Member
Mar 11, 2023
9
0
1
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:

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!