Autofs using NAS hostname

Hey guys,

Just a quick question, does anyone know if it’s possible to map NAS NFS shares via autofs but rather than using the NAS’s IP address instead to use the NAS’s hostname? I’ve got a Vero 4k+

The reason I ask is the NAS has multiple LAN interfaces/ports. However, the switch that uses the main bonded interface with IP 192.168.1.9, is turned off in the early evening. So I was hoping that I could somehow set up autofs to use the main bonded IP but then switch to the other IP address that the other spare NAS interface/s are connected to the secondery switch that is kept on 24/7. (if that makes sense)

The only thing I could think of is using the NAS’s hostname to map the NFS shares, without using specialised network switches (which I don’t own)

Many thanks in advance. :slight_smile:

What’s your tolerance for a switchover (in terms of time)?

Cheers

Sam

Hey Sam,
Thanks for the fast response! :slight_smile:

hmm if by that you mean, what times the switch turns off? The main switch turns off at 18:30 then turns back on at 06:30 the next morning.

You’re welcome.

Okay,so you’re not expecting things to move over in a few minutes.
The answer would be: it depends… on your network…

Maybe write a script for the Vero with some logging that pings the hostname and check how it resolves via cron.

No, a few hours delay I guess. haha

hmm ok good idea, I’ll have to do a little research but I’m sure I’ll be able to come up with something.
Thanks again :slight_smile:

So, each IP needs to map to a specific host. This mapping can be handled multiple ways.
DNS, mDNS are the most common.

Then the clients can connect using either. Basically, you’d setup 2 autofs entries for each share. This wouldn’t be optimal from a media center standpoint, because it would likely appear as 2 copies of all media in those connections.

If you run your own DNS, you could script the change over and set the DNS timeout to be 5 minutes via the CNAME record, which means that all clients would only cache the results for 5 minutes.

Screwing around with DNS like that just seems like asking for problems, but I cannot think of why it wouldn’t work. Same with scripting modifications to the autofs files, but if the location where a host resides changes, you’ll likely have stale connections and need to restart autofs anyway when the change happens. I’d definitely use read-only NFS mounts to protect the media files. Should improve performance a tiny bit too, since readonly doesn’t need file locking. Well, maybe no real performance difference, since the streamer would only open using the ‘read’ option anyway, I hope.

My NAS has multiple interfaces, but it is running Ubuntu Server and a few VMs, in addition to Jellyfin to provide access to media from OSMC devices. Since I use multiple playback devices, having the media server centralized really is nice for library management. But I prefer OSMC for playback due to the clean, but complete interface which other playback options fail to provide (IMHO). I suppose, it is about taste more than anything else.

1 Like