Hello lad
Hello lad

Reputation: 18790

ERROR: could not create directory "base/16386": No space left on device

I receive the same error when I try to create a database with

CREATE DATABASE dwh;

and

createdb dwh;

namely:

createdb: database creation failed: ERROR:  could not create directory "base/16385": No space left on device

and

ERROR:  could not create directory "base/16386": No space left on device

I am using a postgres AMI on aws (PostgreSQL/Ubuntu provided by OpenLogic)https://aws.amazon.com/marketplace/ordering/ref=dtl_psb_continue?ie=UTF8&productId=13692aed-193f-4384-91ce-c9260eeca63d&region=eu-west-1

provisioned with m2.xlarge machine, which should have 17GB RAM and 350GB SSD

Upvotes: 1

Views: 11388

Answers (1)

Dzmitry Savinkou
Dzmitry Savinkou

Reputation: 5190

Based on the description provided, you have not mapped your Postgres /data directory to your actual 350GB partition.

If you are running production server, 1st of all - try to clean up the logs (/pg_log folder) to save disk space and bring up the box to normal operation AND create backup of your database.

Run df -h to see disk devices utilization and lsblk what is mounted to your disk. It highly likely, that AWS by default gave you not extended 350GB volume. You have 2 options:

  • Add new disk take a look at Ubuntu add new drive procedure and map it to your Postgres /data folder
  • Try to do perform resize of the existing file system with resize2fs, relevant answer can be found at AskUbuntu

Upvotes: 5

Related Questions