Re: [HACKERS] Rebuilding DB from broken hardrive.

Lists: pgsql-generalpgsql-hackers
From: Yoon <ylee(at)peragrin(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Rebuilding DB from broken hardrive.
Date: 2006-08-02 23:02:38
Message-ID: 1154559758.10723.4.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers


I was trying postgres for about a year and the hard drive died.
Using some block copy and other tools I was able to retrieve some data
however it's missing directory names.

Eventually, I was able to connect to my db. However, when I make a
query. It comes back with following messages.

WARNING: 4 attrdef record(s) missing <dbname>
ERROR: could not open relation 1663/17230/17235: No such file.

When I'm looking at my lost+found folder and
recreating /var/lib/data/global and /var/lib/data/base/1.

It would be nice to know how each directories are related to each other
or at least a pointer to where I should look.

Thanks,


From: "Jaime Casanova" <systemguards(at)gmail(dot)com>
To: ylee(at)peragrin(dot)com
Cc: "PostgreSQL general" <pgsql-general(at)postgresql(dot)org>
Subject: Re: [HACKERS] Rebuilding DB from broken hardrive.
Date: 2006-08-03 05:58:52
Message-ID: c2d9e70e0608022258w2fe52e0cne40bdea42129bffd@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers

i'm redirecting you to -general because -hackers is not the place for
this question.

some answers below

On 8/2/06, Yoon <ylee(at)peragrin(dot)com> wrote:
>
> I was trying postgres for about a year and the hard drive died.
> Using some block copy and other tools I was able to retrieve some data
> however it's missing directory names.
>
> Eventually, I was able to connect to my db. However, when I make a
> query. It comes back with following messages.
>
> WARNING: 4 attrdef record(s) missing <dbname>
> ERROR: could not open relation 1663/17230/17235: No such file.
>
> When I'm looking at my lost+found folder and
> recreating /var/lib/data/global and /var/lib/data/base/1.
>
> It would be nice to know how each directories are related to each other
> or at least a pointer to where I should look.
>

you need your backups instead... what? you don't have any backups?
then sorry, you need at least the entire data directory to be safe
(and that assuming you don't have any tablespace's pointing to another
location)

--
regards,
Jaime Casanova

"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs and the universe trying
to produce bigger and better idiots.
So far, the universe is winning."
Richard Cook


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: ylee(at)peragrin(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Rebuilding DB from broken hardrive.
Date: 2006-08-03 13:08:44
Message-ID: 3790.1154610524@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers

Yoon <ylee(at)peragrin(dot)com> writes:
> It would be nice to know how each directories are related to each other
> or at least a pointer to where I should look.

http://www.postgresql.org/docs/8.1/static/storage.html

regards, tom lane