Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fyjoo-0004dE-Uh for pgsql-general@arkaria.postgresql.org; Sat, 08 Sep 2018 20:26:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fyjon-0006op-Cr for pgsql-general@arkaria.postgresql.org; Sat, 08 Sep 2018 20:26:57 +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.89) (envelope-from ) id 1fyjon-0006oh-2u for pgsql-general@lists.postgresql.org; Sat, 08 Sep 2018 20:26:57 +0000 Received: from mail-oi0-x241.google.com ([2607:f8b0:4003:c06::241]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fyjoj-0008W0-Al for pgsql-general@lists.postgresql.org; Sat, 08 Sep 2018 20:26:56 +0000 Received: by mail-oi0-x241.google.com with SMTP id k12-v6so33362384oiw.8 for ; Sat, 08 Sep 2018 13:26:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=UWLp36Vaqn+E3FhXRnLrxodUzRbhysEoD4nvwOI7z8s=; b=l7AuzY5e3zmmpF35lVaqtVh4W/wur/2OZv17PXHWv68pAv6C1meSFKrnsXKRZ1ui8U gxLxyd0Oa0JCgSEnkZXpma+S8XyslIIRL9KvnbVk7uvx7eOKy2C2nJ2BX3mGaH9+HlzU Bbke16lwTVfQclhaQltksgH5gk2CI8+K3IzyZE1fdvrgLhnEfFYrpcGEI9mq4F3C+9np e7fNx/lM+fyaveXXGHI+x9QjXoNvgTc9Php9xdUxniWXy/tfJXVfC3Fiw3sJD2UDaqyM LoR29YCg70ntm9PPOg2gPEkfvZ1KYo59f13dX3Vd+gNkEJCjhT/93uLonHvxnnorCHZ3 5Wcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=UWLp36Vaqn+E3FhXRnLrxodUzRbhysEoD4nvwOI7z8s=; b=tDKveb/udQp9osPsa7Ok1bM0nXcMJSIk0Muh/GRt3xlnzkshsNXMNsOxqz1A19YzQN hMxXIlb8elcT5gbD9dV8a5WzAdzBaMf6rHjrhC4zfZF+1I9nNex7zEZH5w1gH4k3Xa1M jPL/YtqpckbAwK5DgdRvPExGCMPdR3GzzadZCpstO7gLhxju/5y5iRhrSMY8lesZedXn PtU/yFyyfwazvT7EW2+62MRNv3IAm2aVALG9rVOp4LbQwcVV8fDtKc3r/9sPg7H75oEf bes4bqYpVGmkPopQ4QRxIWUA3/sjdsuTvQsJkUNrItVBMNtFRDyi22l+84yWnbetUTXo Fa8Q== X-Gm-Message-State: APzg51BmW7LZHCLi1UFyQAL0zW9e7Sy8qMFKa8Q0kDaJngRhGpEm3dqO Xmmn4WIad2vr+SA8slVMnkPrb4eW X-Google-Smtp-Source: ANB0Vdasmh2Ihs7XpxIY77WqzLQZ2Mh6OCq2dMVDeHX1COT006M78kBNbdI92IyzY9ui3G2DRwCnhw== X-Received: by 2002:aca:f488:: with SMTP id s130-v6mr15256504oih.269.1536438410617; Sat, 08 Sep 2018 13:26:50 -0700 (PDT) Received: from [192.168.1.10] (ip70-171-116-89.no.no.cox.net. [70.171.116.89]) by smtp.googlemail.com with ESMTPSA id 16-v6sm10327598oin.5.2018.09.08.13.26.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Sep 2018 13:26:49 -0700 (PDT) Subject: Volume partitioning (was Re: pgbackrest when data/base is symlinked to another volume) To: pgsql-general@lists.postgresql.org References: <3db7c0dc-b5e8-fab6-3521-bc60e2c1375b@pgmasters.net> <83d9fd2e-49f2-7100-33b0-ff381a2c996b@pgmasters.net> From: Ron Message-ID: Date: Sat, 8 Sep 2018 15:26:49 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <83d9fd2e-49f2-7100-33b0-ff381a2c996b@pgmasters.net> Content-Type: multipart/alternative; boundary="------------4632D899E15BBCD7F64802CD" 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. --------------4632D899E15BBCD7F64802CD Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 09/08/2018 03:07 PM, David Steele wrote: > On 9/7/18 8:47 PM, Ron wrote: >> On 09/07/2018 05:22 PM, David Steele wrote: >>> >>> On 9/6/18 11:21 PM, Ron wrote: >>>> >>>> Will pgbackrest properly backup and restore the cluster if data/base, >>>> data/pg_xlog and data/pg_log are symlinks? >>>> >>>> PGDATA=/var/lib/pgsql/9.6/data >>>> $PGDATA/base -> /Database/9.6/base >>>> $PGDATA/pg_log -> /Database/9.6/pg_log >>>> $PGDATA/pg_xlog -> /Database/9.6/pg_xlog >>> >>> Yes, this will work.  Note that restore does not recreate symlinks by >>> default so you'll need to specify --link-all to enable symlink creation. >>> >>> See >>> https://pgbackrest.org/configuration.html#section-restore/option-link-all >>> for details. >>> >>> Using symlinks in this way will make management of your clusters more >>> difficult, mostly because systems need more provisioning before restores >>> can be performed.  In general I'd recommend against it unless there are >>> performance considerations. >> >> Now that I'm thinking more about what you wrote... "data" isn't on it's >> own partition.  data/*base* has it's own partition. >> >> What's the recommended method for putting *base**/* on a partition >> different from data/?  Or is that not recommended? > > All the user data goes in base so there's really no need to separate it > out of data.  Typically pg_wal and tablespaces are relocated onto > different devices for performance (or to get more space).  If the > partitions are on the same device then there's no performance benefit, > just admin hassle. > Googled "postgresql disk partitioning" and "postgresql volume partitioning" without much success. Is the best practice volume partitioning: /Database/9.6/data /Database/9.6/data/pg_log /Database/9.6/data/pg_xlog where /var/lib/pgsql/9.6 (on RHEL6) is a symlink to /Database/9.6/data and PGDATA=/Database/9.6/data *or * /Database/9.6/data/base /Database/9.6/data/pg_log /Database/9.6/data/pg_xlog where PGDATA=/var/lib/pgsql/9.6/data and base, pg_log and px_xlog are symlinks to the partitions? Thanks -- Angular momentum makes the world go 'round. --------------4632D899E15BBCD7F64802CD Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit On 09/08/2018 03:07 PM, David Steele wrote:
On 9/7/18 8:47 PM, Ron wrote:
On 09/07/2018 05:22 PM, David Steele wrote:

On 9/6/18 11:21 PM, Ron wrote:

Will pgbackrest properly backup and restore the cluster if data/base, data/pg_xlog and data/pg_log are symlinks?

PGDATA=/var/lib/pgsql/9.6/data
$PGDATA/base -> /Database/9.6/base
$PGDATA/pg_log -> /Database/9.6/pg_log
$PGDATA/pg_xlog -> /Database/9.6/pg_xlog

Yes, this will work.  Note that restore does not recreate symlinks by default so you'll need to specify --link-all to enable symlink creation.

See https://pgbackrest.org/configuration.html#section-restore/option-link-all for details.

Using symlinks in this way will make management of your clusters more difficult, mostly because systems need more provisioning before restores can be performed.  In general I'd recommend against it unless there are performance considerations.

Now that I'm thinking more about what you wrote... "data" isn't on it's own partition.  data/*base* has it's own partition.

What's the recommended method for putting *base**/* on a partition different from data/?  Or is that not recommended?

All the user data goes in base so there's really no need to separate it out of data.  Typically pg_wal and tablespaces are relocated onto different devices for performance (or to get more space).  If the partitions are on the same device then there's no performance benefit, just admin hassle.


Googled "postgresql disk partitioning" and "postgresql volume partitioning" without much success.

Is the best practice volume partitioning:
/Database/9.6/data
/Database/9.6/data/pg_log
/Database/9.6/data/pg_xlog

where /var/lib/pgsql/9.6 (on RHEL6) is a symlink to /Database/9.6/data and PGDATA=/Database/9.6/data

or

/Database/9.6/data/base
/Database/9.6/data/pg_log
/Database/9.6/data/pg_xlog

where PGDATA=/var/lib/pgsql/9.6/data and base, pg_log and px_xlog are symlinks to the partitions?

Thanks

--
Angular momentum makes the world go 'round.
--------------4632D899E15BBCD7F64802CD--