Friday, October 21, 2005

restored filesystem - comparison to original

restored filesystem - comparison to original

Having devised and operated a backup scheme and schedule since the start of the
month, I'd quite like to perform a restoration in order to test it.

I will restore the file system to a separate disk than the original,

But what's the "best" way to compare the two so I can be sure the scheme I have
devised is capable of backing up properly, but also my proposed restore
mechanism, restores properly.

The fs in question is only 1GB at present. So any suggested comparison can be
time consuming in nature.....

I'd obviously like to check for missing files/directories and errors with
ownerships, permissions, ACLs, and timestamps...

How do I go about this?


> Rob

running tripwire on the orignal and the copy comes to mind.
then compare the output tripwire databases.

> with ownerships, permissions, ACLs, and timestamps...

You could try the filesync tool with the "-n" option, which will make
it just find the differences and not attempt to make changes. If you
back up /foo and restore it into /restore/foo, then the filesync command
would be something like this:

filesync -n -ame -fsrc -s / -d /restore foo

The "-n" means not to make any changes, the "-aem" means to check
ACLs and modification times and flag everything found (even if it
can't be changed, the "-fsrc" means to consider the source directory
to be the authoritative one, "-s" specifies the directory that
CONTAINS the source thingy to be synchronized, "-d" specifies the
directory that contains the destination thing to be synced, and
"foo" is the thing to be synced.

If you wanted to compare all of "/" against something contained
in "/" (such as "/restore"), you could type this in ksh or bash:

cd /
filesync -n -ame -fsrc -s / -d /restore ./

Then when the cursor is at the end of the line, do ESC then "*" in
vi mode or Meta-"*" in emacs mode, and it will expand the list of
files, at which point you can delete "restore" from the list. (If
you don't delete "restore" from the list, it will think everything
in "restore" should be in "restore/restore", which make will cause
the output to be filled with extraneous stuff.)

- Logan

>I will restore the file system to a separate disk than the original,

The best way is to use "star" to compare both filesystems
as it is the only known program that is able to compare _all_
file properties and meta-data (except for Extended attribute files).

As I currently know nobody who uses Extended attribute files, I am
sure that this will fit your needs.


star -c -diff -vv -dump -acl -sparse diffopts=!atime,ctime,lmtime -C
fromdir . todir

BTW: This is also the fastest known method and if you like to copy
a filesystem, a similar method will copy the fs very fast.

Also have a look at star when doing incremental dumps.
It might be more interesting for you than ufsdump/ufsrstore.


Post a Comment

<< Home