I was previously running channels on an old ubuntu server. It was rock solid and I had very few issues. I am trying to migrate to an M1 mac mini as I have a few other services I am looking to migrate off my linux server. I am unable to find a solution to auto mount the NFS share I use to store all of my recordings and hosts all of my channelsdvr database etc. I'm wondering if anyone has had luck getting an NFS share to automount via autofs or similar in OS X Monterey
Keeping network shares mounted on macOS is a nightmare. I know this doesn’t help your original question, but in general, it’s not fun.
Yes, I have NFS shares mounted by putting them in /etc/fstab, then using a script that runs on login to create the mountpoints and mount the shares. Low-tech but it works, and in fact I have Channels DVR serving videos out of one of the shares without issues.
autofs is still an option, but it's had some serious issues recently (e.g., /etc/auto_master being overwritten on every OS upgrade, and with 10.15 you'd sometimes end up with hundreds or even thousands of identical mount points to the point the system hung/crashed). macOS 11/12 are better.
For example, I have media mounted from my NAS from the following line in /etc/fstab:
banjo.ad.sabi.net:/volume1/BanjoMedia /System/Volumes/Data/Volumes/BanjoMedia nfs sec=krb5p,[email protected],resvport,soft,bg,intr,rw,nfc
By putting the mountpoint in /System/Volumes/Data/Volumes it shows up in the Finder.
Then when I'm logged in, I run a script that creates and mounts my shares (if you're not using Kerberos then ignore all the sec=krb5p, klist, etc. stuff.)
#!/bin/zsh -ef
# set -xv
while ! /sbin/ping -qc 1 banjo.ad.sabi.net >/dev/null; do
/bin/sleep 10
done
while ! /usr/bin/klist -t; do
/bin/sleep 10
done
umask 022
cd /System/Volumes/Data/Volumes
volumes=(BanjoArchive BanjoMedia)
setopt rc_expandparam
/usr/bin/sudo /bin/mkdir -p $PWD/$volumes
# XXX mount is not supposed to remount already-mounted NFS volumes but *does*
# XXX as of macOS 10.15, so don't mount unless it's not already mounted.
# XXX (This is why we're not using autofs any more.)
# XXX Otherwise, /sbin/mount -a would be much simpler!
for volume in $volumes; do
if [[ -z $(/sbin/mount | /usr/bin/grep $volume) ]]; then
/usr/bin/sudo /sbin/mount $PWD/$volume
fi
done
An app that I keep meaning to check out but still haven't is ConnectMeNow. It is maintained and may be a better solution than the above.
I've used this with pretty good success: NFS Manager: Description
It's not free and has a bit of a learning curve, but it got the job done.
For NFS client on macOS, I've found Automounter (available for cheap in the Apple App Store) is perfect for keeping NFSv3 client connections stable.
As for NFSv3 services, I create an /etc/exports file using the root account and put the full path to the external DAS drive into it like this:
/System/Volumes/Data/Volumes/FolderName
And then on the Terminal/iTerm2 command line I type:
nfsd update
And then I type:
showmount -e
And it shows me the NFSv3 mount that it is now serving on my local LAN which Automounter on another Mac can be configured to see by adding the IP of the NFSv3 Mac server and the same path as shown in the results of the showmount -e command.
And on the client NFSv3 Mac I can type:
showmount -e [NFSv3 Server IP address]
This confirms the client can see the server and that I can set up Automounter to make a stable NFSv3 connection that will last forever.
Just keep in mind that while NFSv3 is simple and fast (which is why it's still used thirty years after it was first created) it has almost zero security, like not even logins or authentication. So if your NFSv3 Mac is exposed as a server to the general Internet, so are all of your files!