0

On my Debian 8.4 system, I would like to run a postgres database. The data should reside on an NFS mounted folder.

# cat /etc/fstab
xxx.xxx.xxx.xxx:/volume1/srvPostgres on /var/lib/postgresql type nfs (rw,relatime,vers=3,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=xxx.xxx.xxx.xxx,mountvers=3,mountport=892,mountproto=udp,local_lock=none,addr=xxx.xxx.xxx.xxx)

I installed postgres using apt-get, therefore it creates a user. The destination folder has the correct ownership:

# ls -la /var/lib/postgresql/
total 12
drwxrwxrwx  3 postgres postgres 4096 May  2 12:12 .
drwxr-xr-x 44 root     root     4096 May  2 10:14 ..
drwxrwxrwx  3 postgres postgres 4096 May  2 12:12 9.4

Somehow, postgres is not allowed to write into the folder:

# su postgres
bash: /var/lib/postgresql/.bashrc: Permission denied

postgres$ touch /var/lib/postgresql/test
touch: cannot touch ‘/var/lib/postgresql/test’: Permission denied

What can I do to troubleshoot this issue? And what is the correct way (if even supported) to have postgres' data on an NFS share?

Atmocreations
  • 179
  • 3
  • 10

0 Answers0