On Thu, 16 Oct 2003 23:35:48 +0100
"Donald Fraser" <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]>
http://www.jefftrout.com/
http://www.stuarthamm.net/

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [EMAIL PROTECTED] so that your
      message can get through to the mailing list cleanly

Reply via email to