Skip to content

Instantly share code, notes, and snippets.

@douglascayers
Created September 13, 2023 13:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save douglascayers/109de1ca6d9007f03978c78e2774c4df to your computer and use it in GitHub Desktop.
Save douglascayers/109de1ca6d9007f03978c78e2774c4df to your computer and use it in GitHub Desktop.

Create MacOS Symlinks at ROOT

https://apple.stackexchange.com/questions/388236/unable-to-create-folder-in-root-of-macintosh-hd

Create File

This command creates /etc/synthetic.conf file with an intial entry.

ROOT_FOLDER="programs"
ACTUAL_FOLDER="tmp/programs"
sudo touch /etc/synthetic.conf
sudo chmod 0666 /etc/synthetic.conf
sudo printf "${ROOT_FOLDER}\t${ACTUAL_FOLDER}" >> /etc/synthetic.conf
sudo chmod 0644 /etc/synthetic.conf
sudo chown root:wheel /etc/synthetic.conf

Apply File

Note, when you run this command the terminal may think it failed, but to verify it worked run ls -al / to confirm your links were created.

/System/Library/Filesystems/apfs.fs/Contents/Resources/apfs.util -t

Delete File

If you want to delete the file and the symbolic folders it created.

sudo chmod 0666 /etc/synthetic.conf
sudo rm /etc/synthetic.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment