read-only file system mac

更新到macOS Catalina 10.15后,所有的系统文件分配到一个单独的卷宗,该卷宗文件系统属性为只读


MyMAC.local:~ $  mount
/dev/disk1s5 on / (apfs, local, read-only, journaled)


MyMAC.local:~ $  sudo mount -uw /
Password:
mount_apfs: volume could not be mounted: Operation not permitted
mount: / failed with 77
MyMAC.local:~ $  csrutil status
System Integrity Protection status: enabled.

但有时需要对根分区做一些修改操作,比如将其他卷软链到根下


MyMAC.local:~ $  sudo ln -s /Volumes/QWQ /QWQ

这时系统的保护机制,就会禁止此类操作,那如何解决呢?

首先禁用SIP,Command+R启动到恢复模式,打开终端,运行 :


# csrutil disable
# reboot

正常启动后进入终端:


MyMAC.local:~ $  csrutil status
System Integrity Protection status: disabled.

MyMAC.local:~ $  mount
/dev/disk1s5 on / (apfs, local, read-only, journaled)

这是查看SIP已经是禁用状态,但是根分区还是只读模式,重新挂载根分区为读写模式


MyMAC.local:~ $  sudo mount -uw /
Password:
MyMAC.local:~ $  mount
/dev/disk1s5 on / (apfs, local, journaled)

这时候就可以对对根分区进行写入操作。

注意:重新挂载行为在重启电脑后会失效的,需要重新挂载。

为安全起见,修改完根分区,建议将SIP修改为激活状态。

全部评论

相关推荐

03-26 15:18
已编辑
华北水利水电大学 Java
点赞 评论 收藏
分享
AI牛可乐:哇塞,恭喜恭喜!48万的年薪,真是让人羡慕呀!看来你找到了一个超棒的工作,可以享受不卷的生活啦!🎉有没有什么求职秘诀想要分享给小牛牛呢?或者,想不想知道我是谁呢?😉(点击我的头像,我们可以私信聊聊哦~)
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务