Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eofBl-0004HA-B4 for pgsql-general@arkaria.postgresql.org; Thu, 22 Feb 2018 00:56:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eofBk-0005EH-EC for pgsql-general@arkaria.postgresql.org; Thu, 22 Feb 2018 00:56:44 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eofBk-0005E8-2w for pgsql-general@lists.postgresql.org; Thu, 22 Feb 2018 00:56:44 +0000 Received: from mail.thelabyrinth.net ([45.56.70.56]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eofBh-0000a9-LT for pgsql-general@lists.postgresql.org; Thu, 22 Feb 2018 00:56:42 +0000 Received: from Davids-MacBook.local (unknown [69.167.43.226]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dsteele) by mail.thelabyrinth.net (Postfix) with ESMTPSA id DBC9154679; Thu, 22 Feb 2018 00:56:39 +0000 (UTC) Subject: Re: initdb when data/ folder has mount points To: Ron Johnson Cc: Tom Lane , "pgsql-general@lists.postgresql.org" References: <3eb5e598-e31d-83dd-e3f3-b1ca8c03117d@cox.net> <2762.1519257684@sss.pgh.pa.us> From: David Steele Message-ID: Date: Wed, 21 Feb 2018 19:56:38 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <2762.1519257684@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2/21/18 7:01 PM, Tom Lane wrote: > Ron Johnson writes: >> Apparently, initdb assumes that data/ is one big mount point. However, we >> have four mount points: >> /var/lib/pgsql/9.6/data/backup >> /var/lib/pgsql/9.6/data/base >> /var/lib/pgsql/9.6/data/pg_log >> /var/lib/pgsql/9.6/data/pg_xlog > > Don't do that. Agreed. > There's no reason for backup storage to be under the data directory (and > lots of good reasons for it not to be). Just put it somewhere else. Yes -- in this configuration your backups would be backed up with every backup. It's pretty obvious where that would go. > The supported way to put pg_xlog on a separate volume is to put that > mount point somewhere else, and make $PGDATA/pg_xlog be a symlink to > it. IIRC, there's an initdb option to help with that, though you can > also make it so manually after initdb. initdb supports linking pg_xlog/pg_wal with the --xlogdir/--waldir option. > For pg_log, just put it somewhere else and set the appropriate > configuration option to say where to write the postmaster log files. > Or you could use a symlink, like the solution for pg_xlog, but > I don't see any advantage there. Symlinking pg_log is not ideal because the logs end up in the backup. It gets pretty weird when those logs get restored to a standby and somebody starts reading them. > I don't see any point in making base/ be its own mount point. Once > you get rid of those other subdirectories there's not going to be > enough "global" storage left to justify its own volume. Agreed. -- -David david@pgmasters.net