Re: Documentation for initdb option --waldir

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Robert Treat <rob(at)xzilla(dot)net>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Euler Taveira <euler(at)eulerto(dot)com>, Theodor Herlo <t(dot)herlo(at)proventa(dot)de>, "pgsql-docs(at)lists(dot)postgresql(dot)org" <pgsql-docs(at)lists(dot)postgresql(dot)org>
Subject: Re: Documentation for initdb option --waldir
Date: 2025-03-29 16:26:14
Message-ID: 990b0bfa9ad2e68c517c3d5a29c48d37758877a1.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Sat, 2025-03-29 at 10:26 -0400, Robert Treat wrote:
> "Best practice is to create a directory within the mount-point
> directory that is owned by the PostgreSQL user, and then create the
> data directory within that. This avoids permissions problems,..."
>
> Which I do remember having tried to do it directly and the OS
> complaining that my mount point wasn't owned by root and/or Postgres
> complaining that the xlog dir wasn't owned by Postgres, so I think
> this advice probably still holds.

The root directory of a file system, which will be mounted at the
mount point, should be owned by root.

As far as I know, the reason is that it contains a "lost+found"
directory, which is used by file system checks to put orphaned
files. If a non-root user owned the mount point, the user could
remove that directory, which would be a bad idea.

On the other hand, PostgreSQL will protest if the directory isn't
empty...

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Gurjeet Singh 2025-03-29 17:12:19 Re: Documentation for initdb option --waldir
Previous Message Gurjeet Singh 2025-03-29 15:19:16 Re: Documentation for initdb option --waldir