-1

I have been struggling to setup a Postgres database on my external SSD. The goal is to store a database larger than my internal storage on the external SSD.

Postgres is successfully installed locally on an old Mac machine I am running. When I go to initialize a database on my external volume I am getting a permission error and I am not sure why. I have posted the error and the permissions of the directory below.

Furthermore, I have tried to change the permissions of the directory on the external drive with no success. Any and all help would be appreciated!

The files belonging to this database system will be owned by user "xxx".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /Volumes/archive/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 20
selecting default shared_buffers ... 400kB
selecting default time zone ... xxx/xxx
creating configuration files ... ok
running bootstrap script ... xxx [xxx] FATAL:  data directory "/Volumes/archive/data" has invalid permissions
xxx [xxx] DETAIL:  Permissions should be u=rwx (0700) or u=rwx,g=rx (0750).
child process exited with exit code 1
initdb: removing contents of data directory "/Volumes/archive/data"

Current permissions

drwxrwxrwx  1 user  staff  123456 Apr 2 11:00 data

New contributor
algorandy is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
2
  • 1
    You'll have to either change the permissions or remove the directory and let PostgreSQL create it during initdb. So this is not a database problem, but an operating system problem. – Laurenz Albe 2 days ago
  • The error message looks pretty self-explanatory: "Permissions should be u=rwx (0700) or u=rwx,g=rx (0750)" – mustaccio 2 days ago
0

It seems like however your drive is mounted, it ignores attempts to change permissions. You can try to manually change the permissions with chmod 0700 /Volumes/archive/data and see if the permissions have actually been changed or not (if it worked, they would change to drwx------)

If it doesn't let you change permission, you would need to fix the mount options, or maybe format the drive into a different file system.

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