title: Why do we need to format HDFS after every time we restart machine?
body: <p>I have installed Hadoop in pseudo distributed mode on my laptop, OS is Ubuntu.</p>
  
  <p>I have changed paths where hadoop will store its data (by default hadoop stores data in <code>/tmp</code> folder)</p>
  
  <p><code>hdfs-site.xml</code> file looks as below :</p>
  
  <pre><code>&lt;property&gt;
      &lt;name&gt;dfs.data.dir&lt;/name&gt;
      &lt;value&gt;/HADOOP_CLUSTER_DATA/data&lt;/value&gt;
  &lt;/property&gt;
  </code></pre>
  
  <p>Now whenever I restart machine and try to start hadoop cluster using <code>start-all.sh</code> script, data node never starts. I confirmed that data node is not start by checking logs and by using <code>jps</code> command.</p>
  
  <p>Then I </p>
  
  <ol>
  <li>Stopped cluster using <code>stop-all.sh</code> script.</li>
  <li>Formatted HDFS using <code>hadoop namenode -format</code> command.</li>
  <li>Started cluster using <code>start-all.sh</code> script.</li>
  </ol>
  
  <p>Now everything works fine even if I stop and start cluster again. Problem occurs only when I restart machine and try to start the cluster.</p>
  
  <ul>
  <li>Has anyone encountered similar problem? </li>
  <li>Why this is happening and </li>
  <li>How can we solve this problem?</li>
  </ul>