macOS automatically loads the SMB shared network drive upon startup.
本文最后更新于 197 天前,其中的信息可能已经有所发展或是发生改变,如有失效可到评论区留言。
Article Summary
To automatically mount the SMB network disk at macOS boot, you need to configure the `/etc/auto_smb` and `/etc/auto_master` files. The key is that the mount path must be placed in the `/System/Volumes/Data` directory (especially important for Catalina and Big Sur versions), avoiding mounting directly to the user's home directory. It's recommended to set the shared directory to the structure `/System/Volumes/Data/Users/xxx/shared`, and ensure that the SMB account has independent permissions and does not contain special characters. After configuration, executing the `automount` command will complete the mounting. However, note that system upgrades may overwrite the `auto_master` file, requiring reconfiguration. This solution is suitable for development or collaborative scenarios requiring persistent network storage access.
Qwen3-14B · 2026-06-18
  Generally, if you want to mount a network disk when booting a Linux system, you can do so by adding a startup item in /etc/fstab, but the implementation of macOS is slightly different. macOS does this by editing /etc/auto_master, as follows:
# # 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

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

vim /etc/auto_smb
# content is as follows/System/Volumes/Data/samba_mount/share -fstype=smbfs,soft,noowners,nosuid,rw ://username:password@ip-address:/share

://username:password@ip-address:/share is the shared folder content shared by samba on the mount target ip-address. Username and password can be modified according to the 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 just need to prefix the existing automount path with /System/Volumes/Data. This is because macOS will create a second APFS volume for user data, thus moving the existing system installation to the read-only APFS volume.

Also, be careful not to mount directly to /Users/xxx (xxx is the user name), nor to the user's home directory. It is recommended to mount directly to the /Users/xxx/shared directory, so the completed path should be: /System/Volumes/Data/Users/xxx/shared

After configuration, execute the automount command

automount -vc

In Docker Desktop for Mac, the directories that Docker can mount by default include /Users, so you can create mount folders for the corresponding folders in the shared directory under Users, for example: /System/Volumes/Data/Users/Shared/nextcloud. If you create them directly in a subfolder of the /Users/#home directory, autofs will have problems. Also note that the smb user password cannot use @, and for security reasons, it is best to create a separate user for the smb directory and only have secure read and write permissions for this mounted directory. Do not use admin directly.

Note: If the system version is upgraded, the auto_master file will be overwritten and auto_smb will need to be added again.

📌 Content Structure Hints:
This content belongs to "Blog Knowledge MapThis is part of the document; you can view the full content path here: Blog Knowledge Map .
View related categories · 3 matches
📎 Related Articles
Share this article
All blog content is original; please indicate the source when reprinting! The blog's RSS address is:https://blog.tangwudi.com/feed, welcome to subscribe; if necessary, you can joinTelegram GroupDiscuss the problem together.
No Comments

Send Comment Edit Comment


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

👋 Welcome to "Invincible Personal Blog"“

This section will focus on long-term exploration in the following areas:

🧱 Building Personal Digital Infrastructure and Blog Systems
☁️ Cloudflare and Network Architecture Practices
🧠 Exploring AI and Knowledge Systems
🛡️ Network security and access optimization
🎵 Music and Sound Cognition
👁️ Cognitive Perspective and Worldview