Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ncA19-0005aZ-Cr for pgsql-general@arkaria.postgresql.org; Wed, 06 Apr 2022 18:04:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ncA17-0002cK-VJ for pgsql-general@arkaria.postgresql.org; Wed, 06 Apr 2022 18:04:29 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ncA17-0002c5-H1 for pgsql-general@lists.postgresql.org; Wed, 06 Apr 2022 18:04:29 +0000 Received: from mx3.wp.pl ([212.77.101.10]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ncA0z-00061g-TC for pgsql-general@lists.postgresql.org; Wed, 06 Apr 2022 18:04:28 +0000 Received: (wp-smtpd smtp.wp.pl 20288 invoked from network); 6 Apr 2022 20:04:16 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wp.pl; s=1024a; t=1649268256; bh=Hmqpn/Ghwp4Gk657C4S3gnX5qXsfidP8ifdLxGLB5GM=; h=Subject:To:From; b=mmCycf9p2osWKDY5MwNbDS3QFasD11gxWi6rhGkBjHSLMMBeZ3fu8+lxaDEW51wuO OmWdNkxELA0dtddCoa5eLbqUSJyITAw0YA2Ewy9Y+cG2CNq4f4NPdPgWsqvTBGuVTz A3lJ5x9TCCoJ1jfFLJ1P1oqiFB24zAauJbzAxtLE= Received: from afqw167.neoplus.adsl.tpnet.pl (HELO [192.168.1.200]) (laurentp@wp.pl@[178.42.178.167]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 6 Apr 2022 20:04:16 +0200 Subject: Re: Problem with PG 11 database on OrangePi3 (ARMBIAN, ARM64) after disk disrupion (problem with USB disk connection) To: pgsql-general@lists.postgresql.org References: <9ff52fa7-a125-1225-0e23-c22f034ceb91@wp.pl> <5f2de1ce-4b22-59d1-178e-71cb6a3bfc02@wp.pl> From: "W.P." Message-ID: <4a3ef3ed-7591-2195-e3a9-d7ff5e0331b6@wp.pl> Disposition-Notification-To: "W.P." Date: Wed, 6 Apr 2022 20:04:16 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-WP-MailID: 7f15c2fbac6c974096f804bc58425ea1 X-WP-AV: skaner antywirusowy Poczty Wirtualnej Polski X-WP-SPAM: NO 0000009 [sIN0] List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk W dniu 06.04.2022 o 18:54, Ron pisze: > On 4/6/22 11:41, W.P. wrote: >> W dniu 06.04.2022 o 12:37, Laurenz Albe pisze: >>> On Wed, 2022-04-06 at 10:57 +0200, W.P. wrote: >>>> Is it possible to repair this? >>> Not unless you tell us what exactly you did, command by command. >>> >>> Yours, >>> Laurenz Albe >>> >>> >>> >> That was not a "command". PG was working ok, DB on encrypted (LUKS on >> LVM2, ext4) USB drive. >> >> Then simply I disconnected cable by accident. >> >> After OPi restart, with filesystem on USB mounted again and fsck'ed >> first, PG refuses to start. With a message about replication error in >> log. >> >> But I did not configured relication. > > The disk got corrupted, and one part that got corrupted is where > Postgresql's replication (or not) is configured. > > Delete the data/ directory and restore from backups (including config > files). > I know about restoring backup. I just don't have one (at least with reasonnable age), as it is experimental installation. (Didn't ever been thinking about locating production DB on USB drive :) ). If it is not possible to get rid ("somehow") of this "replication error", I will do a "logic restore" -> I have similar database on my laptop, so I'll get a pg_dumpall from this one, then recreate fresh DB on OPi and restore from SQL. It looks that DATA in PG DB is protected by various mechanisms very well, but "dictionary data" (in this case replication data) is not (as much). And in my case ext4 recovery mechanisms failed. This makes me logical replication more appealing. Laurent