Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 the postgres data directory to a separate partition and it works great. The directory is owned by postgres user and postgres group.

d-wx------ 11 postgres postgres 4.0K 2010-06-11 08:28 data/

I added myself to the group

> sudo addgroup me postgres

> groups me

me : me adm dialout cdrom plugdev lpadmin admin sambashare postgres

And gave the group read and execute permissions to everything in the directory.

sudo chmod -R g+rx ./data

d-wxr-x--- 11 postgres postgres 4.0K 2010-06-11 08:28 data/

But I still can not CD or LS the directory.

> ls data

ls: cannot open directory data: Permission denied

What beginner mistake am I making?

share|improve this question
up vote 6 down vote accepted

Log out and back in again. That will properly set your groups, which are set only on log-in.

share|improve this answer
BTW, you probably don't want to be in the postgres group anyway. You don't need to be in it to use PostgreSQL, all that does is allow you direct access to the data and config files. You probably want to use sudo to get that access in the rare time you will change config. – Michael Graff Jun 11 '10 at 15:23
Well, I was lazy and also wanted to try doing something like this. But FYI - postgres will not let you set permissions to anything other than 700 for the data directory. – Jonathan Jun 11 '10 at 17:00

Your Answer


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.