Unable to create MongoDB /data/db directory on macOS Catalina

Deadly 提交于 2020-05-26 11:16:51

问题


I get the following error when I try to create the MongoDB data/db directory:

sudo mkdir -p /data/db 


mkdir: /data/db: Read-only file system

回答1:


The remount didn't work for me (it requires Disabling SIP, which I didn't want to do) So instead I moved the mongo folder. You should have the old folder under the 'Relocated items' folder on your desktop so just copy it wherever you want (I moved it to my user folder) and then in the terminal go

mongod --dbpath /users/<username>/data/db/

hope this helps




回答2:


Problem because of Read-only file system in mac os catalina

  1. Boot you mac system into recovery mode. (by bootup system with holding CMD+R).

  2. Open terminal (Present in "Utilities" in the top left menu).

  3. Just run command

    csrutil disable

  4. Restart your system and Bootup normally

  5. Before doing any activity open terminal and run command.

    sudo mount -uw /

Once this all done you can do write in root location




回答3:


See the following answer: https://superuser.com/questions/1458974/macos-switched-root-mongodb-data-folder-to-system-ownership-and-it-cannot-be-cha

You have to create the directory in /System/Volumes/Data now.



来源:https://stackoverflow.com/questions/57979325/unable-to-create-mongodb-data-db-directory-on-macos-catalina

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!