JT Kirkpatrick wrote:
> 
> >1.)    Use mirroring onto this HD for the PGDATA directory tree (which can
> >abd should be on its own filesystem, IMO).  Then, to back up the system,
> >you break the mirror (which will wait on write activity to stop), back
> >up the offline disk, then reestablish the mirror.
> 
> uh oh, the water just cleared my eyebrows -- but i'm not in "over my head"
> yet!  (almost. . .)

Check the "md" subsystem under the linux 2.2 kernel.  There is a RAID
howto -- you want straight mirroring (RAID 1).  This will slightly slow
down your writes, but will speed up your reads.  You then use the md
tools (software RAID) to manipulate mirrored volumes -- establishing and
breaking mirrors, et al.

The set up would be (for PGDATA=/var/lib/pgsql, /dev/hda7 is the primary
PGDATA, /dev/hdc3 is the secondary):

/dev/hda7 is mounted on /var/lib/pgsql (through the md driver....)
/dev/hdc3 is set up RAID 1 of /dev/hda7 (again, via the md driver.)

I have not yet done this here; it is on my TODO list.

Then, before making a backup, wait for quiescence on the PGDATA tree (if
a ps ax|grep postgres returns no lines).  Break the mirror from hdc3 to
hda7 (using the md utils), dump hdc3 to tape (using your favorite
utility -- dump is probably the best for this), then reestablish the
mirror with md.  Md will automatically catch up the work before putting
the hdc3 mirror back online for reading.

Of course, it would be nice to do a dump of the REDO/UNDO log after the
dump of hdc3 is done for full recovery -- but that is another article.

Lamar Owen
WGCR Internet Radio

Reply via email to