From ron.l.johnson@cox.net Wed Feb 21 22:38:53 2018 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 1eod2Z-0005Px-3s for pgsql-general@arkaria.postgresql.org; Wed, 21 Feb 2018 22:39:07 +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 1eod2Y-0003I3-8d for pgsql-general@arkaria.postgresql.org; Wed, 21 Feb 2018 22:39:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eod2Y-0003Hu-11 for pgsql-general@lists.postgresql.org; Wed, 21 Feb 2018 22:39:06 +0000 Received: from eastrmfepo203.cox.net ([68.230.241.218]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eod2U-00072I-4d for pgsql-general@lists.postgresql.org; Wed, 21 Feb 2018 22:39:05 +0000 Received: from eastrmimpo210.cox.net ([68.230.241.225]) by eastrmfepo203.cox.net (InterMail vM.8.01.05.28 201-2260-151-171-20160122) with ESMTP id <20180221223854.DXCU4081.eastrmfepo203.cox.net@eastrmimpo210.cox.net> for ; Wed, 21 Feb 2018 17:38:54 -0500 Received: from [192.168.1.10] ([70.171.109.83]) by eastrmimpo210.cox.net with cox id Daet1x00X1o04Vy01aeu2R; Wed, 21 Feb 2018 17:38:54 -0500 X-CT-Class: Clean X-CT-Score: 0.00 X-CT-RefID: str=0001.0A020202.5A8DF4FE.018E,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 X-CT-Spam: 0 X-Authority-Analysis: v=2.2 cv=DsQmwC3+ c=1 sm=1 tr=0 a=uCHdjGDeLqaieW9t8IbZ6A==:117 a=uCHdjGDeLqaieW9t8IbZ6A==:17 a=x7bEGLp0ZPQA:10 a=T11QR6bd6vIA:10 a=r77TgQKjGQsHNAKrUKIA:9 a=M871_En7cueZZhvhRpQA:9 a=QEXdDO2ut3YA:10 a=Hv5T7MbBJNTZm9cPF4QA:9 a=lKoJmdVSj6WNHIvP:21 a=_W_S_7VecoQA:10 X-CM-Score: 0.00 Authentication-Results: cox.net; auth=pass (PLAIN) smtp.auth=ron.l.johnson@cox.net To: "pgsql-general@lists.postgresql.org" From: Ron Johnson Subject: initdb when data/ folder has mount points Message-ID: <3eb5e598-e31d-83dd-e3f3-b1ca8c03117d@cox.net> Date: Wed, 21 Feb 2018 16:38:53 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------CCBBCF527DF01A025246780D" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------CCBBCF527DF01A025246780D Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Hi, v9.6.6 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 They are all empty.  How do I convince it to ignore the fact that the directories exist? Thanks -- Money Angular momentum makes the world go 'round. --------------CCBBCF527DF01A025246780D Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit Hi,

v9.6.6

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

They are all empty.  How do I convince it to ignore the fact that the directories exist?

Thanks

--
Money Angular momentum makes the world go 'round.
--------------CCBBCF527DF01A025246780D-- From rshepard@appl-ecosys.com Wed Feb 21 23:17:12 2018 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 1eoddc-0007SN-PA for pgsql-general@arkaria.postgresql.org; Wed, 21 Feb 2018 23:17:24 +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 1eodda-0002qR-B3 for pgsql-general@arkaria.postgresql.org; Wed, 21 Feb 2018 23:17:22 +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 1eodda-0002q9-0K for pgsql-general@lists.postgresql.org; Wed, 21 Feb 2018 23:17:22 +0000 Received: from mail.appl-ecosys.com ([50.126.108.78]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eoddT-0006sh-8V for pgsql-general@lists.postgresql.org; Wed, 21 Feb 2018 23:17:20 +0000 Received: from salmo.appl-ecosys.com (salmo.appl-ecosys.com [192.168.55.1]) by mail.appl-ecosys.com (Postfix) with ESMTP id 84D6F9926E for ; Wed, 21 Feb 2018 15:17:12 -0800 (PST) Date: Wed, 21 Feb 2018 15:17:12 -0800 (PST) From: Rich Shepard To: "pgsql-general@lists.postgresql.org" Subject: Re: initdb when data/ folder has mount points In-Reply-To: <3eb5e598-e31d-83dd-e3f3-b1ca8c03117d@cox.net> Message-ID: References: <3eb5e598-e31d-83dd-e3f3-b1ca8c03117d@cox.net> User-Agent: Alpine 2.20 (LNX 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, 21 Feb 2018, Ron Johnson wrote: > 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 Ron, What command do you use? Here, on Slackware-14.2, /var/lib/psql/10.2/data/ contains: PG_VERSION pg_ident.conf pg_snapshots pg_wal base pg_logical pg_stat pg_xact global pg_multixact pg_stat_tmp postgresql.auto.conf pg_commit_ts pg_notify pg_subtrans postgresql.conf pg_dynshmem pg_replslot pg_tblspc postmaster.opts pg_hba.conf pg_serial pg_twophase postmaster.pid The 9.6 version was the same. The command I use (as user postgres) is: initdb -D /var/lib/pgsql/10.2/data & HTH, Rich From tgl@sss.pgh.pa.us Thu Feb 22 00:01:24 2018 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 1eoeKO-0001Tb-DS for pgsql-general@arkaria.postgresql.org; Thu, 22 Feb 2018 00:01:36 +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 1eoeKN-0005Bv-8F for pgsql-general@arkaria.postgresql.org; Thu, 22 Feb 2018 00:01:35 +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 1eoeKM-0005Bm-Th for pgsql-general@lists.postgresql.org; Thu, 22 Feb 2018 00:01:35 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eoeKG-0007nV-AV for pgsql-general@lists.postgresql.org; Thu, 22 Feb 2018 00:01:33 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w1M01Okt002763; Wed, 21 Feb 2018 19:01:24 -0500 From: Tom Lane To: Ron Johnson cc: "pgsql-general@lists.postgresql.org" Subject: Re: initdb when data/ folder has mount points In-reply-to: <3eb5e598-e31d-83dd-e3f3-b1ca8c03117d@cox.net> References: <3eb5e598-e31d-83dd-e3f3-b1ca8c03117d@cox.net> Comments: In-reply-to Ron Johnson message dated "Wed, 21 Feb 2018 16:38:53 -0600" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2761.1519257684.1@sss.pgh.pa.us> Date: Wed, 21 Feb 2018 19:01:24 -0500 Message-ID: <2762.1519257684@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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. 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. 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. 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. 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. regards, tom lane From ron.l.johnson@cox.net Thu Feb 22 00:18:15 2018 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 1eoeak-0002H6-1W for pgsql-general@arkaria.postgresql.org; Thu, 22 Feb 2018 00:18:30 +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 1eoeai-00069i-GN for pgsql-general@arkaria.postgresql.org; Thu, 22 Feb 2018 00:18:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eoeai-00069Y-8j for pgsql-general@lists.postgresql.org; Thu, 22 Feb 2018 00:18:28 +0000 Received: from eastrmfepo101.cox.net ([68.230.241.213]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eoeaa-0000mD-JP for pgsql-general@lists.postgresql.org; Thu, 22 Feb 2018 00:18:27 +0000 Received: from eastrmimpo109.cox.net ([68.230.241.222]) by eastrmfepo101.cox.net (InterMail vM.8.01.05.28 201-2260-151-171-20160122) with ESMTP id <20180222001816.BZUE3602.eastrmfepo101.cox.net@eastrmimpo109.cox.net> for ; Wed, 21 Feb 2018 19:18:16 -0500 Received: from [192.168.1.10] ([70.171.109.83]) by eastrmimpo109.cox.net with cox id DcJF1x00R1o04Vy01cJFW7; Wed, 21 Feb 2018 19:18:15 -0500 X-Authority-Analysis: v=2.2 cv=dbrw5Tfe c=1 sm=1 tr=0 a=uCHdjGDeLqaieW9t8IbZ6A==:117 a=uCHdjGDeLqaieW9t8IbZ6A==:17 a=x7bEGLp0ZPQA:10 a=T11QR6bd6vIA:10 a=r77TgQKjGQsHNAKrUKIA:9 a=kviXuzpPAAAA:8 a=faUB3OYjejURK2hWbV0A:9 a=QEXdDO2ut3YA:10 a=TXxcGZke5hWXdH8ZtgwA:9 a=vaBdYb3uLK-gnPKB:21 a=_W_S_7VecoQA:10 a=qrIFiuKZe2vaD64auk6j:22 X-CM-Score: 0.00 Authentication-Results: cox.net; auth=pass (PLAIN) smtp.auth=ron.l.johnson@cox.net Subject: Re: initdb when data/ folder has mount points To: pgsql-general@lists.postgresql.org References: <3eb5e598-e31d-83dd-e3f3-b1ca8c03117d@cox.net> From: Ron Johnson Message-ID: <7e242a07-5d25-b669-f69e-349dd8ce50b2@cox.net> Date: Wed, 21 Feb 2018 18:18:15 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------5C36D5D12CE466C42D46DD06" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------5C36D5D12CE466C42D46DD06 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 02/21/2018 06: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. > > 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. > > 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. > > 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. > > 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. I'm replicating the structure in our existing systems.  Is there an (up to date) Best Practices document for these kinds of issues? -- Money Angular momentum makes the world go 'round. --------------5C36D5D12CE466C42D46DD06 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
On 02/21/2018 06:01 PM, Tom Lane wrote:
Ron Johnson <ron.l.johnson@cox.net> 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.

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.

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.

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.

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.

I'm replicating the structure in our existing systems.  Is there an (up to date) Best Practices document for these kinds of issues?


--
Money Angular momentum makes the world go 'round.
--------------5C36D5D12CE466C42D46DD06-- From tgl@sss.pgh.pa.us Thu Feb 22 00:47:16 2018 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 1eof2l-0003ne-4B for pgsql-general@arkaria.postgresql.org; Thu, 22 Feb 2018 00:47:27 +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 1eof2j-0004aa-CP for pgsql-general@arkaria.postgresql.org; Thu, 22 Feb 2018 00:47:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eof2j-0004aR-4n for pgsql-general@lists.postgresql.org; Thu, 22 Feb 2018 00:47:25 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eof2f-0001Nx-Dy for pgsql-general@lists.postgresql.org; Thu, 22 Feb 2018 00:47:24 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w1M0lGWU005670; Wed, 21 Feb 2018 19:47:16 -0500 From: Tom Lane To: Ron Johnson cc: pgsql-general@lists.postgresql.org Subject: Re: initdb when data/ folder has mount points In-reply-to: <7e242a07-5d25-b669-f69e-349dd8ce50b2@cox.net> References: <3eb5e598-e31d-83dd-e3f3-b1ca8c03117d@cox.net> <7e242a07-5d25-b669-f69e-349dd8ce50b2@cox.net> Comments: In-reply-to Ron Johnson message dated "Wed, 21 Feb 2018 18:18:15 -0600" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <5667.1519260436.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Wed, 21 Feb 2018 19:47:16 -0500 Message-ID: <5668.1519260436@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Ron Johnson writes: > On 02/21/2018 06: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. > I'm replicating the structure in our existing systems.  Is there an (up to > date) Best Practices document for these kinds of issues? Well, initdb has never allowed a non-empty target (at least not in this century). So your existing setup must have been achieved by manual hacking post-initdb, which you could certainly do again if you're dead set on that layout. I remain of the opinion that it's not a good design, though. regards, tom lane From david@pgmasters.net Thu Feb 22 00:56:38 2018 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 From michael@paquier.xyz Thu Feb 22 06:16:39 2018 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 1eokBZ-00049m-V7 for pgsql-general@arkaria.postgresql.org; Thu, 22 Feb 2018 06:16:54 +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 1eokBY-000206-Bf for pgsql-general@arkaria.postgresql.org; Thu, 22 Feb 2018 06:16:52 +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 1eokBY-0001zw-0j for pgsql-general@lists.postgresql.org; Thu, 22 Feb 2018 06:16:52 +0000 Received: from new1-smtp.messagingengine.com ([66.111.4.221]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eokBR-0007GW-HP for pgsql-general@lists.postgresql.org; Thu, 22 Feb 2018 06:16:50 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 9F18A1C3; Thu, 22 Feb 2018 01:16:44 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Thu, 22 Feb 2018 01:16:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=RbjFPD0CnpUfPwOtIWzlU7adURI85EH+vCoLjOXDUfk=; b=0X5Z5Lum 0MXAlLC5+lORwvTV2h+h8TLYJECg/r5BkH2IsAVqqx7N36eKpjQO8xYz4jrciGZG 8f2N6agHeUjvniaSmhQT3H1PMgJ1+cdsXWlgGOVK1L8lCLYSO0UBEpY2QcP3X16G ibIwd8yYKpnb6zKKNnrkTznX1cPAHxqWHdr8gbjs6lzelgSWmfSgLio3fOvdXwfo bOkq4eve641iaDPdZ1DYPoAZtSlenT+SszdjXq4xe0l5VecQwPR6HnxBO7wnMuyU W1U36kyBJGEYYUyqs7iCHXZPqIdiuQSvmrWtwsNJrAJKi27RMgN72ldSirXg7Nn7 oqkfTFOxoeL9/g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=RbjFPD0CnpUfPwOtIWzlU7adURI85 EH+vCoLjOXDUfk=; b=JZMcJGbnaGPJpEqMKzBEVyGI7rMI0+yWP/AT1XOPQfW2V eE/SkVZTjuXPzSj078sbk+dT2sGBQNlFbKX1RPUoB61arAAsPJVgygDhj+n5YjAt DySAop+U5EmuKqbVAzTKDgGQSl0WTbq50paYfYdg5k/Ss7WUU1hdIM5tncE1pCjZ jVUeklm3hd/Vjjl2MfpgAmP16IVOwhtoLdJIdvQwH/2rNkidERnLA8cfosEOvVaT yLpbLHZ5RLFL2XWQKCdoPHRJjr4VIR+44ekllAKgdi152ce9N3sG6f4da1XjStJc bhm0G2wZw17yIYr9Lr6kkEkxLonuE3Q9/c4qMpR4w== X-ME-Sender: Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp [61.215.137.162]) by mail.messagingengine.com (Postfix) with ESMTPA id EA3C27E270; Thu, 22 Feb 2018 01:16:42 -0500 (EST) Date: Thu, 22 Feb 2018 15:16:39 +0900 From: Michael Paquier To: David Steele Cc: Ron Johnson , Tom Lane , "pgsql-general@lists.postgresql.org" Subject: Re: initdb when data/ folder has mount points Message-ID: <20180222061639.GB3370@paquier.xyz> References: <3eb5e598-e31d-83dd-e3f3-b1ca8c03117d@cox.net> <2762.1519257684@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="St7VIuEGZ6dlpu13" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --St7VIuEGZ6dlpu13 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 21, 2018 at 07:56:38PM -0500, David Steele wrote: > On 2/21/18 7:01 PM, Tom Lane wrote: >> 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. >=20 > 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. log_directory in postgresql.conf san be set up with an absolute directory value. So there is no actual need for a symlink with pg_log. This also reduces the amount of data transfered as part of base backups without actually needing them.=20 -- Michael --St7VIuEGZ6dlpu13 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlqOYEcACgkQnvQgOdby QH39GhAApTGgQu8aZ6otAutCo8A3RsqNg/PNhzayACtunF8AON7FpjJ8B4tz+iXQ Yi8fIihTzcMDxESn3VkfngRI881eZnJpYYU2o3lMWd/sk9C6yBftzW2y2Fgfdsyz YfyuaZm9ANPE16SowiV90QaVMJey4WHNq2WCJB/8jF5PxSmSDw9NI54I+bnXZGsM HF+HdwSQ+LZI8PF8PBvKIGYz4hB+eg9uXgE7TKbCgcb3JxxiR4oQFLZEt+ExYw/9 04vogzGJg1sKm6/eKhpNNc21Ydid1WNLrLoXHc7miZdxMKtMxVMeRbttTVFZRCyP y/b7wJY1D93STzI3BJIEk+sN23dbay+1mDE5Xi0eUca5euLSbN2GVdBwfJwsvBbz rQpQm6N4oo1FwzOaVzbt4OF3mJDnP1vbu9HTe2U7yXhAXXxrOSy1ei5J96PEHANb uza9SbsPcJNu9r4Mn6GDLxJjYBPR4qNOOrTCzA+yl/yLOMvQcq+lM+gyxjKuW7Bl eYR78oguPU3BVUV//qhnFK6l4hV8IczQbCez/3lrbQFGIvssjLcoybBjdJxGVHAv txSTeP1g9O1wPO33Kf/ljdxWEaK2Ohz+nYpqvUonPE5gYpcrRxeaLIY6POvLGkAc LmYBKqn6odfWqRM7wlxCC4HqkEgkQdGFhm0RldzfjoqumeQlLKY= =+GcN -----END PGP SIGNATURE----- --St7VIuEGZ6dlpu13-- From david@pgmasters.net Thu Feb 22 13:22:04 2018 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 1eoqpD-0003UT-Mu for pgsql-general@arkaria.postgresql.org; Thu, 22 Feb 2018 13:22:15 +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 1eoqpC-0002b7-Px for pgsql-general@arkaria.postgresql.org; Thu, 22 Feb 2018 13:22:14 +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 1eoqpC-0002ax-F2 for pgsql-general@lists.postgresql.org; Thu, 22 Feb 2018 13:22:14 +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 1eoqp5-0007q0-7x for pgsql-general@lists.postgresql.org; Thu, 22 Feb 2018 13:22:13 +0000 Received: from Davids-iMac.local (unknown [173.169.74.224]) (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 0191854668; Thu, 22 Feb 2018 13:22:05 +0000 (UTC) Subject: Re: initdb when data/ folder has mount points To: Michael Paquier Cc: Ron Johnson , Tom Lane , "pgsql-general@lists.postgresql.org" References: <3eb5e598-e31d-83dd-e3f3-b1ca8c03117d@cox.net> <2762.1519257684@sss.pgh.pa.us> <20180222061639.GB3370@paquier.xyz> From: David Steele Message-ID: <3736b74f-1ff8-41b8-675d-7913cef23894@pgmasters.net> Date: Thu, 22 Feb 2018 08:22:04 -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: <20180222061639.GB3370@paquier.xyz> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="HnKMx6yWI299z1w3cBHQz5FKF9THxwjWZ" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --HnKMx6yWI299z1w3cBHQz5FKF9THxwjWZ Content-Type: multipart/mixed; boundary="sDlXmfHyYCUC0kL8oQ00MKomwrMd7YCOy"; protected-headers="v1" From: David Steele To: Michael Paquier Cc: Ron Johnson , Tom Lane , "pgsql-general@lists.postgresql.org" Message-ID: <3736b74f-1ff8-41b8-675d-7913cef23894@pgmasters.net> Subject: Re: initdb when data/ folder has mount points References: <3eb5e598-e31d-83dd-e3f3-b1ca8c03117d@cox.net> <2762.1519257684@sss.pgh.pa.us> <20180222061639.GB3370@paquier.xyz> In-Reply-To: <20180222061639.GB3370@paquier.xyz> --sDlXmfHyYCUC0kL8oQ00MKomwrMd7YCOy Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2/22/18 1:16 AM, Michael Paquier wrote: > On Wed, Feb 21, 2018 at 07:56:38PM -0500, David Steele wrote: >> On 2/21/18 7:01 PM, Tom Lane wrote: >>> 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 somebo= dy >> starts reading them. >=20 > log_directory in postgresql.conf san be set up with an absolute > directory value. So there is no actual need for a symlink with pg_log.= > This also reduces the amount of data transfered as part of base > backups without actually needing them.=20 Yes, I really should have said having pg_log in the data directory at all is not ideal, symlinked or no. --=20 -David david@pgmasters.net --sDlXmfHyYCUC0kL8oQ00MKomwrMd7YCOy-- --HnKMx6yWI299z1w3cBHQz5FKF9THxwjWZ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIzBAEBCgAdFiEEDkRHqfbjxwCMp7jigDa4glDlIUAFAlqOw/0ACgkQgDa4glDl IUCRng//T4ghzG99pABelUtKRJY7wg9CfveUSh41piR9LGYbMh2XLOOSQUrlzGXW 9ClXzt4qqQ+/2YZ7+Klr0w6MRPNKEE6xUzJ9ttzBFbqfzdNTRCZH4pzou/d4AEBD SX+UJDgytQmPer7sIeIncfQFgZejieEVmCts6W8196ogEKYki6dzyhOyfAi/c6Mt TNbqhu0Ty7eKA0DxO5Xy7Rjztut31I0saArVnYdP5Pzym753WGu0GTBrvGT/dgky /5r1/oUJhGT7prts38Sux3UErWaaVWIE5BNHc6zyp9R/S3KKDDOL0VScj5kDp6k7 TmiVood6VtqncWndYW+0G79D4LLNrW8RQ9+zeXCeqvtRcFG/75VMc5CL3oEjWnrI 6BFh8PM64/dv8+OGu2SIEJ7tLdsL5c10fXnWEKZYhcI5cDiWKX0gtTG3Vo7Q8bL+ zVuCv7Ak8VfU2/tEuVCHnnTUUcCyc6nzYYX23ab+WjHQjqAd+Mx5chHYLkkaSm3X JL8uQiw+h/CdHS0B9qyEjkFgF89apnhinXtmk5jxw1l7TefoSlWIKc/IRLnNFoPf 37HqDW9V8icpLPlscVZtzBBHl4hmRAP1HIPnl6x2cW9pQIAMN5g+yZ9dJy29J9wQ Q8OXEodg/4v3Pjc0pZ25CpSRKX/DcTdh3uANIZrhtzNAuHH931Q= =1VNj -----END PGP SIGNATURE----- --HnKMx6yWI299z1w3cBHQz5FKF9THxwjWZ-- From ron.l.johnson@cox.net Thu Feb 22 14:21:04 2018 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 1eorkQ-0006dY-W3 for pgsql-general@arkaria.postgresql.org; Thu, 22 Feb 2018 14:21:23 +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 1eorkP-0004H6-S6 for pgsql-general@arkaria.postgresql.org; Thu, 22 Feb 2018 14:21:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eorkP-0004Gr-Kd for pgsql-general@lists.postgresql.org; Thu, 22 Feb 2018 14:21:21 +0000 Received: from eastrmfepo103.cox.net ([68.230.241.215]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eorkF-0001vy-Dl for pgsql-general@lists.postgresql.org; Thu, 22 Feb 2018 14:21:19 +0000 Received: from eastrmimpo110.cox.net ([68.230.241.223]) by eastrmfepo103.cox.net (InterMail vM.8.01.05.28 201-2260-151-171-20160122) with ESMTP id <20180222142105.VXTH4084.eastrmfepo103.cox.net@eastrmimpo110.cox.net> for ; Thu, 22 Feb 2018 09:21:05 -0500 Received: from [192.168.1.10] ([70.171.109.83]) by eastrmimpo110.cox.net with cox id DqM41x00t1o04Vy01qM4Ux; Thu, 22 Feb 2018 09:21:04 -0500 X-CT-Class: Clean X-CT-Score: 0.00 X-CT-RefID: str=0001.0A020204.5A8ED1D0.021E,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 X-CT-Spam: 0 X-Authority-Analysis: v=2.2 cv=HL2zLslv c=1 sm=1 tr=0 a=uCHdjGDeLqaieW9t8IbZ6A==:117 a=uCHdjGDeLqaieW9t8IbZ6A==:17 a=x7bEGLp0ZPQA:10 a=T11QR6bd6vIA:10 a=r77TgQKjGQsHNAKrUKIA:9 a=epTmVMiNAAAA:8 a=1_W9oknN61KrZwBbejcA:9 a=QEXdDO2ut3YA:10 a=1wDIiH70AAAA:8 a=k6UuhfNk4PmRd5Vymg4A:9 a=XBN-osjeakysMq1a:21 a=_W_S_7VecoQA:10 a=ndEWmUVY6Yapc0oHF_P4:22 a=uCsh6WI2SJRHIg0NT2Eg:22 X-CM-Score: 0.00 Authentication-Results: cox.net; auth=pass (PLAIN) smtp.auth=ron.l.johnson@cox.net Subject: Re: initdb when data/ folder has mount points To: pgsql-general@lists.postgresql.org References: <3eb5e598-e31d-83dd-e3f3-b1ca8c03117d@cox.net> <2762.1519257684@sss.pgh.pa.us> <20180222061639.GB3370@paquier.xyz> From: Ron Johnson Message-ID: <40496a1d-3b3e-e36e-48fc-9122a1610a52@cox.net> Date: Thu, 22 Feb 2018 08:21:04 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------1BC5BDCDD2BED7C6941C2543" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------1BC5BDCDD2BED7C6941C2543 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 02/22/2018 07:22 AM, David Steele wrote: > On 2/22/18 1:16 AM, Michael Paquier wrote: >> On Wed, Feb 21, 2018 at 07:56:38PM -0500, David Steele wrote: >>> On 2/21/18 7:01 PM, Tom Lane wrote: >>>> 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. >> log_directory in postgresql.conf san be set up with an absolute >> directory value. So there is no actual need for a symlink with pg_log. >> This also reduces the amount of data transfered as part of base >> backups without actually needing them. > Yes, I really should have said having pg_log in the data directory at > all is not ideal, symlinked or no. Is there a Best Practices wiki? (https://wiki.postgresql.org/wiki/Detailed_installation_guides is pretty old and thin.) -- Money Angular momentum makes the world go 'round. --------------1BC5BDCDD2BED7C6941C2543 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
On 02/22/2018 07:22 AM, David Steele wrote:
On 2/22/18 1:16 AM, Michael Paquier wrote:
On Wed, Feb 21, 2018 at 07:56:38PM -0500, David Steele wrote:
On 2/21/18 7:01 PM, Tom Lane wrote:
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.
log_directory in postgresql.conf san be set up with an absolute
directory value.  So there is no actual need for a symlink with pg_log.
This also reduces the amount of data transfered as part of base
backups without actually needing them. 
Yes, I really should have said having pg_log in the data directory at
all is not ideal, symlinked or no.

Is there a Best Practices wiki?  (https://wiki.postgresql.org/wiki/Detailed_installation_guides is pretty old and thin.)


--
Money Angular momentum makes the world go 'round.
--------------1BC5BDCDD2BED7C6941C2543--