Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an Ubuntu server running PostgreSQL and a very light weight custom web-server.

I knew this would happen but I was too busy, and now the disk has 0 bytes free. I don't need all the data in the database and I've already deleted lots of rows in some tables, but the space won't be freed until the database is "vacuumed", and to do the vacuum I need lots of free disk space.

What can I do? This is an Amazon EC2 instance.

share|improve this question
Can you paste the output of "df -k"? – MadHatter Mar 15 '11 at 12:08
@MadHatter @Split71, Sorry, I freed like 30MB by removing some compressed logs. then removed one of my table indexes which freed up like 7GB and then did a vacuum. – Ali Mar 15 '11 at 13:23
up vote 1 down vote accepted

You could create a new EBS volume, attach it to the server, copy the postgres data to it (stopping postgres first of course) and then mount it at the same location as the old data. Make the EBS volume as big as you require and then some, and then restart postgres.

share|improve this answer
this is the natural course of events but I didn't want to take the server down right now. – Ali Mar 15 '11 at 13:24
There's no need to take the server down (as such). This could all be done very quickly, with the only downtime being to copy the database to the new EBS volume and then mounting it. The time the copy job will take depends on the size I guess, but that's the only real downtime that you would have to deal with. Edit: I see you've fixed the issue so it's all good anyway! – djk Mar 15 '11 at 13:53

I second madhatter with a df -k output. Also, i'm not sure how Amazon EC2 works in these types of cases, but i'm sure more storage is an option.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.