I created /data/db in root directory and ran ./mongod:
/data/db
./mongod
[initandlisten] exception in initAndListen: 20 Attempted to create a lock fi
On a Mac, I had to do the following:
sudo chown -R $USER /data/db sudo chown -R $USER /tmp/
because there was also a file inside /tmp which Mongo also needed access
/tmp