2

I'm at a bit of a loss here.

I'm running a PostgreSQL Database on Docker on my Mac.

df -h shows that my root volume has 236 GB available.

docker system df shows that only a few gigs are being used by images and volumes My Docker VM is running on the root volume under ~/Library/Containers/com.docker.d with 104 GB allocated to the VM (according to Docker Desktop resource settings).

Inside the image, df -h shows 92 Gigs available. df -h /var/lib/postgresql/data shows the same 92 Gigs available.

docker inspect {image} | grep Source shows that on my Mac, the volume writes to /var/lib/docker/volumes/{container}/_data, which according to df -h appears to be on my root partition, the one with 236 Gigs available.

Despite all this, when I attempt to load a large (but still under 5GB) dataset into the database, I get:

psycopg2.errors.DiskFull: could not extend file "base/16385/16452": No space left on device

I am loading the data in batches through a database transaction.

SELECT * FROM pg_tablespace shows that there are only the default and global tablespace.

I am able to write a large (20 GB) file into the data directory via shell script. I'm beginning to think the issue is with the postgres image.

The PostgreSQL version is: PostgreSQL 17.5 (Debian 17.5-1.pgdg120+1) on aarch64-unknown-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit

Why would I be getting a disk full error?

2
  • This error usually happens because Docker's internal storage runs out of space, even if your computer has enough. By default, Docker saves everything inside the container. To fix it, you need to attach a volume or folder from your computer to the container. That way, PostgreSQL can use your real disk space. Once you do that, the error should go away and your data will save correctly. Commented May 26 at 3:36
  • My container has an attached, persistant volume already. From my understanding the volume should be able to grow as large as the disk space available to the docker vm. Commented May 28 at 14:40

1 Answer 1

0

Docker’s internal storage limits, not your Mac’s available disk space.

  1. Increase the Docker VM disk size in Docker Desktop settings.

  2. Prune unused volumes: docker volume prune.

Sign up to request clarification or add additional context in comments.

1 Comment

Per my initial description I've already checked the VM disk size and i don't have any additional volumes to prune.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.