So, I’ve been trying to figure out how to install jellyfin with the best options here so i made my choice, and it’s finally installed but i have some issue with refreshing the library,
Ok, I have a ProxMox server (Host) with 1T HDD installed, and i created an ubuntu server vm (Not Container) and installed jellyfin on that vm.
I attached my 1T hdd as a virtual hdd from host server to jellyfin vm using this code
/sbin/qm set 500 -virtio2 /dev/disk/by-id/UUID
And made it auto mount using fstab, and it’s working great
However, if i made any changes to the original dir on host, it doesn’t reflect on jellyfin until reboot
i.e, if i added new movie say it’s Batman Begins to the host original dir, it doesn’t show up in the mount point in jellyfin vm when i use ls -l until i reboot the vm.
This is a very painful process which i don’t think that it suppose to be that way when i add every new file or even rename a folder i should reboot the whole vm
I tried using mount -a to remount the vda but it’s not working
I tried using "sync"option in the fstab but it 's not working also
What could be wrong? and how do i fix this issue?
Here is the advise from ChatGPT, it’s been invaluable in helping me setup my server and I think it can be for you as well
To address the issue with your Jellyfin setup on an Ubuntu server VM within ProxMox, where changes in the host directory are not reflected in the Jellyfin VM without a reboot, let’s explore three potential solutions:
Solution 1: Adjust Settings (Minimal Changes)
-
Check Mount Options: Ensure your
/etc/fstab
entry for the mounted drive uses options likeauto
,rw
,exec
,nosuid
,nodev
,nouser
, andasync
. These settings can help with automatic detection and execution of files. -
File System Notification: Ensure that file system notifications are enabled. This can usually be done by installing and configuring tools like
inotify-tools
on the VM. It helps in detecting file system changes without needing a reboot.Command to install
inotify-tools
:sudo apt-get install inotify-tools
-
Cron Job for Regular Scans: Set up a cron job to periodically run a scan command for Jellyfin. This can be a workaround to update the library without manual intervention or a full reboot.
Example Cron job setup:
crontab -e
Then add a line like:
*/30 * * * * /path/to/jellyfin/scan/command
This would run the scan every 30 minutes.
Solution 2: Network File System (NFS)
This approach involves sharing the HDD over the network using NFS and mounting it in the Jellyfin VM.
-
Set Up NFS Server on Host: Install and configure NFS server on your ProxMox host.
Installation command:
sudo apt-get install nfs-kernel-server
-
Configure Exports: Add the HDD directory to
/etc/exports
and configure it for network sharing. -
Mount on VM: On the Jellyfin VM, mount the NFS share. This should provide better synchronization of file system changes.
Solution 3: Use Containerization (Docker)
Using Docker can simplify dependency management and might offer better handling of file system events.
-
Install Docker on VM: If not already installed, install Docker on the Jellyfin VM.
Installation commands:
sudo apt-get update sudo apt-get install docker-ce docker-ce-cli containerd.io
-
Run Jellyfin in Docker: Pull and run the Jellyfin Docker container, ensuring to correctly mount the HDD as a volume.
Docker run command example:
docker run -d \ --name=jellyfin \ -p 8096:8096 \ -v /path/to/config:/config \ -v /path/to/cache:/cache \ -v /path/to/media:/media \ jellyfin/jellyfin
Replace
/path/to/media
with the path to your mounted HDD.
Each solution has a different level of complexity and impact on your current setup. The first solution is the least intrusive, while the second and third offer more substantial changes that might resolve the issue more effectively. Choose based on your comfort with system modifications and the desired level of intervention.
-