Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7725601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:58:45+00:00 2026-06-01T04:58:45+00:00

My EC2 database server failed, preventing SSH or other access (not sure why …

  • 0

My EC2 database server failed, preventing SSH or other access (not sure why … grrr AWS … that’s another story).

I was able to make a snapshot of the EBS root volume. I can not boot a new instance from this volume (I’m guessing the boot partition is corrupt). However, I can attach and mount the volume on a new instance.

Now I need to get the PostgreSQL 8.4 on the new machine (Ubuntu 10.04) to load the data from the mounted volume. Is this possible? I’ve tried:

pg_ctl start -D /<mount_dir>/etc/postgresql/8.4/main/

But no joy … PostgreSQL just starts with empty tables.

Is /etc/postgresql/8.4/main/ the correct location for PostgreSQL data files?

Is there a way to recover the data from the mounted volume in a way that PostgreSQL can read again?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T04:58:47+00:00Added an answer on June 1, 2026 at 4:58 am

    (You should really specify your distro and version, etc, with this sort of system admin question.)

    Running Pg via pg_ctl as shown above should work, assuming the original database was from Pg 8.4 and so are the binaries you’re trying to use to start it. Perhaps you forgot to stop the instance of PostgreSQL automatically started by the distro? Or connected on the wrong port, so you got the distro’s default instance instead of your DB on another port (or different unix socket path, for unix sockets)?

    Personally I wouldn’t do what you’re doing anyway. First, before I did anything else, I’d make a full backup of the entire data directory because you clearly don’t have good backups, otherwise you wouldn’t be worrying about this. Take them now, because if you break something while restoring you’re going to hate yourself. As demonstrated by this fault, trusting Amazon’s storage (snapshot or otherwise) probably isn’t good enough.

    Once you’ve done that: The easiest way to restore your DB will be to, on a new instance you know you don’t have any important data on that has the same major version (eg “8.4” or “9.0”) of postgresql as your original instance did installed:

    /etc/init.d/postgresql-8.4 stop 
    datadir=/var/lib/postgresql/8.4/main
    rm -rf "$datadir"
    cp -aR /<mount_dir>/etc/postgresql/8.4/main/ "$datadir"
    chown -R postgres:postgres "$datadir"
    /etc/init.d/postgresql-8.4 start
    

    In other words: take a copy, fix the permissions, start the DB.

    You might need to edit /etc/postgresql/8.4/main/postgresql.conf and/or /etc/postgresql/8.4/main/pg_hba.conf because any edits you made to the originals aren’t there anymore; they’re on your corrupted root FS. The postgresql.conf and pg_hba.conf in the datadir are just symlinks to the ones in etc under Debian – something I understand the rationale behind, but don’t love.

    Once you get it running, do an immediate pg_dumpall and/or just a pg_dump of your important DB, then copy it somewhere safe.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed a web application that uses a web server and database hosted
I have created an Amazon EC2 Instance that provides Windows Server 2008 with SQL
I have setup a mysql database on a linux server on Amazon's EC2. This
My EC2 (Windows Server) instance was accessible through RDP logging in as Administrator and
I set up an ec2 instance. In the security group, I opened up SSH
I am running a EC2 small instance as my production server. It has 1.7G
I'm confused about the problem and not sure if I can provide enough details.
I have an EC2 instance running IIS7 + 2008 R2 SQL database on an
I am using AWS EC2 to create a back end for my website. I
How can I see/access Liferay Database? I want to see all the tables its

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.