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 B0CEDD1B4EF for ; Fri, 17 Oct 2003 11:43:34 +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 25357-05 for ; Fri, 17 Oct 2003 08:43:06 -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 3156FD1B547 for ; Fri, 17 Oct 2003 08:42:57 -0300 (ADT) Received: (qmail 10177 invoked from network); 17 Oct 2003 11:48:07 -0000 Received: from dhcp-7-41.ma.lycos.com (HELO squeegit) (10.124.7.41) by dhcp-7-248.ma.lycos.com with SMTP; 17 Oct 2003 11:48:07 -0000 Date: Fri, 17 Oct 2003 07:45:53 -0400 From: Jeff To: "Donald Fraser" Cc: pgsql-admin@postgresql.org Subject: Re: [PERFORM] backup/restore - another area. Message-Id: <20031017074553.655fa2c9.threshar@torgo.978.org> In-Reply-To: <001001c39435$dbd82920$1664a8c0@DEMOLITION> References: <200310160949.59442.josh@agliodbs.com> <20031016130637.535f633f.threshar@torgo.978.org> <001001c39435$dbd82920$1664a8c0@DEMOLITION> 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/200 X-Sequence-Number: 10761 On Thu, 16 Oct 2003 23:35:48 +0100 "Donald Fraser" wrote: > > Since this seems to work for you, > would you be kind enough to post the shell script for doing the > snapshot with LVM. > Ahh, I posted it to -perform. Guess it didn't make it here. I have a 2 disk striped LVM as /dev/postgresql/pgdata Here's what I do: 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; The key is that -L that tells it how big to make htings. If your -L is smaller than the actual size of the volume you'll get corruption (as I found out). The restore is to simply take pg down, rm $PGDATA and untar mb.backup into $PGDATA, start up PG and thats it. Godo luck - be sure to test it out first! -- Jeff Trout http://www.jefftrout.com/ http://www.stuarthamm.net/