Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cHXzy-0003yy-48 for pgsql-admin@arkaria.postgresql.org; Thu, 15 Dec 2016 15:31:10 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cHXzx-0002Zm-Id for pgsql-admin@arkaria.postgresql.org; Thu, 15 Dec 2016 15:31:09 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cHXzx-0002ZY-1Y for pgsql-admin@postgresql.org; Thu, 15 Dec 2016 15:31:09 +0000 Received: from host3.dynacom.ondsl.gr ([62.103.35.211] helo=smadev.internal.net) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cHXzt-0008Ia-U1 for pgsql-admin@postgresql.org; Thu, 15 Dec 2016 15:31:07 +0000 Received: from smadev.internal.net (smadev [10.9.200.131]) by smadev.internal.net (8.15.2/8.15.2) with ESMTP id uBFFV1Ph071756 for ; Thu, 15 Dec 2016 17:31:02 +0200 (EET) (envelope-from achill@matrix.gatewaynet.com) Subject: Re: Database corrupted - PSQL 9.3 Ubuntu Server 14.04 To: pgsql-admin@postgresql.org References: From: Achilleas Mantzios Message-ID: <5852B735.5050007@matrix.gatewaynet.com> Date: Thu, 15 Dec 2016 17:31:01 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org On 15/12/2016 17:07, Sébastien Beausoleil wrote: > Hi, > I have a big problem with one of my Postgresql server. > I started a standard package update and during the Postgresql update, something happen that it make it fails. Since when, postgresql isn't able to start. > In the log, here is what it is showed: What postgresql update ? > > 2016-12-15 08:40:03 EST FATAL: "/var/lib/postgresql/9.3/main" is not a valid data directory > 2016-12-15 08:40:03 EST DETAIL: File "/var/lib/postgresql/9.3/main/PG_VERSION" is missing. > > And if I go further, there is a reccuring message: > > 2016-12-14 22:01:14 EST FATAL: could not open relation mapping file "global/pg_filenode.map": No such file or directory > 2016-12-14 22:01:15 EST ERROR: could not open file "base/305852/11848": No such file or directory > 2016-12-14 22:01:15 EST CONTEXT: writing block 0 of relation base/305852/11848 > 2016-12-14 22:01:15 EST WARNING: could not write block 0 of base/305852/11848 > 2016-12-14 22:01:15 EST DETAIL: Multiple failures --- write error might be permanent. > > > I notice, when comparing with a similare server, that 3 db data in the main/base folder are empty, I suppose it's the postgres, template0 et template1 database. That's pretty bad. Can you locate them anywhere else in your file system? > > I try pg_resetxlog on a copy of the data dir, the server came up but the "postgres" user isn't a valide role... > > I had a cron which make dump backup each day but there was un bug in the script that make it right, so I know we should not rely on recovery, but by now, It s really my only hope. Do you take any file system backup by pg_start_backup/pg_stop_backup ? or pg_basebackup? or WAL archiving? > > Could someone help me? > > Sebastien > > > OS: Ubuntu Server 14.04 64bit > Postgresql: 9.3 > > > > > -- Achilleas Mantzios IT DEV Lead IT DEPT Dynacom Tankers Mgmt -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin