Resore PG-Data from Files after crash

Started by Christian Maierover 20 years ago4 messagesgeneral
Jump to latest
#1Christian Maier
tomtailor@freesurf.fr

Hi!

I've the following Problem and hope someone can help me. My PostgreSQL
Database were running on a Debian Linux. Some day the OS crahsed and -
here's the Problem - there is no dump file from Database. But I still
have the files in base, global, pg_clog. So I did a fresh setup and
copied the files in the pg data directory. But even I try to start via
pg_ctl fails caus:

Starting PostgreSQL database server: postmaster(FAILED)
ERROR: There is no PostgreSQL database framework in /srv/postgres/data.
Run initdb as the postgres user to create it

I don't want to run initDB because the dir isn't empty - of course I
copied my old data files in there.

What can I do?

Thank you!!

Christian Meier

#2Martijn van Oosterhout
kleptog@svana.org
In reply to: Christian Maier (#1)
Re: Resore PG-Data from Files after crash

On Thu, Aug 25, 2005 at 08:56:40AM -0700, tomtailor@freesurf.fr wrote:

Hi!

I've the following Problem and hope someone can help me. My PostgreSQL
Database were running on a Debian Linux. Some day the OS crahsed and -
here's the Problem - there is no dump file from Database. But I still
have the files in base, global, pg_clog. So I did a fresh setup and
copied the files in the pg data directory. But even I try to start via
pg_ctl fails caus:

Looks like you're missing at least pg_xlog (which resetxlog might fix
for you) and PGVERSION (which is just a tag file).

I recommand running initdb on an empty directory and copy the stuff you
do have over the top and see if that works...

Keep a backup though...
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/

Show quoted text

Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
tool for doing 5% of the work and then sitting around waiting for someone
else to do the other 95% so you can sue them.

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Christian Maier (#1)
Re: Resore PG-Data from Files after crash

tomtailor@freesurf.fr writes:

Starting PostgreSQL database server: postmaster(FAILED)
ERROR: There is no PostgreSQL database framework in /srv/postgres/data.
Run initdb as the postgres user to create it

There is no such error string in Postgres proper -- I suppose the
complaint is coming from whatever start script you use. Most of the
start scripts I've seen just look for a PG_VERSION file, and maybe
check its contents.

See
http://www.postgresql.org/docs/8.0/static/storage.html
for some information about what needs to be there.

regards, tom lane

#4Christian Maier
tomtailor@freesurf.fr
In reply to: Tom Lane (#3)
Re: Resore PG-Data from Files after crash

THX for Help, but it seems that there is no way get it fixed ...

So long ...
Christian