0

我正在开发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".
4

1 回答 1

1

您指定PGDATA为 be /mnt/cryptofs/data/,而initdb抱怨 bout /root/dimple/encryption,这让我认为:

  • /mnt/cryptofs/data/实际上是一个符号链接;
  • /root/dimple/encryption您对该目录没有适当的权限;
  • 里面有一些文件/mnt/cryptofs/data/。确保它完全是空的,没有隐藏文件,也没有lost+found目录。

最好看看什么是/mnt/cryptofs/data/权限以及权限是什么。

于 2013-01-30T07:53:42.567 回答