LVM snapshots

From: "Matt Clark" <matt(at)ymogen(dot)net>
To: <pgsql-admin(at)postgresql(dot)org>
Subject: LVM snapshots
Date: 2003-03-14 15:48:00
Message-ID: OAEAKHEHCMLBLIDGAFELMEALDBAA.matt@ymogen.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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(at)ymogen(dot)net
corp.ymogen.net

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message David F. Skoll 2003-03-14 15:51:47 Re: LVM snapshots
Previous Message Andrew Sullivan 2003-03-14 13:19:56 Re: OOT-Does PostgreSQL has commercial level.