X-Original-To: pgsql-admin@postgresql.org Received: from biscay.ymogen.com (biscay.ymogen.net [194.164.6.62]) by postgresql.org (Postfix) with SMTP id 8BFA347590C for ; Fri, 14 Mar 2003 10:48:17 -0500 (EST) Received: (qmail 24093 invoked from network); 14 Mar 2003 15:48:20 -0000 Received: from unknown (HELO solent) (mailuser@213.165.136.12) by 0 with SMTP; 14 Mar 2003 15:48:20 -0000 From: "Matt Clark" To: Subject: LVM snapshots Date: Fri, 14 Mar 2003 15:48:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_04B2_01C2EA41.170AC1F0" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Archive-Number: 200303/223 X-Sequence-Number: 7863 This is a multi-part message in MIME format. ------=_NextPart_000_04B2_01C2EA41.170AC1F0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit 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 ------=_NextPart_000_04B2_01C2EA41.170AC1F0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Has anyo= ne tried=20 taking an LVM snapshot of a running DB?  And then reverting to the=20 snapshot?  I presume one would need to take a low level backup (i.e. u= sing=20 dd, not tar or cp) of the snapshot to preserve the precise FS layout, = but=20 are there any other issues?
 
I'm thin= king of=20 trying this slightly loony experiment on Postgres v 7.2.3 running on RedHat= 7.3,=20 with ext3 as the filesystem.  The only 'gotchas' I can think of at the= =20 moment are:
 
1.    the need to preserve the FS layout=20 precisely
2.    the minor pauses that occur while LVM freezes= the FS=20 to bring the snapshot online and offline.
3.    the need to have the data directory and the p= g_xlog=20 directory on the same logical volume so they get snapshotted=20 together
4.    the fact that the on-disk data is much larger= than=20 the output of pg_dump, so backing up the snapshot will require quite a bit = of=20 IO
 
Any othe= rs I've=20 missed?  If it works then it'd be a fairly neat way to keep a recent= =20 consistent copy of the DB around without having to run pg_dump every 1= 0=20 minutes, which chews CPU like nobody's business.
<= /SPAN> = ;
Thanks i= n advance=20 for any comments.
 
Matt
 

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

 
------=_NextPart_000_04B2_01C2EA41.170AC1F0--