Re: Recover data from crashed HD

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Nils-Erik Svangård <nilsva-9(at)student(dot)luth(dot)se>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Recover data from crashed HD
Date: 2002-10-24 00:29:55
Message-ID: 20021024002955.GA27968@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Oct 23, 2002 at 02:02:02AM +0200, Nils-Erik Svangård wrote:
> Hello!
>
> One of my harddrives crashed two day ago. Only the /lib och /usr
> directories was on one of my other hd's.
> The old hd can no longer be detected by the bios. I have reinstalled
> everything now.
> The data directory in the old /lib contains what I would guess is
> postgresqls table data. Can I recover the data?
> I have tried to overwrite the new installation with the old files, but
> the old database is not there.
>
> I am a newbie in SQL-land, does anyone know how to revcover the data?

You need what used to be the *entire* /var/lib/postgres/data directory (or
whatever you called it). It should have a PG_VERSION file, several other
files and a "base" and "pg_xlog" directory. Please check that you have at
least that much.

If not, you have a real problem. Also, the version of postgres you've
installed must be the same as the you're trying to recover. that's what's in
the PG_VERSION file.

Otherwise, time to go back to backups...
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> There are 10 kinds of people in the world, those that can do binary
> arithmetic and those that can't.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Medi Montaseri 2002-10-24 01:09:32 need help with a table shrinker
Previous Message Chris 2002-10-23 22:58:28 ownership of sequences