pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Matt Clark <matt@ymogen.net>
To: pgsql-admin@postgresql.org
Subject: LVM snapshots
Date: Fri, 14 Mar 2003 15:48:00 -0000
Message-ID: <OAEAKHEHCMLBLIDGAFELMEALDBAA.matt@ymogen.net> (raw)

Has anyone tried taking an LVM snapshot of a running DB?  And then reverting
to the snapshot?  I presume one would need to take a low level backup (i.e.
using dd, not tar or cp) of the snapshot to preserve the precise FS layout,
but are there any other issues?

I'm thinking of trying this slightly loony experiment on Postgres v 7.2.3
running on RedHat 7.3, with ext3 as the filesystem.  The only 'gotchas' I
can think of at the moment are:

1.    the need to preserve the FS layout precisely
2.    the minor pauses that occur while LVM freezes the FS to bring the
snapshot online and offline.
3.    the need to have the data directory and the pg_xlog directory on the
same logical volume so they get snapshotted together
4.    the fact that the on-disk data is much larger than the output of
pg_dump, so backing up the snapshot will require quite a bit of IO

Any others I've missed?  If it works then it'd be a fairly neat way to keep
a recent consistent copy of the DB around without having to run pg_dump
every 10 minutes, which chews CPU like nobody's business.

Thanks in advance for any comments.

Matt

Matt Clark
Ymogen Ltd
matt@ymogen.net
corp.ymogen.net

view thread (35+ messages)  latest in thread

Message-ID: <OAEAKHEHCMLBLIDGAFELMEALDBAA.matt@ymogen.net>
Permalink:  ../OAEAKHEHCMLBLIDGAFELMEALDBAA.matt@ymogen.net/
Also on:    postgresql.org/message-id/OAEAKHEHCMLBLIDGAFELMEALDBAA.matt@ymogen.net

 · 

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-admin@postgresql.org
  Cc: matt@ymogen.net
  Subject: Re: LVM snapshots
  In-Reply-To: <OAEAKHEHCMLBLIDGAFELMEALDBAA.matt@ymogen.net>
  References: <OAEAKHEHCMLBLIDGAFELMEALDBAA.matt@ymogen.net>

* 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