Jellyfin Forum
SOLVED: network not mounted before jellyfin starts - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+--- Thread: SOLVED: network not mounted before jellyfin starts (/t-solved-network-not-mounted-before-jellyfin-starts)



network not mounted before jellyfin starts - binarygeek119 - 2025-04-14

from github

Description of the bug
when i go to reboot my server when everything comes back up and i go into a library its empty. and before i restarted it was full of media. i have to rescan and get my media back. im on a network share nfs mounted with fstab
192.168.1.2Confused-facemnt/user/media /media nfs defaults,fsc 0 0
i have set RequiresMountsFor in /etc/systemd/system/multi-user.target.wants/jellyfin.service
RequiresMountsFor=/media
im not sure what else i can do. it only happens if i reboot if i restart the jellyfin server its fine. only a full os reboot is when i lose everything.
Reproduction steps
  1. media is full
  2. sudo reboot
  3. media is empty
  4. rescan
  5. media is full again
What is the current 

response

Your Jellyfin server is starting up before the network mount has been mounted. Jellyfin sees nothing in the folders since the network mount is not up yet, so nothing is in the libraries as Jellyfin thinks that everything has been removed.

how do i make jellyfin wait for network to be up and running before starting?

my service file.
[Unit]
Description = Jellyfin Media Server
After = network-online.target
Wants=network-online.target

[Service]
RequiresMountsFor=/media
RequiresMountsFor=/mnt
Type = simple
EnvironmentFile = /etc/default/jellyfin
User = jellyfin
Group = jellyfin
WorkingDirectory = /var/lib/jellyfin
ExecStart = /usr/bin/jellyfin $JELLYFIN_WEB_OPT $JELLYFIN_FFMPEG_OPT $JELLYFIN_SERVICE_OPT $JELLYFIN_NOWEBAPP_OPT $JELLYFIN_ADDITIONAL_OPTS
Restart = on-failure
TimeoutSec = 15
SuccessExitStatus=0 143

[Install]
WantedBy = multi-user.target


RE: network not mounted before jellyfin starts - TheDreadPirate - 2025-04-14

Are your network shares mounted at /media and /mnt? What are the contents of /etc/fstab?


RE: network not mounted before jellyfin starts - binarygeek119 - 2025-04-14

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>  <type>  <options>      <dump>  <pass>
# / was on /dev/sda2 during curtin installation
/dev/disk/by-uuid/6e157833-fbec-41a5-994a-490c34f02362 / ext4 defaults 0 1
# /boot/efi was on /dev/sda1 during curtin installation
/dev/disk/by-uuid/6821-3E62 /boot/efi vfat defaults 0 1
/swap.img      none    swap    sw      0      0

192.168.1.2: /mnt/user/media    /media nfs    defaults,fsc        0      0
192.168.1.2: /mnt/user/photoprism    /mnt nfs    defaults,fsc        0      0

theres no space after the ip address and before the slash. it added a emoji there so fixed it for post.


RE: network not mounted before jellyfin starts - binarygeek119 - 2025-04-14

i think i got it.
i needed to change want=network-online.target to Requires=network-online.target

[Unit]
Description = Jellyfin Media Server
Requires=network-online.target

[Service]
RequiresMountsFor=/media
RequiresMountsFor=/mnt
Type = simple
EnvironmentFile = /etc/default/jellyfin
User = jellyfin
Group = jellyfin
WorkingDirectory = /var/lib/jellyfin
ExecStart = /usr/bin/jellyfin $JELLYFIN_WEB_OPT $JELLYFIN_FFMPEG_OPT $JELLYFIN_SERVICE_OPT $JELLYFIN_NOWEBAPP_OPT $JELLYFIN_ADDITIONAL_OPTS
Restart = on-failure
TimeoutSec = 15
SuccessExitStatus=0 143

[Install]
WantedBy = multi-user.target