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


Reply via email to