Re: initdb when data/ folder has mount points

From: David Steele <david(at)pgmasters(dot)net>
To: Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: initdb when data/ folder has mount points
Date: 2018-02-22 00:56:38
Message-ID: cf80b0f7-b845-ce9c-b2d6-63ebbb979455@pgmasters.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2/21/18 7:01 PM, Tom Lane wrote:
> Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)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.

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(at)pgmasters(dot)net

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tomas Vondra 2018-02-22 02:49:45 Re: Not sure if I should CREATE INDEX for text columns on which I plan to filter later
Previous Message Lucas Fairchild-Madar 2018-02-22 00:53:15 Re: Understanding query planner cpu usage