X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 22066D1B532 for ; Thu, 16 Oct 2003 17:35:00 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 49238-07 for ; Thu, 16 Oct 2003 14:34:29 -0300 (ADT) Received: from dhcp-7-248.ma.lycos.com (waltham-nat.ma.lycos.com [209.202.205.1]) by svr1.postgresql.org (Postfix) with SMTP id 9A402D1B548 for ; Thu, 16 Oct 2003 14:34:27 -0300 (ADT) Received: (qmail 30516 invoked from network); 16 Oct 2003 17:39:29 -0000 Received: from dhcp-7-41.ma.lycos.com (HELO squeegit) (10.124.7.41) by dhcp-7-248.ma.lycos.com with SMTP; 16 Oct 2003 17:39:29 -0000 Date: Thu, 16 Oct 2003 13:37:27 -0400 From: Jeff To: Josh Berkus Cc: markw@osdl.org, pgsql-performance@postgresql.org, linux-lvm@sistina.com, pgsql-admin@postgresql.org Subject: Re: [PERFORM] backup/restore - another area. Message-Id: <20031016133727.469620f0.threshar@torgo.978.org> In-Reply-To: <200310161009.27379.josh@agliodbs.com> References: <200310160949.59442.josh@agliodbs.com> <20031016130637.535f633f.threshar@torgo.978.org> <200310161009.27379.josh@agliodbs.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/187 X-Sequence-Number: 10748 On Thu, 16 Oct 2003 10:09:27 -0700 Josh Berkus wrote: > Jeff, > > > I left the DB up while doing this. > > > > Even had a program sitting around committing data to try and corrupt > > things. (Which is how I discovered I was doing the snapshot wrong) > > Really? I'm unclear on the method you're using to take the snapshot, > then; I seem to have missed a couple posts on this thread. Want to > refresh me? > I have a 2 disk stripe LVM on /dev/postgres/pgdata/ lvcreate -L4000M -s -n pg_backup /dev/postgres/pgdata mount /dev/postgres/pg_backup /pg_backup tar cf - /pg_backup | gzip -1 > /squeegit/mb.backup umount /pg_backup; lvremove -f /dev/postgres/pg_backup; In a nutshell an LVM snapshot is an atomic operation that takes, well, a snapshot of hte FS as it was at that instant. It does not make a 2nd copy of the data. This way you can simply tar up the pgdata directory and be happy as the snapshot will not be changing due to db activity. -- Jeff Trout http://www.jefftrout.com/ http://www.stuarthamm.net/