Unable to create folder at : /var/mongodb/db

When I run, mkdir /var/mongodb/db - I got, file do not exist and post this, I ran mkdir -p /var/mongodb/db/ - this gives me permission denied.

I am not sure, how to get proper permission to create file. Please help

/var is owned by root
You need sudo privileges to create sub dirs under /var
Once you created dir need to change permissions/ownership by chown

Please check or forum.You will get details

1 Like

Hi @Prabodh_Prakash_50262,

I hope you found @Ramachandra_37567’s response helpful.

Please run the following command for creating the directories.

sudo mkdir -p /var/mongodb/db/

In addition to that, don’t forget to change the ownership of the newly created directories to Vagrant.

sudo chown vagrant:vagrant /var/mongodb/db/

Hope it helps!

Thanks,
Shubham Ranjan
Curriculum Services Engineer

Closing this thread as the issue has been resolved.