0

I am working on centos 6.2 version. I want to configure postgres with an encrypted file system. I have created an encrypted partition on centos using LUKS. Now i want to initialize the db cluster with this mounted partition. but i get the below error.

bash-4.1$ initdb -D /mnt/cryptofs/data/
could not change directory to "/root/dimple/encryption"
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 database encoding has accordingly been set to UTF8.
The default text search configuration will be set to "english".

initdb: directory "/mnt/cryptofs/data" exists but is not empty
If you want to create a new database system, either remove or empty
the directory "/mnt/cryptofs/data" or run initdb
with an argument other than "/mnt/cryptofs/data".

1 Answer 1

1

You specify PGDATA to be /mnt/cryptofs/data/, while initdb complains bout /root/dimple/encryption, which makes me think that:

  • /mnt/cryptofs/data/ is actually a symlink;
  • you don't have proper permissions for the /root/dimple/encryption directory;
  • there're some files in the /mnt/cryptofs/data/. Make sure it is completely empty, no hidden files and no lost+found directory also.

It'd be good to see what is /mnt/cryptofs/data/ and what are the permissions.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.