There is a VMware machine at work running CentOS 6.7. It uses Postgres 9.2. All I wanted is to start postgres service. This is probably related to it but I don't know what to do: https://kb.vmware.com/s/article/2111236. Note that I don't know what people did to it back in the time.

service postgresql-9.2 start

It keeps failing. I found where the logs were located at /var/lib/pgsql/9.2/pgstartup.log.


FATAL:  could not write lock file "/tmp/.s.PGSQL.5432.lock": No space left on device

Disk free information:

df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1        52G   51G     0 100% /
tmpfs           2.9G     0  2.9G   0% /dev/shm
/dev/sda3        40G  6.3G   31G  17% /var

The problem is obviously related to the lack of space but how do I solve it? Where is postgressql data located at?

  • First you defintely should solve the underlying problem - no space left on /. – guntbert Nov 6 '19 at 10:00
  • Your postgres data can be found in /var/lib/pgsql. – SYN Nov 6 '19 at 10:24
  • @gunbert that's a bug in the VM. I can't solve it. – nop Nov 6 '19 at 11:03
  • @SYN, thanks, I more likely wanted to know about dumping the database into a .bak file. – nop Nov 6 '19 at 11:03
  • I still don't understand the reason for the downvote, but however I found a workaround. It might help anyone. – nop Nov 6 '19 at 11:08

Since I cannot fix /dev/sda1's space because it's VMware bug, I succeeded in changing the /tmp folder for the lock file.


For anyone having same issue, open the file above and add the following line in the end:

unix_socket_directory = '/dev/shm'

Note that I selected a folder with enough free space

df -h

tmpfs           2.9G     0  2.9G   0% /dev/shm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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