From mrc@mailgate.imagination.co.uk  Wed Nov 13 09:16:38 2002
Return-Path: <mrc@mailgate.imagination.co.uk>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 745DA37B401
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 13 Nov 2002 09:16:38 -0800 (PST)
Received: from mailgate.imagination.co.uk (mailgate.imagination.co.uk [212.140.144.32])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 2344F43E75
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 13 Nov 2002 09:16:36 -0800 (PST)
	(envelope-from mrc@mailgate.imagination.co.uk)
Received: (from mrc@localhost)
	by mailgate.imagination.co.uk (8.9.3/8.9.3) id RAA77587;
	Wed, 13 Nov 2002 17:16:24 GMT
Message-Id: <200211131716.RAA77587@mailgate.imagination.co.uk>
Date: Wed, 13 Nov 2002 17:16:24 GMT
From: Mike Curtis <mrc@imagination.com>
To: FreeBSD-gnats-submit@freebsd.org
Subject:

>Number:         45272
>Category:       bin
>Synopsis:       dump(8) / restore(8) problem
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    jh
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Nov 13 09:20:00 PST 2002
>Closed-Date:    Sun Jul 03 07:34:50 UTC 2011
>Last-Modified:  Sun Jul 03 07:34:50 UTC 2011
>Originator:     
>Release:        
>Organization:
>Environment:
>Description:

I have a RAID enclosure with 2 x 600Gbyte logical drives. I use one for the
company's work, and the other as a 'spare' of sorts. 

Backup of work is obviously my prime concern.

I'm using dump to create multiple 35Gbyte files on the 'spare' disk at night,
then cut these files to DLT tape during the day.

I do this for two reasons:

i) Since 95% of our restores are for 'stupidity recovery', it makes sense to
dump them 'close by' and then restore any 'lost' files interactively using
restore -v -i -f .....

ii) This spare-disk method gives me a week's window in which to cut (using dd
 - haven't got that far yet because of this bug) at the very least Friday's
multiple 'full' dump files to the DLT, without the need for an expensive
autochanger or jukebox affair.

Dump appears to work fine. However, interactive restore fails across these
multiple dump files.

>How-To-Repeat:

Repeatable known-bad example:

get virgin file system eg /dev/da1s1a
mount it on eg /mnt
make four files on it like this:
        mount /dev/da1s1a
        cd /mnt
        dd if=/dev/urandom of=hello1 bs=1k count=1k
        dd if=/dev/urandom of=hello2 bs=1k count=1k
        dd if=/dev/urandom of=hello3 bs=1k count=1k
        dd if=/dev/urandom of=hello4 bs=1k count=1k
        umount /mnt

Make the dump:

        cd /tmp/testdump
        dump -0 -B 2048 -f 1,2,3,4 /dev/da1s1a

this makes four dump format files

when you try to restore it goes wrong:
        restore -i -v -f 1
        restore > ls
        ... 5 hello3 ...
        restore > add hello3
        restore > extract

If we try the restore in order:
        Specify next volume: 1
        (tape name) 1

        2
        2
We get this error:
        resync restore, skipped 51 blocks

        3
        3

You don't get your file back!

hello3 starts somewhere in file '2'

I believe that the bug is in restore rather than dump because
if you do

        cat 1 2 3 > 123
        restore -i -v -f 123

you can get your file 'hello3' back; however, I don't want to
waste any time potentially having to cat multiple 35Gbyte files
together in an emergency, plus further testing of this produced
differing results.

Here's the script I actually use:

# dodiffbakdisk1
# 7-day differential backups using dump, full on Saturday
# mrc/imagination/06.08.2002

set -e
set -x

DOW=`/bin/date -u +%A`
STAMP="`/bin/date -u +%Y%m%d%H%M%S`__$$"
TAG=dodiffbakdisk1
DUMP=/sbin/dump
DATE=`/bin/date -u +%Y%m%d%H%M%S`
BACKMEUP=/disk/1

# mrc/imagination/23.10.2002: specify multiple 35Gbyte volumes, dump only uses
#       as many as it needs. Filesystem is 600Gbytes, so need 18:

BACKUPFILE="bigbox__disk_1__${DATE}_dump.1,bigbox__disk_1__${DATE}_dump.2,\
bigbox__disk_1__${DATE}_dump.3,bigbox__disk_1__${DATE}_dump.4,\
bigbox__disk_1__${DATE}_dump.5,bigbox__disk_1__${DATE}_dump.6,\
bigbox__disk_1__${DATE}_dump.7,bigbox__disk_1__${DATE}_dump.8,\
bigbox__disk_1__${DATE}_dump.9,bigbox__disk_1__${DATE}_dump.10,\
bigbox__disk_1__${DATE}_dump.11,bigbox__disk_1__${DATE}_dump.12,\
bigbox__disk_1__${DATE}_dump.13,bigbox__disk_1__${DATE}_dump.14,\
bigbox__disk_1__${DATE}_dump.15,bigbox__disk_1__${DATE}_dump.16,\
bigbox__disk_1__${DATE}_dump.17,bigbox__disk_1__${DATE}_dump.18"

OPTIONS="-u -B 36700160 -f"

case $DOW in
Saturday)       level=0;;
Sunday)         level=1;;
Monday)         level=1;;
Tuesday)        level=1;;
Wednesday)      level=1;;
Thursday)       level=1;;
Friday)         level=1;;
*)              exit 1;;
esac

CMD="$DUMP -$level $OPTIONS $BACKUPFILE $BACKMEUP"

logger -t $TAG start $STAMP
$CMD > /tmp/log/dump__$STAMP 2>&1
logger -t $TAG stop $STAMP

# end

>Fix:

Don't know, need help.

Our version of restore has tape.c 1.16.2.6 2001/08/01

.... and it looks like there may be an issue with this already:


http://www.freebsd.org/cgi/cvsweb.cgi/src/sbin/restore/tape.c.diff?r1=1.16.2.6&r2=1.16.2.7&only_with_tag=RELENG_4&f=h

Any help much appreciated: big project deadline looming, can't finish without
multiple test bare-metal recoveries!!!


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: gnats-admin->freebsd-bugs 
Responsible-Changed-By: tom 
Responsible-Changed-When: Tue Nov 19 07:46:18 PST 2002 
Responsible-Changed-Why:  
Misfiled dump(8) PR 

http://www.freebsd.org/cgi/query-pr.cgi?pr=45272 
State-Changed-From-To: open->feedback 
State-Changed-By: jh 
State-Changed-When: Sun May 29 13:56:15 UTC 2011 
State-Changed-Why:  
I couldn't reproduce this on 8.2? Can you still reproduce the problem? 


Responsible-Changed-From-To: freebsd-bugs->jh 
Responsible-Changed-By: jh 
Responsible-Changed-When: Sun May 29 13:56:15 UTC 2011 
Responsible-Changed-Why:  
Track. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=45272 
State-Changed-From-To: feedback->closed 
State-Changed-By: jh 
State-Changed-When: Sun Jul 3 07:34:46 UTC 2011 
State-Changed-Why:  
Feedback timeout. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=45272 
>Unformatted:
         
 
