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

From: Jeff <threshar(at)torgo(dot)978(dot)org>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: markw(at)osdl(dot)org, pgsql-performance(at)postgresql(dot)org, linux-lvm(at)sistina(dot)com, pgsql-admin(at)postgresql(dot)org
Subject: Re: [PERFORM] backup/restore - another area.
Date: 2003-10-16 17:37:27
Message-ID: 20031016133727.469620f0.threshar@torgo.978.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-performance

On Thu, 16 Oct 2003 10:09:27 -0700
Josh Berkus <josh(at)agliodbs(dot)com> 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 <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 lgama 2003-10-16 17:49:50 How do I unsuscribe?
Previous Message Tom Lane 2003-10-16 17:29:53 Re: user name doesn't seem to resolve to $user in search_path

Browse pgsql-performance by date

  From Date Subject
Next Message Robert Treat 2003-10-16 21:38:31 Re: free space map usage
Previous Message Josh Berkus 2003-10-16 17:09:27 Re: [PERFORM] backup/restore - another area.