Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS如何在根目录创建文件夹 #7

Open
iulo opened this issue Feb 28, 2021 · 0 comments
Open

macOS如何在根目录创建文件夹 #7

iulo opened this issue Feb 28, 2021 · 0 comments
Labels

Comments

@iulo
Copy link
Owner

iulo commented Feb 28, 2021

现状

Catalina开始 macOS的根目录变成了只读,root权限也无法创建目录。
网上有个流传较多的方法,关闭sip后,重新mount根目录。不过这个方式从 Big Sur后无效了。

解决方法

目前正统的方式,是通过配置synthetic.conf文件,可以从根目录symlink一个同名目录到用户目录,方式如下:

  1. cd /etc/
  2. 创建配置文件:sudo touch synthetic.conf
  3. 配置文件内容demo:data Users/YourUserName/data(注意使用tab分隔kv),即在你的用户目录下,创建一个data目录,那么在根目录会生成一个同名的data目录,并symlink两者
  4. 重启后即可生效,重新cd / 看看文件夹是否存在

参考

@iulo iulo added the mac label Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant