FreeBSD: equiv of the Linux mondoarchive for FreeBSD?

Dominic Marks dominic_marks at btinternet.com
Sat May 11 17:33:48 BST 2002


On Sat, May 11, 2002 at 04:37:37PM +0100, Lachlan Cranswick wrote:
> 
> Due to local conditions - I have been moderately forced to use
> FreeBSD Linux over FreeBSD. (which is a shame)

Always :)

> But a query if people have the time.  If there an equivalent
> of the GPL'd Linux mondoarchive for FreeBSD?
> 
>    http://www.mondorescue.org/
> 
> Mondoarchive creates Bootable archive CDs that can easily recover (or 
> recover a subset of) the entire system, all one has to do is insert 
> the CD and reboot the server. Mondorescue also creates the archives 
> in a format such that it is tolerant of corrupted regions of the CD 
> (you don't lose everything - only the files on the affected region). 
> It will also archive to tape and nfs mounts and removable drives (but
> the removeable drive stuff seems a bit flakey at the moment)
> 
> It can also make use of lzop compression such that the archive is
> compressed but does not take any extra time over uncompressed.
> 
> I have been recently brainwashed by this software (still working
> around kludges in buggy dvdrecord SCSI driver software before it will 
> work on my DVDRam system) - and was curious if the FreeBSD has 
> something like this or an equivalent?  Or whether it would be good
> to adapt mondoarchive for FreeBSD)
> 
> Have been testing on a new system before it goes live - and it only
> takes around 10 minutes to do a system restore from the 2 CDs - and 
> you get everything back as it was just as you archived it.
> (and around 10 minutes to create the ISO images - don't have a CDR
> on this system)

It would probably be quite easy to knock something together using
mtree and pax. You can easily create distribution lists with mtree.

For example, I run the following command:

$ mtree -Pcix -K md5digest -p /bin

This gives me the following output:

/*/ start paste /*/
#	   user: dom
#	machine: oxygen
#	   tree: /bin
#	   date: Sat May 11 16:56:09 2002

# .
/set type=file uid=0 gid=0 mode=0555 nlink=1 flags=none
.   type=dir mode=0755 nlink=2 size=1024 time=1018707986.0
    [   nlink=2 size=51944 time=1018707985.0 \
        md5digest=55f13ce1b340824a9e3a5972b953ded5
    cat size=65912 time=1018707973.0 \
        md5digest=fd0f1dc13f9fe4506b99d297cb451357
    chio            size=58412 time=1018707974.0 \
        md5digest=79e0907b13ebe9f61ed0bc4273550177
    chmod           size=63984 time=1018707974.0 \
        md5digest=6e3af6f07c2e4fecacc3ec7077bd7ba7
    cp  size=67292 time=1018707974.0 \
        md5digest=617e3e15d6c96f00da72863c80eb1ced
    csh nlink=2 size=640720 time=1018707985.0 \
        md5digest=4611e55295d4c8e41e23581b170d8874
    date            size=185600 time=1018707975.0 \
        md5digest=0ed9b38bbab5eb3c7276ca7b849f048b
    dd  size=76736 time=1018707975.0 \
        md5digest=88ce109c9651f45ed52b56f42d50871f
    df  size=60740 time=1018707975.0 \
        md5digest=ac6337d928dc9b0f59636d8b899eb857
    domainname      size=48276 time=1018707975.0 \
        md5digest=b605cef8818102c0085ec36797815acd
    echo            size=44876 time=1018707976.0 \
        md5digest=d5a7bc359334c5aaa4c48800b905b46a
    ed  nlink=2 size=141132 time=1018707976.0 \
        md5digest=a16ec3e71925626aa9dda5de5235c378
    expr            size=100788 time=1018707977.0 \
        md5digest=8c549a6785b7243b8e614fb53f814110
    hostname        size=48372 time=1018707977.0 \
        md5digest=dc6d643dedfb9639e5835a341e402d8d
    kill            size=50068 time=1018707977.0 \
        md5digest=96cd54c1fc32873520e7b07cd0599743
    link            nlink=2 size=49684 time=1018707977.0 \
        md5digest=2d0ffd15162d07c454d6d7bea95c6b27
    ln  nlink=2 size=49684 time=1018707977.0 \
        md5digest=2d0ffd15162d07c454d6d7bea95c6b27
    ls  size=298744 time=1018707978.0 \
        md5digest=cbed22f3cb36e14d44c24601f265a724
    mkdir           size=51548 time=1018707978.0 \
        md5digest=a869a019d3bd184a7eb2ecade3facb36
    mv  size=172836 time=1018707980.0 \
        md5digest=16fc2ee52713456c19abb4fb93019edf
    pax size=288000 time=1018707981.0 \
        md5digest=4c976b1bbb0b5636844c757254322f15
    ps  size=214032 time=1018707981.0 \
        md5digest=14572f293ead5b441e05399bbc1741cf
    pwd nlink=2 size=58064 time=1018707982.0 \
        md5digest=365193f9ab653c73e2f8a37bb16e57a5
    rcp mode=04555 size=245160 time=1018707982.0 \
        md5digest=74e5d2102548cba61c9a698e17d460b6 flags=schg
    realpath        nlink=2 size=58064 time=1018707982.0 \
        md5digest=365193f9ab653c73e2f8a37bb16e57a5
    red nlink=2 size=141132 time=1018707976.0 \
        md5digest=a16ec3e71925626aa9dda5de5235c378
    rm  nlink=2 size=174936 time=1018707983.0 \
        md5digest=4350bf2453088f9b2e3bd8339b1cf3cb
    rmail           size=58576 time=1018707986.0 \
        md5digest=6f3aadb5684c921b9611dbc672ae7764
    rmdir           size=47484 time=1018707983.0 \
        md5digest=23248d1dcbf1341179cc1332c6e52ac3
    sh  size=454176 time=1018707984.0 \
        md5digest=df42231d5b83c4fa306cf2d7511f9302
    sleep           size=46160 time=1018707984.0 \
        md5digest=cd22d05eceab836003b81db4def90c84
    stty            size=72108 time=1018707984.0 \
        md5digest=0d502f94099f10d22a001003f9c9b1be
    sync            size=12752 time=1018707984.0 \
        md5digest=990960ac6f9004797999a52b21faa554
    tcsh            nlink=2 size=640720 time=1018707985.0 \
        md5digest=4611e55295d4c8e41e23581b170d8874
    test            nlink=2 size=51944 time=1018707985.0 \
        md5digest=55f13ce1b340824a9e3a5972b953ded5
    unlink          nlink=2 size=174936 time=1018707983.0 \
        md5digest=4350bf2453088f9b2e3bd8339b1cf3cb
..
/*/ end paste /*/

I can use this data to check the integrity of /bin and its contents at
any time. When you create these distribution lists you also compile an
archive using pax. You could build such a pax archive with:

$ pax -pe -zvwf ~/bin.pax.gz /bin

You can see pax preserves all the relevant information about the files
in its archive:

$ pax -zvf ~/bin.pax.gz
drwxr-xr-x 2 root wheel      0 Apr 13 15:26 /bin
-r-xr-xr-x 1 root wheel  65912 Apr 13 15:26 /bin/cat
-r-xr-xr-x 1 root wheel  58412 Apr 13 15:26 /bin/chio
-r-xr-xr-x 1 root wheel  63984 Apr 13 15:26 /bin/chmod
-r-xr-xr-x 1 root wheel  67292 Apr 13 15:26 /bin/cp
-r-xr-xr-x 1 root wheel 185600 Apr 13 15:26 /bin/date
-r-xr-xr-x 1 root wheel  76736 Apr 13 15:26 /bin/dd
-r-xr-xr-x 1 root wheel  60740 Apr 13 15:26 /bin/df
-r-xr-xr-x 1 root wheel  48276 Apr 13 15:26 /bin/domainname
-r-xr-xr-x 1 root wheel  44876 Apr 13 15:26 /bin/echo
-r-xr-xr-x 1 root wheel 100788 Apr 13 15:26 /bin/expr
-r-xr-xr-x 1 root wheel  48372 Apr 13 15:26 /bin/hostname
-r-xr-xr-x 1 root wheel  50068 Apr 13 15:26 /bin/kill
-r-xr-xr-x 1 root wheel  49684 Apr 13 15:26 /bin/ln
-r-xr-xr-x 2 root wheel      0 Apr 13 15:26 /bin/link == /bin/ln
-r-xr-xr-x 1 root wheel 298744 Apr 13 15:26 /bin/ls
-r-xr-xr-x 1 root wheel  51548 Apr 13 15:26 /bin/mkdir
-r-xr-xr-x 1 root wheel 172836 Apr 13 15:26 /bin/mv
-r-xr-xr-x 1 root wheel 288000 Apr 13 15:26 /bin/pax
-r-xr-xr-x 1 root wheel 214032 Apr 13 15:26 /bin/ps
-r-xr-xr-x 1 root wheel  58064 Apr 13 15:26 /bin/pwd
-r-xr-xr-x 2 root wheel      0 Apr 13 15:26 /bin/realpath == /bin/pwd
-r-sr-xr-x 1 root wheel 245160 Apr 13 15:26 /bin/rcp
-r-xr-xr-x 1 root wheel 174936 Apr 13 15:26 /bin/rm
-r-xr-xr-x 2 root wheel      0 Apr 13 15:26 /bin/unlink == /bin/rm
-r-xr-xr-x 1 root wheel  47484 Apr 13 15:26 /bin/rmdir
-r-xr-xr-x 1 root wheel 454176 Apr 13 15:26 /bin/sh
-r-xr-xr-x 1 root wheel  46160 Apr 13 15:26 /bin/sleep
-r-xr-xr-x 1 root wheel  72108 Apr 13 15:26 /bin/stty
-r-xr-xr-x 1 root wheel  12752 Apr 13 15:26 /bin/sync
-r-xr-xr-x 1 root wheel  51944 Apr 13 15:26 /bin/test
-r-xr-xr-x 2 root wheel      0 Apr 13 15:26 /bin/[ == /bin/test
-r-xr-xr-x 1 root wheel 640720 Apr 13 15:26 /bin/csh
-r-xr-xr-x 2 root wheel      0 Apr 13 15:26 /bin/tcsh == /bin/csh
-r-xr-xr-x 1 root wheel  58576 Apr 13 15:26 /bin/rmail
-r-xr-xr-x 1 root wheel 141132 Apr 13 15:26 /bin/ed
-r-xr-xr-x 2 root wheel      0 Apr 13 15:26 /bin/red == /bin/ed
pax: ustar vol 1, 37 files, 3983360 bytes read, 0 bytes written.

If mtree found that /bin/pwd did not match the distribution listing
you could replace it with the binary held in the archive with the
following command:

# pax -pe -vzrf bin.pax.gz /bin/pwd
/bin/pwd
pax: ustar vol 1, 37 files, 3983360 bytes read, 0 bytes written.

(The 0 bytes written can be confusing. It means, no bytes written to
the archive. Not, no bytes written to the filesystem).

In summary: FreeBSD contains lots of really cool tools for restoring a
machine rapidly in the base system, but I don't know of anything
"pre-baked" so to speak. Creating something like this wouldn't be too
hard though. Any other list occupants interested ?

Also, I completedly avoided investigating the complexities of handling
hard and soft links correctly.

> Lachlan.
> 
> -----------------------
> Lachlan M. D. Cranswick

<snip/>

Thanks!
-- 
Dominic




More information about the Ukfreebsd mailing list