pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff <threshar@torgo.978.org>
To: Donald Fraser <demolish@cwgsy.net>
Cc: pgsql-admin@postgresql.org
Subject: Re: [PERFORM] backup/restore - another area.
Date: Fri, 17 Oct 2003 07:45:53 -0400
Message-ID: <20031017074553.655fa2c9.threshar@torgo.978.org> (raw)
In-Reply-To: <001001c39435$dbd82920$1664a8c0@DEMOLITION>
References: <Pine.BSF.4.44.0310160740510.5719-100000@torgo.978.org>
	<200310160949.59442.josh@agliodbs.com>
	<20031016130637.535f633f.threshar@torgo.978.org>
	<001001c39435$dbd82920$1664a8c0@DEMOLITION>

On Thu, 16 Oct 2003 23:35:48 +0100
"Donald Fraser" <demolish@cwgsy.net> 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 <jeff@jefftrout.com>
http://www.jefftrout.com/
http://www.stuarthamm.net/



view thread (14+ messages)  latest in thread

Message-ID: <20031017074553.655fa2c9.threshar@torgo.978.org>
Permalink:  ../20031017074553.655fa2c9.threshar@torgo.978.org/
Also on:    postgresql.org/message-id/20031017074553.655fa2c9.threshar@torgo.978.org

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: threshar@torgo.978.org, demolish@cwgsy.net, pgsql-admin@postgresql.org
  Subject: Re: [PERFORM] backup/restore - another area.
  In-Reply-To: <20031017074553.655fa2c9.threshar@torgo.978.org>

* 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