title: How do I fix Postgres so it will start after an abrupt shutdown?
body: <p>Due to a sudden power outage, the Postgres server running on my local machine shut down abruptly. After rebooting, I tried to restart Postgres and I get this error:</p>
  <p><strong><code>$ pg_ctl -D /usr/local/pgsql/data restart</code></strong></p>
  <pre><code>pg_ctl: PID file &quot;/usr/local/pgsql/data/postmaster.pid&quot; does not exist
  Is server running?
  starting server anyway
  server starting
  $:/usr/local/pgsql/data$ LOG:  database system shutdown was interrupted at 2009-02-28 21:06:16 
  LOG:  checkpoint record is at 2/8FD6F8D0
  LOG:  redo record is at 2/8FD6F8D0; undo record is at 0/0; shutdown FALSE
  LOG:  next transaction ID: 0/1888104; next OID: 1711752
  LOG:  next MultiXactId: 2; next MultiXactOffset: 3
  LOG:  database system was not properly shut down; automatic recovery in progress
  LOG:  redo starts at 2/8FD6F918
  LOG:  record with zero length at 2/8FFD94A8
  LOG:  redo done at 2/8FFD9480
  LOG:  could not fsync segment 0 of relation 1663/1707047/1707304: No such file or directory
  FATAL:  storage sync failed on magnetic disk: No such file or directory
  LOG:  startup process (PID 5465) exited with exit code 1
  LOG:  aborting startup due to startup process failure
  </code></pre>
  <p>There is no <code>postmaster.pid</code> file in the data directory.  What possibly could be the reason for this sort of behavior and of course what is the way out?</p>