I need to replicate our production environment by having a directory placed at /reports/2019/
, and as you know this is not possible in Catalina anymore (at least without disabling the SIP.
Doing that is actually disabling the security but I guess there is a proper way to do this.
Is there a way to create a symlink like /reports
that is linked to the read-write volume without disabling SIP or not compromising the security?
You can add symlinks to the root filesystem by adding entries to /etc/synthetic.conf
.
From the synthetic.conf(5)
man page:
synthetic.conf specifies a single synthetic entity per line. Each line may have one or two columns, separated by a tab character. If a line has a single column, it denotes a virtual empty directory to be created at
/
. If a line has two columns, it denotes a symbolic link at/
whose link target is given in the second column.
So, if you had your writable directory at /Users/myself/reports
, you could symlink it to /reports
by doing the following:
sudo vi /etc/synthetic.conf
reports Users/myself/reports
, where the empty space is a tab (Ctrl-V + Tab
) character.The directory should show up after the reboot.
Many thanks for documenting that @eqzx
In 2021 with Big Sur, things have changed a little bit. I got the crashloop for an undefined reason. Safe mode will NOT help you. Starting in recovery, as mentioned, is possible. Apple support will not help you but tell you to repair. Repairing the system will, beside waste your time, solve nothing.
The solution is:
synthetic.conf
under /etc or private/etc... it won't be therediskutil apfs unlock "Macintosh HD - Data"
diskutil info disk2s2
cd /Volumes/"Macintosh HD - Data"
private/etc
rm synthetic.conf
You can now reboot, create a new file, likely get stuck again :) and fix it with the same solution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With