Re: Recover data from crashed HD - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Recover data from crashed HD
Date
Msg-id 20021024002955.GA27968@svana.org
Whole thread Raw
In response to Recover data from crashed HD  (Nils-Erik Svangård <nilsva-9@student.luth.se>)
List 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@svana.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.

pgsql-general by date:

Previous
From: Chris
Date:
Subject: ownership of sequences
Next
From: Tom Lane
Date:
Subject: Re: ownership of sequences