I moved my postgresql 9.3 data directory to a different drive, however, my postgres
user cannot seem to access that new drive despite my best efforts. I am running on ubuntu 14.04 LTS x64. So I created a new directory under /media/$USER/kauthama/data/psql
and set postgres:postgres as the owner. However when I try and do initdb
the directory keeps saying permission denied. Even when I do su postgres
and then try to navidate to the new directory, the autocompletion stops at /media/$USER/
and cannot find the drive kauthama.
I even added postgres
to the sudoers
group to see if that would work. The permissions on kauthama
are basically $USER
is the owner and the sudo
group owns it. So the postgres user should have all the permissions needed to navigate to the directory. Any thought on why this is not working?
Postgresql – postgres user cannot access location of new data directory
permissionspostgresql-9.3Ubuntu
Related Question
- MySQL gives me:“Can’t open and lock privilege tables: Table ‘host’ is read only”
- SSRS Permissions – User Privileges for Sending Email
- Sql-server – Creating/restoring mdf/ldf to non-default file location giving access denied
- Postgresql – Postgres 10.5: Granting full schema access to a user that isn’t the owner
- PostgreSQL Docker – How to Start Container with Initial Data from Mapped Volume
Best Answer
I figured it out. So the permissions at one level of the directory hierarchy did not have any setting for letting the
other
group read that level. Thus that blocked the postgres user from being able to see a drive mounted by any other user. Once that was changed withThen this created permissions for the
other
group to see the directory. This fixed the issue.