[Debburn-devel] how does -old-root works, how genisoimage tells if a file is

zhangweiwu at realss.com zhangweiwu at realss.com
Tue Sep 16 10:10:21 UTC 2008


I used to do a first time backup with just genisoimage (without -root):

$ genisoimage -iso-level 2 -r dir-to-backup

, and later does the incremental backup with:
$ genisoimage -C 0,12345 -M /dev/sr0 -iso-level 2 -r -old-root /
dir-to-backup

This always works fine. If I wish to check a historical backup (not the
latest backup), I do a mount with -o session=2 where 2 is the number of
backup.

I hit this problem today using cdrkit 1.1.8:
1) recover from backup:
# rsync -ra /media/dvd/ dir-to-backup/
2) modify some files in dir-to-backup
3) does incremental backup:
# genisoimage -C 0,3609632 -M /dev/sr0 -iso-level 2 -r -old-root /
dir-to-backup

Surprisingly I found the iso image created is as big as the 1st backup,
obviously genisoimage considered all files has been changed and
overwrite every file with the corresponding one in dir-to-backup.

This leads me curiously think how does -old-root actually works. The
manual says:

       -old-root dir
              [...]
              genisoimage to abort with an error.  Without this option,
              genisoimage would not be able to find unmodified files and would
              be forced to write their data into the image once more.  -root


I suppose genisoimage would walk the directory hierarchy, compare each
file with the same path, and compare the mtime. If the file in
dir-to-backup has mtime newer than the one on the disco, overwrite it.
But then it wouldn't lead to the problem I had today.

For deciding whether or not overwrite file on the disco, does it also
compare file ownership? Does it also compare file mode?  File size? or
ctime?

A small problem though (I could use another disco and restart 1st
backup). I am just interested to make it clear. Sorry couldn't read C
source code for this.



More information about the Debburn-devel mailing list