58

After updating to macOS Catalina, all the folders I had saved in the root directory, "/", were missing.

I read that the system is now read-only, but didn't see a notice on where previous files have gone.

Are they on the system or do I need to restore them from backup?

  • 2
    You should not ever store user files in the root directory. It belongs to root, and even with sudo rights, root != you. Store your stuff under ~/. Always. – Markus W Mahlberg Oct 10 at 7:07
  • 9
    It is his computer, he can do whatever he wants. – copper.hat Oct 10 at 14:20
  • 3
    @MarkusWMahlberg Do you have a deeper reason for why you recommend against this besides "it belongs to root"? For example, what bad things have happened before to files in the root directory? I've been doing this for a very long time and this is the first time it's given me any grief. – plowman Oct 10 at 17:50
  • "It belongs to root" means the permissions are set accordingly - for a reason. Libs belong to /lib[32,64], /usr/lib[32,64]/ or they will not be found. Tools accessible for users, but needed for bootstrapping the systems go to /bin, root only tools to /sbin. And user files belong into their home directory. Aside from giving yourself a hard time finding them after years, potential backup and sync issues - fighting the FHS has never done any good. Be it explicitly or implicitly adopted by the OS in question. – Markus W Mahlberg Oct 10 at 21:11
  • @plowman it is not following *nix norms and best practices. /var, /usr or one of the other unix idioms is far better to build upon, instead. Following OS norms sets the expectation that deviations from that norm should propose why needed. – New Alexandria Oct 10 at 22:26
56

This took me a long time to figure out, but any file that was formerly at, e.g., /my-cool-directory was moved to /Users/Shared/Relocated Items/Security/my-cool-directory.

I ended up moving the directories by running this command from the terminal:

cd "/Users/Shared/Relocated Items/Security"
sudo mv my-cool-directory ~/
# enter your system password when it asks you

After doing that, my file is then located in my home directory, e.g. ~/my-cool-directory

  • 33
    How annoying. I have reasons why files are where they are and I don't want to move them. – Martin Oct 8 at 10:47
  • Somehow I am not able to copy. My all foders were on root /. Does it mean I have no choice but to move under my User Folder? – Volatil3 Oct 9 at 8:18
  • 4
    @Martin Catalina changed it by design. Now you can not create anything under / folder. It is to protect system files. You gotta update all of your Bash and other files and IDEs – Volatil3 Oct 9 at 8:23
  • 3
    @Martin There is no such reason in the first place unless you are an OS developer for Apple and use your dev laptop as a test system. User files go to the home directory. – Markus W Mahlberg Oct 10 at 7:12
  • 3
    If you had a custom hidden directory in the root dir like /.hidden_dir, it will not be moved to /Users/Shared/Relocated Items/Security/ instead it will be deleted when you upgrade to catalina. – Cpt_Jauchefuerst Oct 10 at 10:19
0

You can use the file /etc/synthetic.conf to map your old folder to a new virtual folder on the root directory. If the file doesn't exists, just create it with sudo :

sudo nano /etc/synthetic.conf

Add the folder you want to use in the root directory, and the directory you want to mount on.

Ex:

my-cool-directory /Users/Shared/Relocated Items/Security/my-cool-directory

Finish by rebooting your mac.

You can find more infos with man synthetic.conf

Regards

New contributor
JeromeM62 is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .