this post was submitted on 07 Jan 2024
7 points (100.0% liked)

Selfhosted

39964 readers
408 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS
 

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?

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 7 points 10 months ago* (last edited 10 months ago) (1 children)

Assuming systemd, create a file like

/etc/systemd/system/dir-to-mount.mount

And then configure it per the systemd docs:

https://www.freedesktop.org/software/systemd/man/latest/systemd.mount.html

Then modify the docker unit file to have a dependency on the mount unit so it's guaranteed to be up before docker starts.

[–] [email protected] 1 points 10 months ago (2 children)

Is this method superior to fstab?

[–] [email protected] 3 points 10 months ago* (last edited 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.

[–] [email protected] 2 points 10 months ago

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