Reputation: 18790
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®ion=eu-west-1
provisioned with m2.xlarge machine, which should have 17GB RAM and 350GB SSD
Upvotes: 1
Views: 11388
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:
/data
folderresize2fs
, relevant answer can be found at AskUbuntuUpvotes: 5