pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedrecover of data directory
5+ messages / 4 participants
[nested] [flat]
* recover of data directory
@ 2006-05-29 10:17 Daniel Drotos <drdani@mazsola.iit.uni-miskolc.hu>
2006-05-29 11:19 ` Re: recover of data directory Gourish Singbal <gourish@gmail.com>
2006-05-29 14:58 ` Re: recover of data directory Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 2 replies; 5+ messages in thread
From: Daniel Drotos @ 2006-05-29 10:17 UTC (permalink / raw)
To: pgsql-admin
Hi,
During machine maintenance I've made 'rm -rf *' on postgres data
directory by a (very stupid) mistake. Postmaster was not running that
time.
Using e2undel I dumped out contents of deleted files (3728 files have
been deleted by that command). Because of "rm -r", sizes of recovered
directory files are 0, so I have no filenames and directory structure.
Is there any chance of recover data directory if only dumped file
contents are available?
Daniel
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: recover of data directory
2006-05-29 10:17 recover of data directory Daniel Drotos <drdani@mazsola.iit.uni-miskolc.hu>
@ 2006-05-29 11:19 ` Gourish Singbal <gourish@gmail.com>
1 sibling, 0 replies; 5+ messages in thread
From: Gourish Singbal @ 2006-05-29 11:19 UTC (permalink / raw)
To: Daniel Drotos <drdani@mazsola.iit.uni-miskolc.hu>; +Cc: pgsql-admin
tough luck .. could u query the unix groups and see if u could retrive the
original filenames and directory structure ?.
On 5/29/06, Daniel Drotos <drdani@mazsola.iit.uni-miskolc.hu> wrote:
>
> Hi,
>
> During machine maintenance I've made 'rm -rf *' on postgres data
> directory by a (very stupid) mistake. Postmaster was not running that
> time.
>
> Using e2undel I dumped out contents of deleted files (3728 files have
> been deleted by that command). Because of "rm -r", sizes of recovered
> directory files are 0, so I have no filenames and directory structure.
>
> Is there any chance of recover data directory if only dumped file
> contents are available?
>
> Daniel
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
>
--
Best,
Gourish Singbal
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: recover of data directory
2006-05-29 10:17 recover of data directory Daniel Drotos <drdani@mazsola.iit.uni-miskolc.hu>
@ 2006-05-29 14:58 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-05-29 15:23 ` Re: recover of data directory Daniel Drotos <drdani@mazsola.iit.uni-miskolc.hu>
1 sibling, 1 reply; 5+ messages in thread
From: Tom Lane @ 2006-05-29 14:58 UTC (permalink / raw)
To: Daniel Drotos <drdani@mazsola.iit.uni-miskolc.hu>; +Cc: pgsql-admin
Daniel Drotos <drdani@mazsola.iit.uni-miskolc.hu> writes:
> During machine maintenance I've made 'rm -rf *' on postgres data
> directory by a (very stupid) mistake. Postmaster was not running that
> time.
> Using e2undel I dumped out contents of deleted files (3728 files have
> been deleted by that command). Because of "rm -r", sizes of recovered
> directory files are 0, so I have no filenames and directory structure.
> Is there any chance of recover data directory if only dumped file
> contents are available?
If you could identify which file is which, you could manually
reconstruct the directories, but I'm afraid the odds of doing that
correctly with so many files are nil. Time to get out your last
backup.
regards, tom lane
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: recover of data directory
2006-05-29 10:17 recover of data directory Daniel Drotos <drdani@mazsola.iit.uni-miskolc.hu>
2006-05-29 14:58 ` Re: recover of data directory Tom Lane <tgl@sss.pgh.pa.us>
@ 2006-05-29 15:23 ` Daniel Drotos <drdani@mazsola.iit.uni-miskolc.hu>
2006-05-29 15:28 ` Re: recover of data directory Alvaro Herrera <alvherre@commandprompt.com>
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Drotos @ 2006-05-29 15:23 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-admin
On Mon, 29 May 2006, Tom Lane wrote:
> If you could identify which file is which, you could manually
> reconstruct the directories, but I'm afraid the odds of doing that
Postgresql data files do not identifying themselves (in their content)
so it's an ext2fs problem. I'm trying to solve it, just for fun, and
to get experience how can it be done.
Daniel
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: recover of data directory
2006-05-29 10:17 recover of data directory Daniel Drotos <drdani@mazsola.iit.uni-miskolc.hu>
2006-05-29 14:58 ` Re: recover of data directory Tom Lane <tgl@sss.pgh.pa.us>
2006-05-29 15:23 ` Re: recover of data directory Daniel Drotos <drdani@mazsola.iit.uni-miskolc.hu>
@ 2006-05-29 15:28 ` Alvaro Herrera <alvherre@commandprompt.com>
0 siblings, 0 replies; 5+ messages in thread
From: Alvaro Herrera @ 2006-05-29 15:28 UTC (permalink / raw)
To: Daniel Drotos <drdani@mazsola.iit.uni-miskolc.hu>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-admin
Daniel Drotos wrote:
> On Mon, 29 May 2006, Tom Lane wrote:
>
> >If you could identify which file is which, you could manually
> >reconstruct the directories, but I'm afraid the odds of doing that
>
> Postgresql data files do not identifying themselves (in their content)
> so it's an ext2fs problem. I'm trying to solve it, just for fun, and
> to get experience how can it be done.
You could guess what some files are, particularly the system catalogs,
by searching for known contents (for example, if you see the string
"pg_class" and "pg_attribute" you could think it's the file for pg_class
itself). You could identify several system catalogs easily this way.
But for user tables it would be quite complicated. I'd use the number
of atts as a first clue (assuming you have already restored the system
catalogs).
I don't know how you intend to guess at telling the pg_clog files apart
though :-)
--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2006-05-29 15:28 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-05-29 10:17 recover of data directory Daniel Drotos <drdani@mazsola.iit.uni-miskolc.hu>
2006-05-29 11:19 ` Gourish Singbal <gourish@gmail.com>
2006-05-29 14:58 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-05-29 15:23 ` Daniel Drotos <drdani@mazsola.iit.uni-miskolc.hu>
2006-05-29 15:28 ` Alvaro Herrera <alvherre@commandprompt.com>
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