Interview Prep/Docker/Storage, volumes and disk space

Postgres: `FATAL: data directory "/var/lib/postgresql/data" has wrong ownership`

IntermediateTroubleshootingStorage, volumes and disk space
Answer

Likely causes → Host bind mount owned by another UID; permissions not 0700.

Diagnose → ls -ldn /host/pgdata; docker exec db id postgres.

Fix → chown -R 999:999 /host/pgdata; chmod 700, or use a named volume.

Prevent → Prefer named volumes for databases.

All Docker questions Roadmap: Docker & containers

More on Storage, volumes and disk space