Re: [PERFORM] backup/restore - another area.

From: Jeff <threshar(at)torgo(dot)978(dot)org>
To: "Donald Fraser" <demolish(at)cwgsy(dot)net>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: [PERFORM] backup/restore - another area.
Date: 2003-10-17 11:45:53
Message-ID: 20031017074553.655fa2c9.threshar@torgo.978.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-performance

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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Murthy Kambhampaty 2003-10-17 14:45:37 Re: [PERFORM] backup/restore - another area.
Previous Message Ganesan Kanavathy 2003-10-17 09:13:52 File system level backup

Browse pgsql-performance by date

  From Date Subject
Next Message Murthy Kambhampaty 2003-10-17 14:45:37 Re: [PERFORM] backup/restore - another area.
Previous Message Donald Fraser 2003-10-16 22:35:48 Re: [PERFORM] backup/restore - another area.