title: Cannot recover the master database. SQL Server is unable to run
body: <p>Right,</p>
  
  <p>I powered off development server because it was hanged, when restarted directory services database was corrupted, so fixed it, then figured out that IIS Manager's metadata.xml is messed up, so fixed it using backup too.</p>
  
  <p>But now SQL Server service isn't starting giving this error,</p>
  
  <blockquote>
    <p>Cannot recover the master database. SQL Server is unable to run.
    Restore master from a full backup, repair it, or rebuild it. For more
    information about how to rebuild the master database, see SQL Server
    Books Online.</p>
  </blockquote>
  
  <p>Right I already tried adding network service permission to all files and databases still no luck, i also read after googling that compressing it might work but it don't know what they mean.</p>
  
  <p>How can I fix it ?</p>
  
  <p>I tried</p>
  
  <pre><code>C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap&gt;start /wait setup.exe /
  qb InstanceName=MSSQLSERVER SQL_Engine REBUILDDATABASE=1 SAPWD=mypassword REINST
  ALLMODE=omu
  </code></pre>
  
  <p>and</p>
  
  <pre><code>C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap&gt;start /wait setup.exe /
  qb  /action=rebuilddatabase /quiet /InstanceName=MSSQLSERVER /sqlsysadminaccount
  s=domainName\userName /sapwd=123
  </code></pre>
  
  <p>but no gain only pain.</p>