Thread: Can not restart postgres: Panic could not locate a valid checkpoint record

Can not restart postgres: Panic could not locate a valid checkpoint record

From
Mary Ellen Fitzpatrick
Date:
Hi,
I am running postgres-8.1 on a Centos5 system.
this morning when I came in there was no more disk space on the
partition that holds pgsql: /var/lib/pgsql.
I believe postgres had crashed at this point.  I stupidly removed all of
the files under pg_xlog to create disk space.  Not knowing that those
are the files I need to start the database.  I  quickly realized the
error I had made and restored the  pg_xlog data/files from our system
backup that ran at 1am last night (4/22/08).

Now when I try to restart the database, I get the following error.   It
is looking for file 000000010000001300000064, which I do not have.

LOG:  database system was shut down at 2008-04-22 10:38:59 EDT
LOG:  could not open file "pg_xlog/" (log file 19, segment 100): No such
file or directory
LOG:  invalid primary checkpoint record
LOG:  could not open file "pg_xlog/000000010000001300000064" (log file
19, segment 100): No such file or directory
LOG:  invalid secondary checkpoint record
PANIC:  could not locate a valid checkpoint record
LOG:  startup process (PID 6800) was terminated by signal 6
LOG:  aborting startup due to startup process failure
LOG:  logger shutting down


I am in the process of having the WAL dir restored as well.  Again, in
my haste, I deleted that dir as well.  This data will be from 4/22/08 at
1pm as well, time of the system backup.


If I do not have the files that startup script is asking for, what is
the best way to restart the database.
Any advise (other than not deleting important dirs) would be greatly
appreciated.


--
Thanks
Mary Ellen


Re: Can not restart postgres: Panic could not locate a valid checkpoint record

From
"BRUSSER Michael"
Date:
Some time ago I had a similar problem with Postgresql 7.3.
If I remember correctly running pg_resetxlog helped; check out
http://www.postgresql.org/docs/8.3/static/app-pgresetxlog.html

Michael.


-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of Mary Ellen
Fitzpatrick
Sent: Tuesday, April 22, 2008 1:14 PM
To: PGSQL General
Subject: [GENERAL] Can not restart postgres: Panic could not locate a
valid checkpoint record

Hi,
I am running postgres-8.1 on a Centos5 system.
this morning when I came in there was no more disk space on the
partition that holds pgsql: /var/lib/pgsql.
I believe postgres had crashed at this point.  I stupidly removed all of

the files under pg_xlog to create disk space.  Not knowing that those
are the files I need to start the database.  I  quickly realized the
error I had made and restored the  pg_xlog data/files from our system
backup that ran at 1am last night (4/22/08).

Now when I try to restart the database, I get the following error.   It
is looking for file 000000010000001300000064, which I do not have.

LOG:  database system was shut down at 2008-04-22 10:38:59 EDT
LOG:  could not open file "pg_xlog/" (log file 19, segment 100): No such

file or directory
LOG:  invalid primary checkpoint record
LOG:  could not open file "pg_xlog/000000010000001300000064" (log file
19, segment 100): No such file or directory
LOG:  invalid secondary checkpoint record
PANIC:  could not locate a valid checkpoint record
LOG:  startup process (PID 6800) was terminated by signal 6
LOG:  aborting startup due to startup process failure
LOG:  logger shutting down


I am in the process of having the WAL dir restored as well.  Again, in
my haste, I deleted that dir as well.  This data will be from 4/22/08 at

1pm as well, time of the system backup.


If I do not have the files that startup script is asking for, what is
the best way to restart the database.
Any advise (other than not deleting important dirs) would be greatly
appreciated.


--
Thanks
Mary Ellen


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Re: Can not restart postgres: Panic could not locate a valid checkpoint record

From
Mary Ellen Fitzpatrick
Date:
I ran the pg_resetxlog -n to test and it found the correct values.  Ran
it for real and it worked.
Thank you for the info/help
Mary Ellen

BRUSSER Michael wrote:
> Some time ago I had a similar problem with Postgresql 7.3.
> If I remember correctly running pg_resetxlog helped; check out
> http://www.postgresql.org/docs/8.3/static/app-pgresetxlog.html
>
> Michael.
>
>
> -----Original Message-----
> From: pgsql-general-owner@postgresql.org
> [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Mary Ellen
> Fitzpatrick
> Sent: Tuesday, April 22, 2008 1:14 PM
> To: PGSQL General
> Subject: [GENERAL] Can not restart postgres: Panic could not locate a
> valid checkpoint record
>
> Hi,
> I am running postgres-8.1 on a Centos5 system.
> this morning when I came in there was no more disk space on the
> partition that holds pgsql: /var/lib/pgsql.
> I believe postgres had crashed at this point.  I stupidly removed all of
>
> the files under pg_xlog to create disk space.  Not knowing that those
> are the files I need to start the database.  I  quickly realized the
> error I had made and restored the  pg_xlog data/files from our system
> backup that ran at 1am last night (4/22/08).
>
> Now when I try to restart the database, I get the following error.   It
> is looking for file 000000010000001300000064, which I do not have.
>
> LOG:  database system was shut down at 2008-04-22 10:38:59 EDT
> LOG:  could not open file "pg_xlog/" (log file 19, segment 100): No such
>
> file or directory
> LOG:  invalid primary checkpoint record
> LOG:  could not open file "pg_xlog/000000010000001300000064" (log file
> 19, segment 100): No such file or directory
> LOG:  invalid secondary checkpoint record
> PANIC:  could not locate a valid checkpoint record
> LOG:  startup process (PID 6800) was terminated by signal 6
> LOG:  aborting startup due to startup process failure
> LOG:  logger shutting down
>
>
> I am in the process of having the WAL dir restored as well.  Again, in
> my haste, I deleted that dir as well.  This data will be from 4/22/08 at
>
> 1pm as well, time of the system backup.
>
>
> If I do not have the files that startup script is asking for, what is
> the best way to restart the database.
> Any advise (other than not deleting important dirs) would be greatly
> appreciated.
>
>
>

--
Thanks
Mary Ellen


Re: Can not restart postgres: Panic could not locate a valid checkpoint record

From
"Scott Marlowe"
Date:
On Tue, Apr 22, 2008 at 1:00 PM, Mary Ellen Fitzpatrick <mfitzpat@bu.edu> wrote:
> I ran the pg_resetxlog -n to test and it found the correct values.  Ran it
> for real and it worked.

Note that on most unix systems, some percentage of disk storage is
reserved for use by root only.  On linux with ext2/3 you can change
this % with the tune2fs command...

tune2fs -m 0 /dev/sdb2

would set the drive mounted from /dev/sdb2 to have 0 reserved % for
root, and may be enough in the future to get you out of this
situation.  Be sure to set it back to 1 or 2 % after you've cleaned up
enough so you have the free space again when you need it.

The same thing can be done with quotas...