IT/DB

[PostgreSQL] fixing permissions on existing directory /data ... initdb : colud not change permissions of directory "/data" : Opertaion not permitted

타미미 2022. 4. 4. 17:10

[상황]

initDB 실행 시 오류 발생

DB : Postgresql DB Version 10

실행 커맨드 : ./bin/initdb -E utf-8 -D /data

 

[오류 메시지]

The files belonging to this database system will be owned by user "postgres".

This user must also own the server process.

 

The database cluster will be initialized with locale "en_US.UTF-8".

The default text search configuration will be set to "english".

 

Data page checksums are disabled.

 

fixing permissions on existing directory /data ... initdb : colud not change permissions of directory "/data" : Opertaion not permitted

 

[원인]

/data 디렉터리의 owner 가 postgres 가 아님. postgres 사용자는 group 권한만 가지고 있는 상황.

 

[해결방법]

/data 디렉터리의 owner 를 postgres 계정으로 설정

chown postgres /data

반응형