Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 8C3F7B5DBEE for ; Sun, 9 Oct 2011 17:22:12 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 44292-02 for ; Sun, 9 Oct 2011 20:22:06 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id B4495B5DBE1 for ; Sun, 9 Oct 2011 17:22:05 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p99KLuaG015763; Sun, 9 Oct 2011 16:21:57 -0400 (EDT) To: Jesper Krogh cc: pgsql-admin@postgresql.org Subject: Re: DB corruption. In-reply-to: <4E91DE9C.60408@krogh.cc> References: <4E9141C8.2020805@krogh.cc> <3774.1318174917@sss.pgh.pa.us> <4E91DE9C.60408@krogh.cc> Comments: In-reply-to Jesper Krogh message dated "Sun, 09 Oct 2011 19:49:16 +0200" Date: Sun, 09 Oct 2011 16:21:56 -0400 Message-ID: <15762.1318191716@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.404 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201110/36 X-Sequence-Number: 38488 Jesper Krogh writes: > On 2011-10-09 17:41, Tom Lane wrote: >> The traditional solution is to zero out the bad block, eg using dd from >> /dev/zero. It's easy to zero more than you intended, so practicing on a >> scratch copy of the table is recommended. > So it is "just" blocknumber * blocksize .. offset, blocksize of zeroes.. ? > Or is the math harder? You have to account for the division of the table into segment files; if blocknumber * blocksize is greater than 1GB, reduce modulo 1GB and look to the appropriate "xxx.n" segment file. Otherwise it's what you'd expect. regards, tom lane