我正在研究centos 6.2版本。我想用加密文件系统配置postgres。 我使用LUKS在centos上创建了一个加密分区。现在我想用这个挂载的分区初始化数据库集群。但我得到以下错误。
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".
答案 0 :(得分:1)
您指定PGDATA
为/mnt/cryptofs/data/
,而initdb
则抱怨/root/dimple/encryption
,这让我想到:
/mnt/cryptofs/data/
实际上是一个符号链接; /root/dimple/encryption
目录的正确权限; /mnt/cryptofs/data/
中有一些文件。确保它完全为空,没有隐藏文件,也没有lost+found
目录。很高兴看到/mnt/cryptofs/data/
是什么以及权限是什么。