title: postgres cannot create cluster as root?
body: <p>So I'm having trouble creating a data cluster in postgresql on an external drive with <code>pg_createcluster</code>. I'm on Ubuntu 16.04 and my user has <code>rwx</code> right on this folder, but still I got a permission error.</p>
  
  <p>Here is the command I ran:</p>
  
  <pre><code>yuqiong@yuqiong-G7-7588:/media/yuqiong/DATA$ sudo pg_createcluster -u yuqiong -d /media/yuqiong/DATA/postgresdb --start 11 3dcitydb
  
  Creating new PostgreSQL cluster 11/3dcitydb ...
  /usr/lib/postgresql/11/bin/initdb -D /media/yuqiong/DATA/postgresdb --auth-local peer --auth-host md5
  The files belonging to this database system will be owned by user "yuqiong".
  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 /media/yuqiong/DATA/postgresdb ... ok
  creating subdirectories ... ok
  selecting default max_connections ... 20
  selecting default shared_buffers ... 400kB
  selecting dynamic shared memory implementation ... posix
  creating configuration files ... ok
  running bootstrap script ... 2018-12-28 12:02:56.494 EST [405] FATAL:  data directory "/media/yuqiong/DATA/postgresdb" has invalid permissions
  2018-12-28 12:02:56.494 EST [405] 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 "/media/yuqiong/DATA/postgresdb"
  Error: initdb failed
  </code></pre>
  
  <p>Here is my permission on that folder:</p>
  
  <pre><code>yuqiong@yuqiong-G7-7588:/media/yuqiong/DATA$ ll | grep postgresdb
  drwxrwxrwx  1 yuqiong yuqiong      48 Dec 28 12:02 postgresdb/
  </code></pre>
  
  <p>I also tried <code>sudo chmod  0700 -R /media/yuqiong/DATA/postgresdb</code>, but this does not work either.</p>
  
  <p>A caveat is my laptop has dual system of Windows and Ubuntu. This is originally a Windows laptop so the file system partition is <code>fuseblk</code> on this disk. Will this be a problem?</p>
  
  <p>Another possibility is I read on the documentation that a cluster cannot be owned by <code>root</code>, but I'm not <code>root</code>? Also this does not seem to be what the error message suggests...</p>
  
  <p>Thanks!</p>