pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Johann Spies <jspies@sun.ac.za>
To: pgsql-admin@postgresql.org
Subject: Corrupted database - how to recover
Date: Thu, 27 May 2010 09:34:04 +0200
Message-ID: <20100527073404.GA32267@sun.ac.za> (raw)

After two disks on our raid-5 system failed causing a filesystem
failure.

We could get one online again and the filesystem is at present usable
but  I cannot start postgresql at the moment:

$ /usr/lib/postgresql/8.3/bin/postgres --single -D /etc/postgresql/8.3/main/
2010-05-27 09:22:48 SAST FATAL:  could not stat directory "base/16400": Structure needs cleaning
2010-05-27 09:22:48 SAST CONTEXT:  xlog redo insert: rel 1663/16400/16438; tid 10960/41

in 'base' I see

drwx------ 10 postgres postgres  102 2010-04-22 15:09 .
drwx------ 10 postgres postgres 4096 2010-05-27 09:29 ..
drwx------  2 postgres postgres 4096 2010-05-20 02:11 1
drwx------  2 postgres postgres 4096 2010-04-22 15:07 11510
??????????  ? ?        ?           ?                ? 16388
drwx------  2 postgres postgres 4096 2010-05-20 02:11 16389
drwx------  2 postgres postgres 4096 2010-05-20 02:11 16390
drwx------  2 postgres postgres 4096 2010-05-20 02:11 16391
??????????  ? ?        ?           ?                ? 16400

I can just move the data-directory, do an initdb and use an older dump
to repair the database as it was some time ago.  Fortunately the data is
not mission critical.  But what if it was.  

How do I recover from a situation like this?

Regards
Johann
-- 
Johann Spies          Telefoon: 021-808 4599
Informasietegnologie, Universiteit van Stellenbosch

     "All that the Father giveth me shall come to me; and
      him that cometh to me I will in no wise cast out."
                                      John 6:37 



view thread (3+ messages)  latest in thread

Message-ID: <20100527073404.GA32267@sun.ac.za>
Permalink:  ../20100527073404.GA32267@sun.ac.za/
Also on:    postgresql.org/message-id/20100527073404.GA32267@sun.ac.za

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: jspies@sun.ac.za
  Subject: Re: Corrupted database - how to recover
  In-Reply-To: <20100527073404.GA32267@sun.ac.za>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox