Re: file-system snapshot under freebsd for backup

Lists: pgsql-general
From: ProAce <proace(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: file-system snapshot under freebsd for backup
Date: 2007-08-02 05:48:11
Message-ID: 737a6d270708012248q44672572n84c89f13cfe1f3c2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

I already put the data directory on hds san storage, but there is no
snapshot license on it.
Could I use mksnap_ffs under freebsd to make snapshot for backup ?


From: Bill Moran <wmoran(at)potentialtech(dot)com>
To: ProAce <proace(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: file-system snapshot under freebsd for backup
Date: 2007-08-02 12:19:12
Message-ID: 20070802081912.b030bd81.wmoran@potentialtech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

In response to ProAce <proace(at)gmail(dot)com>:

> I already put the data directory on hds san storage, but there is no
> snapshot license on it.
> Could I use mksnap_ffs under freebsd to make snapshot for backup ?

Maybe. I'm confused by your question, but:
* If the data directory is on an FFS2 volume on a FreeBSD machine, you
can use mksnap_ffs to back it up, and that approach is actually
recommended for PITR-type backups.
* If the data is mounted via NFS or something similar and the filesystem
is not FFS2, then snapshots are not available on FreeBSD.

--
Bill Moran
http://www.potentialtech.com


From: ProAce <proace(at)gmail(dot)com>
To: "Naz Gassiep" <naz(at)mira(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: file-system snapshot under freebsd for backup
Date: 2007-08-02 13:49:42
Message-ID: 737a6d270708020649l2c577020v5d4995bbf3ebe1eb@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

The size of my db is more then 50GB , so I consider that the pg_dump
is not a good backup tool for me.
And, sometimes, I need query data which is some days ago ( between 1 ~
14 days ).

If I want to transfer my db to different PG version, I will use slony-I. :)

I worried that mksnap_ffs spend much time on making a new snapshot.
I don't know whether PG work very well during the period of making snapshot.
Or the snapshot be made successfully when the PG execute / commit sql
statments continuously.

2007/8/2, Naz Gassiep <naz(at)mira(dot)net>:
> Have you considered using pg_dump to backup your databases? Taking
> file-level snapshots is not recommended as you may want/need to restore to a
> different version of PG that is not binary compatible with the snapshot
> you've taken.
> Regards,
> - Naz.
>
>
> ProAce wrote:
> I already put the data directory on hds san storage, but there is
> no
snapshot license on it.
Could I use mksnap_ffs under freebsd to make
> snapshot for backup ?

---------------------------(end of
> broadcast)---------------------------
TIP 6: explain
> analyze is your friend

>


From: ProAce <proace(at)gmail(dot)com>
To: "Bill Moran" <wmoran(at)potentialtech(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: file-system snapshot under freebsd for backup
Date: 2007-08-02 13:58:52
Message-ID: 737a6d270708020658w320cfceaqa1e9a2bd5638b253@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

I use SAN, not NAS. :)

Because some bugdet issue, I just have a basic SAN environment.
For multipathing, I use geom_fox to complete.
For snapshot, I want to use mksnap_ffs.

But I don't have any experience of using mksnap_ffs to backup pgsql.
Does anyone give me some advice?

2007/8/2, Bill Moran <wmoran(at)potentialtech(dot)com>:
>
> Maybe. I'm confused by your question, but:
> * If the data directory is on an FFS2 volume on a FreeBSD machine, you
> can use mksnap_ffs to back it up, and that approach is actually
> recommended for PITR-type backups.
> * If the data is mounted via NFS or something similar and the filesystem
> is not FFS2, then snapshots are not available on FreeBSD.
>
> --
> Bill Moran
> http://www.potentialtech.com
>


From: Bill Moran <wmoran(at)potentialtech(dot)com>
To: ProAce <proace(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: file-system snapshot under freebsd for backup
Date: 2007-08-02 14:30:18
Message-ID: 20070802103018.838b252a.wmoran@potentialtech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

In response to ProAce <proace(at)gmail(dot)com>:

> I use SAN, not NAS. :)
>
> Because some bugdet issue, I just have a basic SAN environment.
> For multipathing, I use geom_fox to complete.
> For snapshot, I want to use mksnap_ffs.
>
> But I don't have any experience of using mksnap_ffs to backup pgsql.
> Does anyone give me some advice?

If you don't want to do PITR, read this:
http://www.postgresql.org/docs/8.2/static/backup-file.html

You can also use the mount command to make filesystem snapshots.
Assuming your PG data directory is under the mount point /var/db:

mount -o snapshot -u /var/db/snapshot /var/db
mdconfig -a -t vnode -f /var/db/snapshot -u 4
mount -r /dev/md4 /mnt
[ ... do whatever you do to back up /mnt (which is the snapshot of
/var/db ...]
umount /mnt
mdconfig -d -u 4
rm /var/db/snapshot

> 2007/8/2, Bill Moran <wmoran(at)potentialtech(dot)com>:
> >
> > Maybe. I'm confused by your question, but:
> > * If the data directory is on an FFS2 volume on a FreeBSD machine, you
> > can use mksnap_ffs to back it up, and that approach is actually
> > recommended for PITR-type backups.
> > * If the data is mounted via NFS or something similar and the filesystem
> > is not FFS2, then snapshots are not available on FreeBSD.
> >
> > --
> > Bill Moran
> > http://www.potentialtech.com
> >

--
Bill Moran
http://www.potentialtech.com


From: Decibel! <decibel(at)decibel(dot)org>
To: ProAce <proace(at)gmail(dot)com>
Cc: Naz Gassiep <naz(at)mira(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: file-system snapshot under freebsd for backup
Date: 2007-08-04 17:56:24
Message-ID: 20070804175624.GT25704@nasby.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Thu, Aug 02, 2007 at 09:49:42PM +0800, ProAce wrote:
> The size of my db is more then 50GB , so I consider that the pg_dump
> is not a good backup tool for me.
> And, sometimes, I need query data which is some days ago ( between 1 ~
> 14 days ).
>
> If I want to transfer my db to different PG version, I will use slony-I. :)
>
> I worried that mksnap_ffs spend much time on making a new snapshot.
> I don't know whether PG work very well during the period of making snapshot.
> Or the snapshot be made successfully when the PG execute / commit sql
> statments continuously.

If you're worried then just use PITR with a more conventional copy
mechanism. You don't have to use snapshots.
--
Decibel!, aka Jim Nasby decibel(at)decibel(dot)org
EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)