title: Mongod complains that there is no /data/db folder
body: <p>I am using my new mac for the first time today. I am following the get started guide on the mongodb.org up until the step where one creates the /data/db directory. btw, I used the homebrew route. </p>
  
  <p>So I open a terminal, and I think I am at what you called the Home Directory, for when I do "ls", I see folders of Desktop Application Movies Music Pictures Documents and Library.</p>
  
  <p>So I did a </p>
  
  <pre><code>mkdir -p /data/db
  </code></pre>
  
  <p>first, it says permission denied. I kept trying different things for half and hour and finally :</p>
  
  <pre><code>mkdir -p data/db
  </code></pre>
  
  <p>worked. and when I "ls", a directory of data and nested in it a db folder do exist.</p>
  
  <p>then I fire up mongod and it complains about not finding data/db</p>
  
  <p>Have I done something wrong?</p>
  
  <p>Now I have done the </p>
  
  <pre><code>sudo mkdir -p /data/db
  </code></pre>
  
  <p>and when I do a "ls" I do see the data dir and the db dir. inside the db dir though, there is absolutely nothing in it and when I now run mongod</p>
  
  <pre><code>Sun Oct 30 19:35:19 [initandlisten] exception in initAndListen: 10309 Unable to create/open lock file: /data/db/mongod.lock errno:13 Permission denied Is a mongod instance already running?, terminating
  Sun Oct 30 19:35:19 dbexit: 
  Sun Oct 30 19:35:19 [initandlisten] shutdown: going to close listening sockets...
  Sun Oct 30 19:35:19 [initandlisten] shutdown: going to flush diaglog...
  Sun Oct 30 19:35:19 [initandlisten] shutdown: going to close sockets...
  Sun Oct 30 19:35:19 [initandlisten] shutdown: waiting for fs preallocator...
  Sun Oct 30 19:35:19 [initandlisten] shutdown: lock for final commit...
  Sun Oct 30 19:35:19 [initandlisten] shutdown: final commit...
  Sun Oct 30 19:35:19 [initandlisten] shutdown: closing all files...
  Sun Oct 30 19:35:19 [initandlisten] closeAllFiles() finished
  Sun Oct 30 19:35:19 [initandlisten] shutdown: removing fs lock...
  Sun Oct 30 19:35:19 [initandlisten] couldn't remove fs lock errno:9 Bad file descriptor
  Sun Oct 30 19:35:19 dbexit: really exiting now
  </code></pre>
  
  <p>EDIT 
  Getting error message for</p>
  
  <pre><code>sudo chown mongod:mongod /data/db
  
  chown: mongod: Invalid argument
  </code></pre>
  
  <p>Thanks, everyone!</p>