Unable to use vagrant as a group (and unable to use chown) on OS X

chapter 1 lab says:

Using what you know about the configuration file and Linux user groups, please complete the following:

  • create a new folder /var/mongodb/db/ and allow mongod to write files to this directory
    • create this directory with sudo, because /var is owned by root
    • use chown to change the owner of this directory to vagrant:vagrant
  • edit your config file to use this new directory as the dbpath

I’ve wasted 90 minutes on this and got nowhere. I really want to learn mongo not the OS terminal.

Can someone advise how to change the permissions for /var/mongodb/db/ as per the instructions.

Additional info: I use sudo -s prior to trying to set the permissions. I get an error saying illegal group name

Hi @mikeh1980,

I’m sorry that you are facing this issue. I really appreciate your feedback.

If you have created the directories (/var/mongodb/db/) as mentioned in the lab then please run this command for changing the owner of this new directory to vagrant.

 sudo chown vagrant:vagrant /var/mongodb/db 

Thanks,
Shubham Ranjan
Curriculum Support Engineer

maybe i wasn’t clear enough.

I get an illegal group name error. I stated that I did sudo -s and then the chown. You advised me to do it all in one line. What is the difference? Answer: nothing whatsoever.

sudo chown vagrant:vagrant /var/mongodb/db

returns:

chown: vagrant: illegal group name

Using vagrant + virtual box was supposedly introduced so as to eliminate problem. It looks like I am going to have to skip this portion of the lesson and hope that this setup is not needed later on.

@mikeh1980 I suspect that you’re running this command directly on your Mac terminal. If this is the case, you need to ssh into the vagrant VM from your OS X terminal because that’s where all the labs will be performed. The instructions for this were in Chapter 0.

from vagrant I get

chown: cannot access ‘/var/mongodb/db’: No such file or directory

Forgot about it. I will skip past this

How do i withdraw from M103 without registering a fail?

You first need to create the directory. var exists but mongodb and db sub directories need to be created.

Not entirely sure. On your My Courses page you should see a list of all your courses, from there you should be able to de-register… it won’t mark you down I don’t think.

contrary to the message the directories DO exist. I’d send a screen grab but I am really over this. 2+ hours

Are there any courses that just focus on mongo without any crazy setups on the users computer?

It’s generally fine once you’re setup. It would be interesting to see though.

Depends on the path you’re following, DBA or Developer?

hobby developer. I have done parts 1 & 3 and didn’t want to do part 2 part it will expire so decided to do it before getting on with the things i was interested in (4,5,6)

Some setup is required for 4, however it doesn’t use vagrant or a VM. 5 and 6 have no vagrant dependency.