root symlink on MacOS BigSur

After upgrading my Macbook to BigSur (I skipped Catalina) my MongoDB didn’t want to start anymore. A quick inspection showed that the /data/db folder I used to have to house my db files didn’t exist anymore. BigSur has removed it 😱 but luckily I found a backup.

It appears that the root / folder on MacOS is now readonly, and I wasn’t able to copy the backup to its original place. I chose the Mac disk instead, and it now sits in /System/Volumes/Data/data

What was left is to create a symlink to /data, and the way to do that is by using the /etc/synthetic.conf file:

data    /System/Volumes/Data/data

This fixes the /data folder I used to have for MongoDB.