Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Aug 2005 16:22:20 +0100
From:      Alex Zbyslaw <xfb52@dial.pipex.com>
To:        Ilari Laitinen <ilari.laitinen@iki.fi>
Cc:        questions@freebsd.org
Subject:   Re: dump(8), incremental backups, Tower of Hanoi sequence, don't get it
Message-ID:  <4305F92C.9080001@dial.pipex.com>
In-Reply-To: <20050819141535.GA62513@lohi.local>
References:  <20050819141535.GA62513@lohi.local>

next in thread | previous in thread | raw e-mail | index | archive | help
Ilari Laitinen wrote:

>Handbook reads dump(8) is the best backup program there is. So I am
>giving it a try - only to find out that I don't understand at all the
>meaning of that modified Tower of Hanoi algorithm descibed in the
>manual page and elsewhere. The manual page says it is "an efficient
>method of staggering incremental dumps to minimize the number of
>tapes." I just don't get the picture here.
>
>So, could somebody please give an idiot-proof explanation why "3 2 5
>4 7 6 9 8 9 9" is such a tape-number-minimizing dump level sequence
>(with helpful examples, if at all possible)? How does it work?
>
>Am I relatively safe doing level 0 dump every two months and
>increasing dump level for weekly backups like the following, given
>two separate harddrives storing them?
>
>Date        Dump level
>2005-09-01  0
>2005-09-08  1
>2005-09-15  2
>...
>2005-10-27  8
>2005-11-03  0
>  
>
No, your sequence is the worst possible.  If you have a crash on  
2005-10-27 then you will need to recover files from *every* dump  from 
your last level 0.

A level 0 dumps everything. 

A level 1 everything since the last 0

a level 2, everything since the last 0 or 1

a level 3 everything since the last 0, 1 or 2

A level 4, everything since the last 0, 1, 2, or 3

etc.

The idea is is to make the numbers rise and fall to minimise the number 
of backups needed to do a full restore.  Write yourself some sequences 
and figure out for yourself which ones you would need for a full 
backup.  Try to figure out for each backup whether the same files will 
be dumped by a later backup.  They will, if a later backup number is 
*lower*.

The algorithm your aiming to create is:
    Start with a level 0 and ignore everything before.
    from end of list, find the lowest number before you reach the 
starting dump.  You'll need this backup.  Make it the new start of list.
    from end of list, find the lowest number before you reach the 
starting dump.  You'll need this backup.  Make it the new start of list.
    etc.

E.g. Given 0 3 2 5 4 7 6 9

To restore everything you need the 0, 2, 4 and 6.  I.e. every second 
dump.  You'll see that wherever you stop in that sequence, no more than 
3 backups are required to recover everything.

I have never liked the 9 9 9 trailing off to infinity.  If you are not 
doing a full backup by then, then you should be restarting your sequence 
from the dump after the full backup.  E.g. 3 2 5 4 7 6 9 8 then back to 
3 2 5 4 7 6 9 8 and repeat.

Personally I use a much shorter sequence: 0 1 3 2 1 3 2 1 3 2.  But 
that's because I don't usually change vast amounts of data.

I would also consider doing your backups daily, not weekly as your 
example suggests.  The timing of full backups depends on how busy your 
machine is.  Anything from weekly to quarterly.

--Alex




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