Обсуждение: ERROR: could not read block
Hello everybody,
I had a hard drive failure last week. After lots of effort I've been able to backup a 700GB database, with only one file with corruption.
When I do some big queries, it throws me errors on this faulty file:
could not read block 390041 of relation 1663/350994/351212: read only 0 of 8192 bytes
I would like to know if there is any way to say to postgres to drop all rows that corresponds to that file. In that way I would save most of my data.
Thanks in advance
Diego
=?ISO-8859-1?Q?Diego_Fern=E1ndez_Slezak?= <dfslezak@gmail.com> writes: > Hello everybody, > I had a hard drive failure last week. After lots of effort I've been able to > backup a 700GB database, with only one file with corruption. > When I do some big queries, it throws me errors on this faulty file: > could not read block 390041 of relation 1663/350994/351212: read only 0 of > 8192 bytes I'm guessing this is the result of an index entry pointing to a block that's not there --- either the index is corrupted, or you lost some data. In any case, reindexing the table ought to get rid of this error. regards, tom lane
Thanks Tom.
I executed a REINDEX DATABASE and received the error:
.
.
.
NOTICE: table "pg_enum" was reindexed
NOTICE: table "pg_namespace" was reindexed
NOTICE: table "pg_conversion" was reindexed
NOTICE: table "pg_depend" was reindexed
NOTICE: table "users" was reindexed
NOTICE: table "results" was reindexed
NOTICE: table "games" was reindexed
NOTICE: table "game_status" was reindexed
ERROR: could not extend relation 1663/350994/448678: wrote only 4096 of 8192 bytes at block 44030
HINT: Check free disk space.
When I check free space, I have more than 100GB free:
$ df -h
/dev/sdc1 917G 742G 130G 86% /home
Also, when I check what does this file correspond to I get a empty answer:
/usr/lib/postgresql/8.3/bin/oid2name -d mydb -f 448678
From database "mydb":
Filenode Table Name
----------------------
Thanks in advance
Diego
I executed a REINDEX DATABASE and received the error:
.
.
.
NOTICE: table "pg_enum" was reindexed
NOTICE: table "pg_namespace" was reindexed
NOTICE: table "pg_conversion" was reindexed
NOTICE: table "pg_depend" was reindexed
NOTICE: table "users" was reindexed
NOTICE: table "results" was reindexed
NOTICE: table "games" was reindexed
NOTICE: table "game_status" was reindexed
ERROR: could not extend relation 1663/350994/448678: wrote only 4096 of 8192 bytes at block 44030
HINT: Check free disk space.
When I check free space, I have more than 100GB free:
$ df -h
/dev/sdc1 917G 742G 130G 86% /home
Also, when I check what does this file correspond to I get a empty answer:
/usr/lib/postgresql/8.3/bin/oid2name -d mydb -f 448678
From database "mydb":
Filenode Table Name
----------------------
Thanks in advance
Diego
On Sat, May 21, 2011 at 12:16 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Diego Fernández Slezak <dfslezak@gmail.com> writes:I'm guessing this is the result of an index entry pointing to a block
> Hello everybody,
> I had a hard drive failure last week. After lots of effort I've been able to
> backup a 700GB database, with only one file with corruption.
> When I do some big queries, it throws me errors on this faulty file:
> could not read block 390041 of relation 1663/350994/351212: read only 0 of
> 8192 bytes
that's not there --- either the index is corrupted, or you lost some
data. In any case, reindexing the table ought to get rid of this error.
regards, tom lane