Basically I have a Navidrome container and it’s pointing at my music in a network mounted folder, what’s the best way to ensure that it’s always there, even after a reboot of my Pi?

      • zaphod@lemmy.ca
        link
        fedilink
        English
        arrow-up
        3
        ·
        edit-2
        10 months ago

        It has the benefit that the container can’t start before the mount point is up without any additional scripts or kludges, so no race conditions or surprise behaviour. Using fstab alone can’t provide that guarantee. The other option is Autofs but it’s messier to configure and may not ship out of the box on modern distros.

      • Atemu@lemmy.ml
        link
        fedilink
        English
        arrow-up
        2
        ·
        10 months ago

        I’ll let you in on a little secret: Fstab gets converted to mount units anyways.

  • surewhynotlem@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    10 months ago

    fstab will do it, but the more important question is, what do you want to happen when it doesn’t mount properly? Do you want the system to fail to boot? Do you want navidrome to not run?

    • sabreW4K3@lemmy.tfOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      10 months ago

      So this is my preferred method, but I found the blog post really confusing. Subsequently, it failed.

        navidrome:
          container_name: navidrome
          image: deluan/navidrome:latest
          ports:
            - "4533:4533"
          environment:
            ND_SCANSCHEDULE: 1h
            ND_LOGLEVEL: info
          volumes:
            - "/opt/navidrome/data:/data"
            - "/nfs/Shared Music:/music:ro"
            - type: volume
            - source: nfs
            - target: /nfs
            - volume:
              nocopy: true
        volumes:
          nfs:
            driver: local
            driver_opts:
              type: nfs
              o: "addr=XXX.XXX.XXX.XXX,nolock,soft,rw"
              device: ":/mnt/HD/Public"
      

      What am I doing wrong?

      • I’m rather confused by the config you posted. The NFS config should all be down in the volumes: section the only thing you reference in the service section is the name of the volume you define and the path to mount in the container. Something like this (tho I’m guessing as to what should be what with your setup).

        services:
          navidrome:
            container_name: navidrome
            image: deluan/navidrome:latest
            ports:
              - "4533:4533"
            environment:
              ND_SCANSCHEDULE: 1h
              ND_LOGLEVEL: info
            volumes:
              - /opt/navidrome/data:/data
              - music:/music
        volumes:
          music:
            driver_opts:
              type: nfs
              o: "addr=XXX.XXX.XXX.XXX,nolock,soft,ro"
              device: ":/nfs/Shared Music"
        
  • tvcvt@lemmy.ml
    link
    fedilink
    English
    arrow-up
    2
    ·
    10 months ago

    It sounds like you’ve got your solution already, but just in case someone stumbles on this later, I thought I’d mention autofs.

    I’m coming to prefer it over fstab entries because it handles disconnections nicely and attempts to reconnect. Worth checking out for those who haven’t played with it.