Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Sep 2003 13:37:33 +0100
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Mark Terribile <materribile@yahoo.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Q's on dump(8) and restore(8)
Message-ID:  <20030913123733.GB11258@happy-idiot-talk.infracaninophile.co.uk>
In-Reply-To: <20030913070011.62055.qmail@web21105.mail.yahoo.com>
References:  <20030913070011.62055.qmail@web21105.mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--7ZAtKRhVyVSsbBD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Sep 13, 2003 at 12:00:11AM -0700, Mark Terribile wrote:

>      I'm looking to improve and automate my primitive
> backups and I'm considering dump(8)/restore(8).  But
> before I go this route, I'd like to be sure I can
> control their behavior.  Unfortunately, the man pages
> don't seem to completely describe the interaction
> between the numerical dump flag in /etc/fstab and
> the dump level.  Can anyone elucidate?

Dump levels are a flexible way of implementing incremental backups.  A
level 0 dump will always back up everything[*].  Then a level 1 dump
backs up all of the files that have been modified since the last level
0 dump, and a level 2 dump would backup every file that had been
modified since the previous lower level (level 1 or level 0) dump, and
so on, all the way down to a level 9 dump.

Let's look at some common dump schemes.  I'll base these around a
weekly cycle, using a separate tape for each day of the week:
generally what you'ld do is have several sets of these weekly tapes
that you cycle through, so you aren't completely lost if one of those
sets of tapes should be found to be substandard.

People with more money (or backup media) than is good for them can
just run a full backup every day:

  Sun  Mon  Tue  Wed  Thu  Fri  Sat

  0    0    0    0    0    0    0

This maximizes the amount of data to back up each day, but also
minimizes the amount of effort required to restore the system to the
state at any particular date and it gives you minimum exposure should
one of your tapes fail.

The alternate extreme is:

  1    2    3    4    5    6    7

So that except for Sunday, each day all you do is backup what changed
since the previous day.  It's assumed that your level 0 dump
corresponds to the state of the system immediately after installation,
and you may or may not actually perform a level 0 dump at that time.
Prudence dictates that you should certainly run an occasional level 0
dump to help keep the size of your level 1 tape sets down and just on
general principles.  This is parsimonious with the tapes, but if you
need to restore the system to the state on Saturday, you need *all* of
your weeks tapes.  And if the Monday tape breaks, then the following
Tuesday to Saturdays' tapes are pretty much useless.

Probably the most popular scheme is:

  1    3    3    3    3    3    3

So each day you back up everything that changed since the previous
level 1 backup. (Or you could do a level 0 instead ot the level 1 each
week for extra security). That means that the Friday or Saturday tapes
get a lot more use than the Monday tape.  However all you need to
restore the system is the level 1 and the appropriate level 3 tape.

>      In the same vein, does anyone know the
> `modified tower of Hanoi' algorithm the man page
> recommends?

If you don't know what "Towers of Hanoi" is, fire up your nearest copy
of emacs and run:

    M-x hanoi

or

    M-x hanoi-unix

although that second one takes quite some time to run to completion.

The 'modified Towers of Hanoi" backup sequence is based on that game.
This is an optimised sequence that achieves a balance between the
different extremes shown above.  A weekly system would look like:

  1    3    2    5    4    7    6

although the man page shows how to extend that for a few extra
days. This results in approximately the same amount of data being
saved on each daily tape, but doesn't require that all tapes are
needed to do the Friday backup and should one of the daily tapes fail
(other than a level 1 tape), you can still restore to the state only
one day away.  Thus:

       Tapes needed
  Sun: 1
  Mon: 1, 3
  Tue: 1, 2
  Wed: 1, 3, 5
  Thu: 1, 2, 4
  Fri: 1, 3, 5, 7
  Sat: 1, 2, 4, 6
 =20
By the way, although I've shown all of these cycles based on a week
starting on Sunday, I can tell you from practical experience that the
full level one backup is most likely to need attention, so it's often
a good idea to shift the cycle round so that the big weekly backup
happens on a week day.

	Cheers,

	Matthew

[*] Except when you use the '-h 0' flags to dump(8), which tells
dump(8) to honour the 'nodump' file flag even at level 0.  By default
the 'nodump' flag is only honoured at level 1 or higher.

--=20
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

--7ZAtKRhVyVSsbBD2
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQE/Yw+NdtESqEQa7a0RAssYAJ9pERG+9SbMB7t3QCuy9HZDVsO4rACgiyrx
3g2OfzrDmdbIj/NTZIvm4i0=
=nzSd
-----END PGP SIGNATURE-----

--7ZAtKRhVyVSsbBD2--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030913123733.GB11258>