Container mount not starting reliably

SkipMorrow

New Member
Jan 7, 2024
4
0
1
First post here, so please go easy on me! I've been using proxmox for less than a week! But I have been using linux for many years, so I have that going for me.

I have a Ubuntu container for Plex. My media files are stored on my Synology NAS. I have a systemd script set up to start the mount after reboots, but it almost never starts. I think it has worked once or twice, but I could be mistaken because I've been doing a lot of work with it. Anyway, after rebooting, the NAS files have not been mounted. I can verify with systemctl status. But if I manually run systemctl start a few minutes after booting, the mount is set up as expected. It looks like the container thinks the network is unreachable???

Code:
root@plex:~# systemctl status mnt-plex.mount
x mnt-plex.mount - Plex Media Server files
     Loaded: loaded (/etc/systemd/system/mnt-plex.mount; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sun 2024-01-07 14:50:52 EST; 8min ago
      Where: /mnt/plex
       What: //192.168.0.2/data
        CPU: 1ms

Jan 07 14:50:52 plex systemd[1]: Mounting Plex Media Server files...
Jan 07 14:50:52 plex mount[112]: mount error(101): Network is unreachable
Jan 07 14:50:52 plex mount[112]: Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
Jan 07 14:50:52 plex systemd[1]: mnt-plex.mount: Mount process exited, code=exited, status=32/n/a
Jan 07 14:50:52 plex systemd[1]: mnt-plex.mount: Failed with result 'exit-code'.
Jan 07 14:50:52 plex systemd[1]: Failed to mount Plex Media Server files.
root@plex:~# systemctl start mnt-plex.mount
root@plex:~# ls /mnt/plex/
'#recycle'   cache   downloads   media
root@plex:~# cat /etc/systemd/system/mnt-plex.mount
[Unit]
  Description=Plex Media Server files
  Requires=network-online.target
  After=network-online.service

[Mount]
  What=//192.168.0.2/data
  Where=/mnt/plex
  Options=credentials=/root/.cifs_credentials,uid=999,gid=999
  Type=cifs

[Install]
  WantedBy=multi-user.target
root@plex:~#

Is there anything I can do to make this work as expected after reboots? Honestly, I'd be OK with perhaps having it run a minute or two after booting with a cron job, but that seems like a kludge to me.
 
Hi,
I think you have a small mistake in your config, shouldn't After=network-online.service be After=network-online.target?
 
I think that would be better. But I tried it and it still didn't work. For now I have a cron job set to start it 30 seconds after bootup, but I still wonder what is wrong with it. Thank for replying though!
 

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!