Re: Differing data directories

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Ron Watkins <rwatki(at)gmail(dot)com>, pgsql-novice(at)postgresql(dot)org
Subject: Re: Differing data directories
Date: 2018-02-23 07:22:29
Message-ID: 1519370549.2530.6.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Ron Watkins wrote:
> I have a postgresql server setup/installed (finally).
> Currently, it’s installed data directory is: /var/lib/pgsql/10/data
> However, I need to put a database into a custom filesystem.
> Is it possible to have multiple PGDATA directories, and if so, how?
>
> Currently, the postgres database is under /var/lib/pgsql/10/data,
> but I need my main database to be in a different filesystem…

One simple solution would be:

# systemctl stop postgresql-10 # or whatever it takes to stop the server
# mv /var/lib/pgsql/10/data /your/mountpoint
# ln -s /your/mountpoint/data /var/lib/pgsql/10/data

Then you have to make sure that the operating system user has
permissions to enter the mount point.

Start your server and you are done.

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Ron Watkins 2018-02-23 16:51:25 Slowly making progress
Previous Message Laurenz Albe 2018-02-23 07:18:52 Re: New DB cluster.