Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id B10A9632BCA for ; Thu, 27 May 2010 04:54:10 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 70911-04 for ; Thu, 27 May 2010 07:54:02 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from echo917.server4you.de (echo917.server4you.de [85.25.141.73]) by mail.postgresql.org (Postfix) with ESMTP id 71DBE632B0E for ; Thu, 27 May 2010 04:54:03 -0300 (ADT) Received: from test.wurger.de (essn-d9bba2d9.pool.mediaWays.net [217.187.162.217]) (authenticated bits=0) by echo917.server4you.de (8.14.2/8.13.6) with ESMTP id o4R7ioq2020422; Thu, 27 May 2010 09:44:51 +0200 Message-ID: <4BFE2518.3050601@longimanus.net> Date: Thu, 27 May 2010 09:54:00 +0200 From: Andreas Schmitz Reply-To: mailinglist@longimanus.net User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: Johann Spies , pgsql-admin@postgresql.org Subject: Re: Corrupted database - how to recover References: <20100527073404.GA32267@sun.ac.za> In-Reply-To: <20100527073404.GA32267@sun.ac.za> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.001 tagged_above=-10 required=5 tests=BAYES_40=-0.001 X-Spam-Level: X-Archive-Number: 201005/260 X-Sequence-Number: 34733 hi johann, maybe you should consider using point in time recovery (pitr) if the database is mission critical. http://www.postgresql.org/docs/8.4/interactive/continuous-archiving.html regards andreas Johann Spies wrote: > 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 >