Problems with dump and restore

Roland Smith rsmith at xs4all.nl
Tue Aug 12 20:07:49 UTC 2014


On Tue, Aug 12, 2014 at 04:48:17PM -0300, Andrew Hamilton-Wright wrote:
> 
> > This is mentioned in the restore's manpage;
> >
> >     expected next file <inumber>, got <inumber>
> >             A file that was not listed in the directory showed up.  This can
> >             occur when using a dump created on an active file system.
> 
> True, but my understanding of snapshots is that it is supposed to
> eliminate exactly this problem, no?

Yes, it should. But while UFS is old and mature and one would expect most bugs
to be fixed by now, relatively new additions like SU+J will probably have more
bugs. (No slight to the maintainers intended, BTW! FreeBSD is generally
rock-solid in my experience)

> >> Some questions then:
> >> - is anyone else using dump/restore as their main backup method?
> >
> > Yes, operating system filesystems like /, /usr and /var, which can contain
> > flags and hard links and such. These filesystem's aren't all that big, so
> > dumps are relatively quick.
> 
> What options are you using?  Are you using dumplevels?

Generally I only use level 0 dumps for ease of restore. I use the following
script to make dumps from single user mode. To save on disk space I don't dump
those parts of /usr that can be easily downloaded, like src and ports. This is
accomplished by setting ‘nodump’ flags and using dump's ‘-h 0’ option.

Note that I've put /tmp on a separate filesystem; I need someplace to store
the dumps on. :-)

    #!/bin/sh
    # Shell script to perform dumps on all important filesystems.
    # This script is designed to run under single-user mode from /root.
    #
    # Author: R.F. Smith <rsmith at xs4all.nl>
    # $Date: 2014-04-13 20:05:32 +0200 $
    #
    # To the extent possible under law, Roland Smith has waived all copyright and
    # related or neighboring rights to dodumps. This work is published from the
    # Netherlands. See http://creativecommons.org/publicdomain/zero/1.0/

    export PATH=/sbin:/bin:/rescue
    export DDATE=$(date "+%Y%m%d")
    export DLVL=0
    export DDIR=/tmp

    # Enumerate the mount points to dump.
    MNTS="/ /usr /var"

    echo -n "Setting nodump flags..."
    chflags nodump /usr/obj /usr/ports /usr/src /usr/local/texlive/2013
    echo "done."
    echo -n "Unmounting filesystems before dumping..."
    cd /root
    mount -u -r /
    umount -f /usr
    umount -f /var
    echo "done."

    echo "Performing level "$DLVL" dump for mount points "$MNTS"."
    for p in $MNTS; do
        case $p in
            '/') export FSNAME=/root;;
            *) export FSNAME=${p};;
        esac
        OUTF=${DDIR}${FSNAME}-${DLVL}-${DDATE}.dump
        # Set the dump command options.
        echo "Dumping $p to $OUTF"
        DCMD="dump -${DLVL} -a -b 64 -C 32 -R -h 0 -f ${OUTF} "
        $DCMD $p
    done
    echo "Done making dumps."

    echo -n "Re-mounting filesystems after dumping..."
    mount -u -w /
    mount /usr
    mount /var
    echo "done."

> >> - does anyone have any advice that may help determine what may have
> >>    gone wrong?
> >
> > Try using restore's “degraded” mode (using the ‘-D’ option) and use the ‘-y’
> > option.
> 
> I have started that running on a scratch device, and will report back with
> results.

Good luck!


Roland
-- 
R.F.Smith                                   http://rsmith.home.xs4all.nl/
[plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
pgp: 5753 3324 1661 B0FE 8D93  FCED 40F6 D5DC A38A 33E0 (keyID: A38A33E0)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20140812/9d95bea4/attachment.sig>


More information about the freebsd-questions mailing list