4

We have multiple Mac OS/OSX servers (A mix of El Cap and High Sierra) that have SMB shares mounted for backing /archiving jobs (chronosync and P5)

The SMB shares are connected via "connect to server" and generally remain stable, but become unmounted randomly at least once every 1-2 days.

The goal here is to keep the SMB shares mounted at all cost.

I've read around on StackExchange and tried analysing the network connections using the command from this post:

SMB: auto-unmount then unable to re-mount without restart

netstat -I
ping -c 90 -i 10 your_SMB_server
tail -f /var/log/system.log

No errors or issues with the packets found.

I'm sure there's a sys admin expert out that must have solved this already ;)

Appreciate any suggestions or ideas, however rudimentary

Is there any way analyze the logs (We've looked in system.log) and find the reason for the unmount?

4
  • What's the server? Are you sure the server isn't kicking them off, perhaps if inactive?
    – benwiggy
    Mar 8, 2019 at 14:40
  • +1 for more info in the sever. For instance, there is a config option in Samba which disconnects inactive connections after a certain period of time. Also, it would probably make more sense to look at the sever logs.
    – Gummibando
    Mar 8, 2019 at 18:46
  • Thanks for the response guys, super helpful. Seems logical to reason that the disconnects would be logged with the server rather than the client. These are ReadyNAS, Synology and TigerBox storage, all using SMB shares. I'll look into the SMB settings and logs of the servers and report back here
    – beano
    Mar 11, 2019 at 10:22
  • Are you looking for a tool like these to make sure the clients reconnect no matter why the share isn't mounted? apple.com/business/docs/site/… and jamf.com/blog/migrating-from-nomad-to-jamf-connect
    – bmike
    Nov 10, 2023 at 17:04

2 Answers 2

3

Not certain I understand the context of your question, so let's try this first:

This has worked for me:

  1. Mount the SMB/CIFS share using Finder's Go, Connect to Server....
  2. If prompted for credentials, and given the option, store those credentials in the Keychain
  3. Open System Preferences, Users and Groups; select the Login Items tab near the top
  4. Click the + button at the bottom of the list of login items to "add" an item.
  5. This will produce a new Finder window that allows you to select an item. Simply navigate to the mounted SMB/CIFS share from the Sidebar, select/highlight the SMB/CIFS share of interest, then click the Add button in the bottom right of the Finder window.

This should dismiss the Finder window, and now the share should be mounted at each login. Let us know if this doesn't work/isn't what you needed.

EDIT/UPDATE (May 28,2023):

Apple's autofs may be a good candidate for keeping network shares mounted - regardless of what causes the loss of connectivity. Briefly, autofs has been around for a while, and works on most versions of macOS - even on those before and after the introduction of the read-only filesystem which was introduced in macOS Catalina. FWIW, I currently use autofs on my new macOS M2 running Ventura.

Some minor adjustments to the /etc/auto_master file are required to accommodate the read-only file system; these changes are covered in an answer to a similar question.

Here are some other potentially useful references from my GitHub site:

  1. AutoFS Example

  2. AutoFS Technical White Paper by Apple; dtd Jun 2009

0
1

There is an OpenSource app doing just that, take a look at https://gitlab.rrze.fau.de/faumac/networkShareMounter It is meant for MDM administrators but can be used without configuration profiles at home or in a non-enterprise or non-university environment.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .