Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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 with

chmod -R 777 /media/$USER

Then this created permissions for the other group to see the directory. This fixed the issue.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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