LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-09-2011, 11:26 AM   #1
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
postgresql: is there a way to make a hero dump of a db?


Hi!

Is there a way to make an offline dump from a server that crashed because there are physical problems with the disks that made up a RAID5? I was able to partially recover the data from the disks and rebuild the image in the RAID, I was able to copy the /var/lib/postgresql out of the server but when we try to get a pg_drump from it, it starts complaining about missing/wrong files. I know we won't be able to recover the exact data that was on the DB before it crashed, but then I'd like to get as much as possible from it. db_dump (or the server) will halt at the first problem they find on the DB.... is there a way to make a hero effort to get as much (consistent) data as possible? either online of offline?

The server was running ubuntu 9.10 (postgres 8.3) and I have it up on a virtual machine with te same versions of ubuntu/postgres.

Thanks in advance.
 
Old 11-11-2011, 02:38 AM   #2
resolv_25
Member
 
Registered: Aug 2011
Location: Croatia
Distribution: Debian 10/Ubuntu 20.04
Posts: 64

Rep: Reputation: 15
When you copy complete contents of your /var/lib/postgresql to new server, can you start Postgres and connect to databases ?
If there is a different architecture (i.e. copying from physical server to virtual server), seems that could be a problem with a restore from raw data.
I'm curious about solution, at first glance, it looks tricky restoring data from a raw files.

Eventually, this procedure might work:
http://forums.devshed.com/postgresql...up-342965.html

Last edited by resolv_25; 11-11-2011 at 02:46 AM.
 
Old 11-11-2011, 07:58 AM   #3
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
We can start the server (after doing some hacks on the postgresq.conf file to avoid some errors) and doing other stuff (not too much).

Then postgresql will start and you are able to send queries and so on... the problem is that some queries will break the connection altogether (though the server is still up) and the pg_dump will fail because of problems on this or that file. But does the service start? Oh, yeah, it does!

About the procedure, we are replacing the whole /var/lib/postgresql directory to do our recovery attempt.

Last edited by eantoranz; 11-11-2011 at 07:59 AM.
 
Old 11-11-2011, 08:06 AM   #4
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
Just keep in mind that because it comes from a corrupted FS (because the raid was faulty), there could be a lot of crap on the pg available files. I just want to know how to try to get the most data out of the DB... and skip what's junk, but try to get as much correct data as possible. Is theere a combination of postgresql.conf parameters that could force postgresql to try to avoid as many errors as possible?

Thanks in advance.

PS would it be too tricky to try to do it directly from the files, I mean, make a postgresql raw files reader (offline).
 
Old 11-11-2011, 08:07 AM   #5
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
and the word is not "avoid", but rather "skip over".
 
  


Reply

Tags
pg_dump, postgresql, raid, recovery, ubuntu



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] PostgreSql error after db dump warrenscorgie Linux - General 1 12-09-2010 09:59 PM
Creating a core dump from raw ram dump? cyent Programming 2 08-15-2010 05:57 PM
Newbe:: how to make CD's out of MANDRIVA 2006 DVD dump sukhbir Mandriva 2 02-27-2006 03:59 PM
How to forcely dump the history of user commands to the admin dump file. mcp_achindra Linux - Security 1 03-19-2004 12:04 PM
postgresql -odbc & postgresql-jdbc installation kjsubbu Linux - Software 0 06-19-2003 02:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration