Hello everyone,
Just wanted to say that I have been suffering this issue since September and after finding this thread I have activated NFS and all seems good now.
Here is an AI generated manual on how to do it:
To configure your Mac running macOS Sonoma 15.1 to automatically mount a read-write NFS share from your Synology NAS at startup, follow these steps:
Step 1: Enable NFS Service on Synology NAS
-
Log in to your Synology NAS.
-
Open Control Panel.
-
Navigate to File Services.
-
Under the NFS Service tab, check Enable NFS.
-
Click Apply to save the changes.
Step 2: Set NFS Permissions for the Shared Folder
-
In Control Panel, go to Shared Folder.
-
Select the folder you wish to share via NFS and click Edit.
-
Navigate to the NFS Permissions tab.
-
Click Create and configure the following settings:
• Hostname or IP: Enter the IP address of your Mac or a wildcard (*) to allow all.
• Privilege: Set to Read/Write.
• Squash: Choose Map all users to admin for simplicity.
• Security: Select SYS.
- Click OK to apply the permissions.
Step 3: Configure autofs on macOS
-
Open the Terminal application on your Mac.
-
Edit the auto_master file:
sudo nano /etc/auto_master
- Add the following line at the end of the file:
/- auto_nfs -nobrowse,nosuid
This line directs the system to refer to the /etc/auto_nfs file for direct mappings.
- Save and exit the editor (in nano, press Control + O to save, then Control + X to exit).
Step 4: Create the auto_nfs Map
- In Terminal, create and edit the /etc/auto_nfs file:
sudo nano /etc/auto_nfs
- Add a line specifying the mount point and NFS server details:
/System/Volumes/Data/Users/yourusername/mounts/nfs_share -fstype=nfs,rw,nolockd,resvport,hard,bg,intr,tcp,nfc,rsize=8192,wsize=8192 nfs://synology_nas_ip:/volume1/your_shared_folder
Replace:
• /System/Volumes/Data/Users/yourusername/mounts/nfs_share with your desired local mount point.
• synology_nas_ip with the IP address of your Synology NAS.
• /volume1/your_shared_folder with the path to your shared folder on the NAS.
Step 5: Create the Local Mount Point Directory
- Ensure the local mount point directory exists:
sudo mkdir -p /System/Volumes/Data/Users/yourusername/mounts/nfs_share
- Adjust the ownership and permissions:
sudo chown yourusername:staff /System/Volumes/Data/Users/yourusername/mounts/nfs_share
sudo chmod 755 /System/Volumes/Data/Users/yourusername/mounts/nfs_share
Replace yourusername with your actual macOS username.
Step 6: Apply the Configuration
- Reload the autofs configuration to apply the changes:
sudo automount -vc
This command will unmount and remount all autofs-managed mounts, applying your new configuration.
Additional Considerations:
• macOS Catalina and Later: Due to the system volume being read-only, mount points should be created under /System/Volumes/Data. (Tisgoud)
• Security & Permissions: Ensure that the NFS server allows your Mac to connect and that the appropriate permissions are set for read-write access.
• Testing: After completing the setup, navigate to the mount point in Finder or Terminal to verify that the NFS share mounts correctly and is accessible.
By following these steps, your Mac will automatically mount the specified NFS share from your Synology NAS in read-write mode whenever you access the designated mount point.
If you find issues when trying to edit /etc/auto_master and trying to save it says [ Cannot open file for writing: Operation not permitted ] then do this:
The “Operation not permitted” error when attempting to edit system files like /etc/auto_master on macOS Sonoma 15.1 is due to enhanced security measures, specifically System Integrity Protection (SIP). SIP restricts modifications to certain system files and directories to protect the operating system.
To edit /etc/auto_master**, follow these steps:**
- Disable System Integrity Protection (SIP):
Disabling SIP allows modifications to protected system files. Ensure you re-enable SIP after making the necessary changes to maintain system security.
• Restart your Mac in Recovery Mode:
-
Click the Apple menu and select Restart.
-
Immediately press and hold Command (⌘) + R until the Apple logo appears, initiating Recovery Mode.
• Open Terminal in Recovery Mode:
-
In the macOS Utilities window, select Utilities from the menu bar.
-
Choose Terminal.
• Disable SIP:
- In the Terminal window, type:
csrutil disable
-
Press Enter.
-
After the process completes, restart your Mac by selecting Apple menu > Restart.
-
Edit the /etc/auto_master File:
• Open Terminal:
- Once your Mac restarts, open the Terminal application.
• Edit the File:
- Type:
sudo nano /etc/auto_master
-
Press Enter.
-
Enter your administrator password when prompted.
-
Make the necessary changes to the file.
-
Save the changes by pressing Control (⌃) + O, then press Enter.
-
Exit the editor by pressing Control (⌃) + X.
-
Re-enable System Integrity Protection (SIP):
It’s crucial to re-enable SIP to maintain your Mac’s security.
• Restart in Recovery Mode:
-
Click the Apple menu and select Restart.
-
Immediately press and hold Command (⌘) + R until the Apple logo appears.
• Open Terminal in Recovery Mode:
-
In the macOS Utilities window, select Utilities from the menu bar.
-
Choose Terminal.
• Enable SIP:
- In the Terminal window, type:
csrutil enable
-
Press Enter.
-
After the process completes, restart your Mac by selecting Apple menu > Restart.
By following these steps, you can modify the /etc/auto_master file to configure your NFS share and ensure your system remains protected by re-enabling SIP afterward.
Note: Disabling SIP reduces your Mac’s security. Only disable it temporarily to make necessary changes, and always re-enable it immediately after.