pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: consistent postgresql snapshot
Date: Wed, 11 May 2022 18:50:43 -0500
Message-ID: <1ba59e2c-b0ae-387f-1272-cdbeefe7bd67@gmail.com> (raw)
In-Reply-To: <49bb084a06194e51a2d58421e5f074f6@zuerich.ch>
References: <49bb084a06194e51a2d58421e5f074f6@zuerich.ch>

On 5/11/22 10:41, Zwettler Markus (OIZ) wrote:
>
> PostgreSQL12 running on CentOS7 + ext4.
>
> Would it be save to do a "fsfreeze –freeze" + disk snapshot + "fsfreeze 
> –unfreeze" of the PGDATA filesystem to get a consistent snapshot?
>
> I am wondering as PostgreSQL default blocksize = 8k while ext4 default 
> blocksize = 4k, resulting in 2 fs blocks per db block.
>

If data/base and pg_xlog are on the same filesystem, then it might work.

Be sure to select pg_start_backup('something informative'); beforehand, and 
select pg_stop_backup(); afterwards.

For example:
psql -c "select pg_start_backup('something informative');"
fsfreeze –freeze
/disk snapshot/
fsfreeze –unfreeze
psql -c "select pg_stop_backup();"

-- 
Angular momentum makes the world go 'round.

view thread (2+ messages)

Message-ID: <1ba59e2c-b0ae-387f-1272-cdbeefe7bd67@gmail.com>
Permalink:  ../1ba59e2c-b0ae-387f-1272-cdbeefe7bd67@gmail.com/
Also on:    postgresql.org/message-id/1ba59e2c-b0ae-387f-1272-cdbeefe7bd67@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: ronljohnsonjr@gmail.com
  Subject: Re: consistent postgresql snapshot
  In-Reply-To: <1ba59e2c-b0ae-387f-1272-cdbeefe7bd67@gmail.com>
  References: <49bb084a06194e51a2d58421e5f074f6@zuerich.ch> <1ba59e2c-b0ae-387f-1272-cdbeefe7bd67@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox