From: W.P. <laurentp@wp.pl>
To: pgsql-general@lists.postgresql.org
Subject: Re: Damaged (during upgrade?) table, how to repair?
Date: Sun, 4 Jul 2021 21:29:10 +0200
Message-ID: <7671131a-c2a9-644a-507b-2dcb4bb0abae@wp.pl> (raw)
In-Reply-To: <2b4db53d-6420-e152-b4d4-9718d0f7c12e@aklaver.com>
References: <7a242c24-6bc7-2800-a857-6fbe8633382b@wp.pl>
<0c827ef91e60470588d5ff4fe4394abb2ec8509d.camel@cybertec.at>
<7775fcc7-b41a-394f-3c58-8960b23dee40@wp.pl>
<e8399909-85db-af68-3bd3-febdbc4bfd72@aklaver.com>
<e7f5cf4f-0150-f870-92c4-c2aa193be95e@wp.pl>
<fddafac2-f811-4c31-76af-f8f04e014d18@aklaver.com>
<cd686a45-8a27-a1a0-da79-b2fec00d6d9b@wp.pl>
<a0cc123d-c673-d909-ac90-3d6ac1d9842b@aklaver.com>
<c7bce313-802d-ec16-602c-a14d3eb7726a@wp.pl>
<2b4db53d-6420-e152-b4d4-9718d0f7c12e@aklaver.com>
>> So you have backup of the failed machine's disk stored somewhere else?
>>>>
>>>>
>>>> No, I have disc from this machine, looks not damaged (random
>>>> files). Only problem that OS does not boot beyond "emergency mode".
>>>
>>> I would say your second sentence contradicts your first.
>>
>> Nope ;). There was 1 500GB disc, with Fedora24 and Postgres 9.5. Then
>> copied "sector by sector" (and resized partitions, volumes, fs) to
>> 1TB one. This was my "working" disc.
>
> To be clear the 1TB disk is working where and with what OS?
1TB DISC is connected to OrangePi4 (as I have copied disc "sector by
sector" from 500GB to 1TB, some months ago, I can't connect both of them
to one machine -> same UUIDs, LVM does crazy). And then I copy single
files using rsync.
>
>>
>>
>> For test, now I have put it (500GB) in another laptop, then upgraded
>> F24 to F30 (step by step, once I had to do manually "pg_upgrade",
>> ARAIR this was at PG10->PG11 step).
>
> For future reference you can could have gone from 9.5 -> 11 without
> the intermediate upgrades.
>
That is not true for Fedora OS.... Tested both ways, only "step by step"
looks working (but is time consuming).
> Also where were you installing Postgres from the Fedora or Postgres
> repos?
From Fedora's, during OS upgrade.
>
>>
>>
>> Now I did my crazy move, removed battery and power while "suspend to
>> RAM". OS (F24! @ 1TB) don't start anymore (beyond "emergency").
>
> I will reserve comment on that move. Still in future it would be
> prudent to do a pg_dump and stash the backup somewhere off machine
> before you do that sort of experiment.
>
>
>>
>> I use now this upgraded disc (500GB), copying files for daily work
>> from 1TB one attached to OPi4.
>
> What I understand from the above is you are copying files from the 1TB
> disk to the 500GB disc to work with on the 500GB disk/machine. Am I
> correct?
Yes.
>
>>
>> Will try, if I can achieve PG9.5 run on that "non working" one. If
>> so, and dumpall is OK, then files on this are mainly intact (except
>> for NetworkManager)...
>
> In that case you will be using 9.5 pg_dump(all) to do the dump,
> Assuming it works it is not guaranteed that it will restore forward to
> Postgres 11.
>
>
>
>>>
>>> This will require installing development packages on your new machine.
>>>
>> Ok, should be easy :)
>>
>> But what PREFIX should I use during configure step?
>> "/usr/lib/postgresql/"? And what about location of config files?
>
> The default for a source compile install is
> /usr/local/pgsql(https://www.postgresql.org/docs/11/install-procedure.html).
> I would stick with that if for no other reason then helping
> identifying your package and source clusters.
>
At 9.5 "era" there ware single directories (/bin /lib etc) for single
machine, now as I can see, there are "single" but one for each PG
version installed, with dispatcher(s) located in PATH (/usr/(local)/bin.
So I want to replicate this doing my PG upgrade.
>>
>>
>>>>
>>>> (I can see PG10 somewhere in /usr/pgsql/postgresql-10/ - bin, lib,
>>>> share, postgresql-9.6 is empty).
>>>
>>> Where do you see the above, old machine or new machine?
>>>
>> 500GB disc, after system upgrade.
>
> So those where the intermediate updates as you hopped through the
> OS/Postgres versions.
>
>>
>>
>> Laurent
>>
>>
>>
>
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: laurentp@wp.pl
Subject: Re: Damaged (during upgrade?) table, how to repair?
In-Reply-To: <7671131a-c2a9-644a-507b-2dcb4bb0abae@wp.pl>
References: <7a242c24-6bc7-2800-a857-6fbe8633382b@wp.pl> <0c827ef91e60470588d5ff4fe4394abb2ec8509d.camel@cybertec.at> <7775fcc7-b41a-394f-3c58-8960b23dee40@wp.pl> <e8399909-85db-af68-3bd3-febdbc4bfd72@aklaver.com> <e7f5cf4f-0150-f870-92c4-c2aa193be95e@wp.pl> <fddafac2-f811-4c31-76af-f8f04e014d18@aklaver.com> <cd686a45-8a27-a1a0-da79-b2fec00d6d9b@wp.pl> <a0cc123d-c673-d909-ac90-3d6ac1d9842b@aklaver.com> <c7bce313-802d-ec16-602c-a14d3eb7726a@wp.pl> <2b4db53d-6420-e152-b4d4-9718d0f7c12e@aklaver.com> <7671131a-c2a9-644a-507b-2dcb4bb0abae@wp.pl>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox