dump(8), incremental backups, Tower of Hanoi sequence, don't get it

Jerry McAllister jerrymc at clunix.cl.msu.edu
Fri Aug 19 16:02:23 GMT 2005

> Hello.
> Lately I have been getting more and more worried about data on my
> FreeBSD box at home. I am forming a "real" small-scale backup policy
> with two different big USB harddrives (yet to buy) storing regular
> incremental backups (yet to figure out). The idea is to have those
> harddrives mirror each other for extra security.

It really depends on the size of your file systems to back up, the size 
of your media to receie the backup files, the speed of the backup device
and how much data changes during any given interval between backups.

If your media is big enough to hold a complete backup and there is 
not a lot of data change between backups, then doing a full (leval 0)
dump once per week and a level 1 on other days would be fine.

If your filesystem is much bigger than your media or your data changes
a lot between backup, then you will want to implement a more complex
scheme, such as a modified version of the plan in the handbook.

Someone else has pointed out that level 0 gets everythingm level 1
gets everything that has changed since the last level 0, level 2 gets
everything since the last level 1, etc.     

My suggestion is to plan your backups so that you do a level 0 at a 
specific interval, such as once per week - oftener if you have critical 
stuff changing frequently.   It is nice to have media of a size that one 
unit will handle the whole level 0 dump, but that may not be possible.   
You may need to use multiple tapes/DVDs/disk for it.    

Then schedule higher level (1...5) dumps so that the lowest level possible 
just fills one unit of your media.  You may even be able to use a smaller
size media unit for the intervening higher level dumps (we call them "change"
dumps).    It is even possible that you can fit more than one change
dump on a single unit of media.   (If you are using sequential media (tape)
be careful with managing your skip forwards [mt -f /dev/nsa0 1 or 2 or 3, etc] 
to make sure you use the no rewind device (nra0) or you may overwrite

Another consideration when you choose change dump levels is how
many levels you have to restore to completely rebuild a mangled file
system,   Using fewer levels - maybe just doing level 0 with only 
level 1's in between, makes restore the most simple, but can make
for unnecessarily large level 1 dumps as the interval between level 0
dumps grows longer and more files are changed and created.   

If your 'change' dumps are larger than one media unit, then your problem
is, of necessity, larger and more complex than the simple scheme in the
handbook covers well.   You will have to think it out, still using the
basic concerns I mention above, eg a periodic full dump, intervened by
a scheme of progressively higher level change dumps to minimize the
number of media units your must use for each.   

Remember that just as higher level dumps can intervene for a leval 0 dump,
dumps higher than 1 can intervene level 1 dumps - eg another way of saying
that level 2 or higher dumps only backup files that have changed since
the last level 1 dump, level 3 only backs up data that has changed since
the most recent level 2 or 1 or 0 dump, whichever was most recent, etc.

It is a little mind fogging to just say it.   It can help to draw it
out on paper with circles and arrows.  But it does work.   

This doesn't specifically explain the "towers of Hanoi" scheme in
the handbook and man page, but I hope it provides some background
to help understand what they are trying to accomplish and that this
will help clarify it.


> 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
> =2E..
> 2005-10-27  8
> 2005-11-03  0
> Thanks.
> Ilari Laitinen,
>     dumb dump newbie lost in this big world of ever-so-failing disks
> --=20
> Ilari Laitinen - ilari.laitinen at iki.fi - http://iki.fi/ilari.laitinen/
> --huq684BweRXVnRxX
> Content-Type: application/pgp-signature
> Content-Disposition: inline
> Version: GnuPG v1.4.1 (FreeBSD)
> d5wx5asYHJqZju/cA2pnrJc=
> =lGaX
> --huq684BweRXVnRxX--

More information about the freebsd-questions mailing list