Dump/restore fun
Tagged:  •    •    •  

Situation: a FreeBSD webserver needs a backup system. dump and restore are your friends then. Restoring all that data is not that trivial, if you don't know how dump operates. But the manpages of these commands should help a lot already.

I had problems with restoring a batch of incremental backups, and after a lot of checking, searching, reading and some help from another person I finally found out that the error (Incremental tape too low) was in a wrong restore sequence.

In our situation, a level 0 backup is made every two months. After that, higher level backups are made according to the following scheme:

Day Level
Sunday 1
Monday 3
Tuesday 2
Wednesday 5
Thursday 4
Friday 7
Saturday 6

And here are the restore sequences for each day.

Day Level
Sunday 0-1
Monday 0-1-3
Tuesday 0-1-2
Wednesday 0-1-2-5
Thursday 0-1-2-4
Friday 0-1-2-4-7
Saturday 0-1-2-4-6

The restores on Wednesday and Friday went wrong because I used the 1-3-5-7 sequence, but 3 (Monday) becomes invalid as soon as a level 2 dump is taken from the filesystem (Tuesday). If you want to restore a level 5 dump, it will not work because it's based on a level 2 dump.

It's so simple after all, but I had a hard time to get the trick.