• Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below
  • Forum
  • Website
  • GitHub
  • Status
  • Translation
  • Features
  • Team
  • Rules
  • Help
  • Feeds
User Links
  • Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below

    Useful Links Forum Website GitHub Status Translation Features Team Rules Help Feeds
    Jellyfin Forum Support Troubleshooting Removable drive management

     
    • 0 Vote(s) - 0 Average

    Removable drive management

    How to deal with Jellyfin clearing metadata on external hard drives
    yak
    Offline

    Junior Member

    Posts: 4
    Threads: 1
    Joined: 2023 Jul
    Reputation: 0
    Country:Italy
    #1
    2024-04-14, 10:23 PM
    Hey there, I'm on Linux and I have my movies collection on a removable drive.
    The problem is that if I use my laptop without the drive connected, the next time I'll connect it and open Jellyfin my library is empty. So I have to rescan, which is not a big deal.
    The big deal though is that everytime I do this rescan, the movies are reloaded without my customized metadata, so I have to identify again every uncorrectly identified movie, and I lost every customization related to images, posters, ecc. The only information that seems to remain is the "watched" tick. Everything else needs to be done from scratch.

    Is this supposed to happen? And is there a way to not lose all my metadata, and possibily not having to rescan my library everytime I use my computer without my hard drive connected?
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,374
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #2
    2024-04-15, 01:59 AM
    When you use the laptop without the drive, is Jellyfin still running in the background? If so, this behavior is expected. As for the metadata, also expected when it is re-added. When you disconnect the drive make sure that Jellyfin has stopped before doing so. You can also have Jellyfin write NFOs and make them read only to preserve metadata.
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    yak
    Offline

    Junior Member

    Posts: 4
    Threads: 1
    Joined: 2023 Jul
    Reputation: 0
    Country:Italy
    #3
    2024-04-15, 07:32 AM
    (2024-04-15, 01:59 AM)TheDreadPirate Wrote: When you use the laptop without the drive, is Jellyfin still running in the background?

    It is. It runs automatically at every boot.

    (2024-04-15, 01:59 AM)TheDreadPirate Wrote: When you disconnect the drive make sure that Jellyfin has stopped before doing so.

    Is there some easy way to make Jellyfin start only if the drive is connected?
    I mean, when I disconnect it Jellyfin is always stopped, the problem is that, being my computer a laptop, there are some times which I use it outdoor and I don't have the drive with me. At boot the service starts anyway and so the next time I'll boot it with the drive connected this problem happens. So having away to prevent the service to start Jellyfin if the drive isn't connected seems to be necessary in this case. Or what's the best way to deal with this scenario?

    (2024-04-15, 01:59 AM)TheDreadPirate Wrote: You can also have Jellyfin write NFOs and make them read only to preserve metadata.

    Actually this seems to be the best way! Could you point me to a guide to do so, please?
    This wouldn't prevent me to have to rescan library though, right?
    Efficient_Good_5784
    Offline

    Community Moderator

    Posts: 1,167
    Threads: 3
    Joined: 2023 Jun
    Reputation: 50
    #4
    2024-04-15, 08:20 AM
    (2024-04-15, 07:32 AM)yak Wrote:
    (2024-04-15, 01:59 AM)TheDreadPirate Wrote: You can also have Jellyfin write NFOs and make them read only to preserve metadata.

    Actually this seems to be the best way! Could you point me to a guide to do so, please?
    This wouldn't prevent me to have to rescan library though, right?
    You'll have to write a script or cron job that does this for you. It's a simple enough task.
    If your server is on Linux, just have a script periodically chmod the nfo files in a directory to only allow the Jellyfin user to read them only.

    Basically a "chmod 440" applied to the nfo files if you want to make owner & group all have read-only access.
    yak
    Offline

    Junior Member

    Posts: 4
    Threads: 1
    Joined: 2023 Jul
    Reputation: 0
    Country:Italy
    #5
    2024-04-15, 10:30 AM (This post was last modified: 2024-04-15, 10:32 AM by yak. Edited 1 time in total.)
    (2024-04-15, 08:20 AM)Efficient_Good_5784 Wrote:
    (2024-04-15, 07:32 AM)yak Wrote:
    (2024-04-15, 01:59 AM)TheDreadPirate Wrote: You can also have Jellyfin write NFOs and make them read only to preserve metadata.

    Actually this seems to be the best way! Could you point me to a guide to do so, please?
    This wouldn't prevent me to have to rescan library though, right?
    You'll have to write a script or cron job that does this for you. It's a simple enough task.
    If your server is on Linux, just have a script periodically chmod the nfo files in a directory to only allow the Jellyfin user to read them only.

    Basically a "chmod 440" applied to the nfo files if you want to make owner & group all have read-only access.

    Thank you. Isn't this the same thing as ticking the "Lock this item to prevent future changes" box, in Jellyfin's GUI?

    Edit: I mean, I know it's not exactly the same thing, but doesn't it have basically the same effect?
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,374
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #6
    2024-04-16, 08:48 PM (This post was last modified: 2024-04-16, 08:49 PM by TheDreadPirate. Edited 1 time in total.)
    (2024-04-15, 07:32 AM)yak Wrote:
    (2024-04-15, 01:59 AM)TheDreadPirate Wrote: When you use the laptop without the drive, is Jellyfin still running in the background?

    It is. It runs automatically at every boot.

    Then the problem you are having is 100% expected.  Stop Jellyfin BEFORE disconnecting the drive and disable auto-start on boot.

    (2024-04-15, 07:32 AM)yak Wrote:
    (2024-04-15, 01:59 AM)TheDreadPirate Wrote: When you disconnect the drive make sure that Jellyfin has stopped before doing so.

    Is there some easy way to make Jellyfin start only if the drive is connected?
    I mean, when I disconnect it Jellyfin is always stopped, the problem is that, being my computer a laptop, there are some times which I use it outdoor and I don't have the drive with me. At boot the service starts anyway and so the next time I'll boot it with the drive connected this problem happens. So having away to prevent the service to start Jellyfin if the drive isn't connected seems to be necessary in this case. Or what's the best way to deal with this scenario?


    Depends.  If this is Linux you can have the Jellyfin service ensure that a drive is mounted before starting.  If this is Windows, I'm not aware of a way to do that.

    (2024-04-15, 07:32 AM)yak Wrote:
    (2024-04-15, 01:59 AM)TheDreadPirate Wrote: You can also have Jellyfin write NFOs and make them read only to preserve metadata.

    Actually this seems to be the best way! Could you point me to a guide to do so, please?
    This wouldn't prevent me to have to rescan library though, right?

    You have to enable NFO saver in the library settings in Jellyfin.  If Jellyfin has already scanned your library you will need to rescan and select "replace all metadata" to trigger NFOs to be written.  After they are written and any mis-identifications corrected, you will need to ensure that the resulting NFOs are read-only to Jellyfin.  In Linux, as Efficient suggested, change the file permissions to 440 or something similar.

    Selecting "lock metadata" will only prevent changes to content already in your library.  For the problem you are having, assuming you don't heed my advise to stop Jellyfin, locking the metadata doesn't apply to "new" content.
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    yak
    Offline

    Junior Member

    Posts: 4
    Threads: 1
    Joined: 2023 Jul
    Reputation: 0
    Country:Italy
    #7
    2024-04-16, 10:15 PM
    (2024-04-16, 08:48 PM)TheDreadPirate Wrote: Depends.  If this is Linux you can have the Jellyfin service ensure that a drive is mounted before starting.  If this is Windows, I'm not aware of a way to do that.
     
    It's Linux. Starting the service only if the drive is mounted would be perfect. Do you have any advice how to edit the service in order to achieve that?

    (2024-04-15, 01:59 AM)TheDreadPirate Wrote: you will need to ensure that the resulting NFOs are read-only to Jellyfin.
    I did it and now it works perfectly. Just curious though, why does it need to be read-only to Jellyfin?
    Anyway, thank you.
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,374
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #8
    2024-04-17, 12:09 AM
    From experience, Jellyfin will still try to find online metadata and overwrite existing NFOs. The only way to ensure it doesn't do this is to make them read only for the jellyfin service user.

    This stackexchange post should answer you question about ensuring a mount exists before starting a service.

    https://unix.stackexchange.com/questions...g-services
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)


    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Team · Help · Contact
    © Designed by D&D - Powered by MyBB
    L


    Jellyfin

    The Free Software Media System

    Linear Mode
    Threaded Mode