macOS automatically mounts SMB shared network disks at startup
This article was last updated 287 days ago. The information within may have evolved or changed; if anything is outdated or broken, please feel free to leave a message in the comments section.
Article Abstract
To meet the requirement of automatically mounting SMB network disks at startup on macOS, it needs to be implemented by configuring the /etc/auto_smb and /etc/auto_master files. The key is that the mount path must be placed under the /System/Volumes/Data directory (especially applicable to Catalina and Big Sur versions) to avoid mounting directly to the user's home directory. It is recommended to set the shared directory to the /System/Volumes/Data/Users/xxx/shared structure, and ensure that the SMB account permissions are independent and do not contain special characters. After configuration, run the automount command to complete the mount. However, please note that system upgrades may cause the auto_master file to be overwritten, requiring reconfiguration. This solution is suitable for development or collaboration scenarios that require persistent network storage access.
Qwen3-14B · 2026-06-18
  一般linux系统要想开机挂载网络磁盘,都是通过在/etc/fstab里添加启动项来实现,但是macos的实现却不太一样。macos是通过编辑/etc/auto_master来实现,如下:
#
# Automounter master map
#
+auto_master        # Use directory service
#/net           -hosts      -nobrowse,hidefromfinder,nosuid
/home           auto_home   -nobrowse,hidefromfinder
/Network/Servers    -fstab
/-          -static

# SAMBA AutoFS
/-  auto_smb

Where /- indicates that the configuration file auto_smb and the auto_master file are located in the folder of the same path. Then edit the configuration file /etc/auto_smb:

vim /etc/auto_smb
# 內容如下

/System/Volumes/Data/samba_mount/share -fstype=smbfs,soft,noowners,nosuid,rw ://username:password@ip-address:/share

://username:password@ip-address:/share is the content of the share folder shared via Samba on the target ip-address. Modify username and password according to your actual situation.

/System/Volumes/Data/samba_mount is the mount path in macOS, and the mount path must be placed under /System/Volumes/Data

Official statement:
If you are using macOS Catalina 10.15 and macOS Big Sur 11 (and above)
You only need to prepend /System/Volumes/Data to the existing automount path. This is because macOS creates a second APFS volume for user data, thereby moving the existing system installation to a read-only APFS volume

Also, note that you should not mount directly under /Users/xxx (where xxx is the username), meaning do not mount directly under the user's home directory. It is recommended to use the /Users/xxx/shared directory, so the complete path should be: /System/Volumes/Data/Users/xxx/shared

After configuration, execute the automount command

automount -vc

Since in Docker Desktop for Mac, the directories that Docker can mount by default include /Users, you can create corresponding mount folders in the shared directory under Users, for example: /System/Volumes/Data/Users/Shared/nextcloud. If you create it directly in a subfolder of the /Users/#home directory, autofs will have issues. Also note that the SMB user password cannot contain @, and for security reasons, it is best to create a separate user for the SMB directory who only has secure read and write permissions for this mount directory, rather than using admin directly.

Note: If you upgrade the system version, the auto_master file will be overwritten, and you will need to add auto_smb back in.

View Related Categories · 3 Matches
📌 Content Structure Prompt:
This content is part of the following knowledge map, where you can view the complete content path: Blog Knowledge Map。
📎 Related Articles
Share this article
The blog content is original, please indicate the source when reposting! The RSS address of the blog is:https://blog.tangwudi.com/feed, welcome to subscribe; if needed, you can join theTelegram Groupto discuss questions together.
No Comments

Send Comment Edit Comment


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗ
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
Kaomoji
Emoji
Little Dinosaur
Flower!
Previous
Next
       

👋 Welcome to “Wudi's Personal Blog”

Here, long-term exploration is mainly carried out around the following directions:

🧱 Personal Digital Infrastructure and Blog System Construction
☁️ Cloudflare and Network Architecture Practice
🧠 AI and Knowledge System Exploration
🛡️ Network Security and Access Optimization
🎵 Music and Sound Cognition
👁️ Cognitive Perspectives and Worldviews