/usr/bin symlink [duplicate]
After updating to big sur, I can no longer mount the root as writable (even with SIP disabled):
sudo mount -uw /
mount_apfs: volume could not be mounted: Permission denied
mount: / failed with 66
How can I fix this?
Solution 1:
DISCLAIMER: have a good backup and plan to erase and reinstall your Mac from the internet before trying this procedure. A mistake can prevent your system from starting without assistance.
- Disable FileVault
- Reboot into recovery mode and run:
csrutil authenticated-root disable
- Reboot back into MacOS
- Find your root mount's device - run
mount
and chop off the last s, e.g. if your root is/dev/disk1s2s3
, you'll mount/dev/disk1s2
- Create a new directory, for example
~/mount
mkdir -p -m777 ~/mount
- Run
sudo mount -o nobrowse -t apfs DISK_PATH MOUNT_PATH
, using the values from abovesudo mount -o nobrowse -t apfs /dev/disk1s2 ~/mount
- Modify the files under the mounted directory
- Run
sudo bless --folder MOUNT_PATH/System/Library/CoreServices --bootefi --create-snapshot
- Reboot your system, and the changes will take place
Solution 2:
My company requires to read/write environment informations under /data/webapps/appenv
. Therefore, this workaround shared by a colleague of mine might not answer this question directly, but it is super useful if you want to write something under your root path!
-
Create a file:
sudo vim /etc/synthetic.conf
. -
Write content:
<dir>⇥/System/Volumes/Data/<dir>
. Notice: the⇥
is a tab!In my case, it looks like this:
data⇥/System/Volumes/Data/data
-
Go to
/System/Volumes/Data
and dosudo mkdir <dir>
. -
Then do
sudo chmod -R 777 <dir>
. -
Finally, reboot, and your directory
<dir>
should now be accessible.