Dear list...

I had a hard disk crash three days ago and I was pretty happy everything
is on tape. Then I found out the database backup job didn't work
properly so that my catalog is unusable.

My straightforward procedure was to clear the bacula database, create it
from scratch and start 'bscan'ning the last tapes that include the last
full backup and the incremental updates. But this doesn't work (tm) as
expected.

I stopped the bacula-sd process (because it occupied the streamer) and ran:

/usr/lib/bacula/bscan.mysql -c /etc/bacula/bacula-sd.conf -v -s -m -P
mysecretpassword -V bacula10 /dev/nst0

The output (with my comments):

bscan: butil.c:258 Using device: "/dev/nst0" for reading.
26-Jun 09:43 bscan: Ready to read from volume "bacula10" on device /dev/nst0.
bscan: bscan.c:274 Using Database: bacula, User: bacula
bscan: bscan.c:403 Pool record for DefaultPool found in DB.
bscan: bscan.c:417 Pool type "Backup" is OK.
bscan: bscan.c:427 Media record for bacula10 found in DB.
bscan: bscan.c:445 Media type "DDS-3" is OK.
bscan: bscan.c:454 VOL_LABEL: OK for Volume: bacula10
26-Jun 09:56 bscan: Got EOF at file 1  on device /dev/nst0, Volume "bacula10"
bscan: bscan.c:907 Fileset "" already exists.

-> Is this okay? An empty file set?

bscan: bscan.c:546 Could not find SessId=1 SessTime=1118389778 for EOS record.

-> Oops?

26-Jun 10:01 bscan: Got EOF at file 2  on device /dev/nst0, Volume "bacula10"
bscan: bscan.c:462 105391 "errors" ignored before first Start of Session record.
bscan: bscan.c:472 SOS_LABEL: Found Job record for JobId: 0
26-Jun 10:15 bscan: Got EOF at file 3  on device /dev/nst0, Volume "bacula10"
bscan: bscan.c:907 Fileset "Full Set" already exists.
bscan: bscan.c:1022 Could not update JobId=35 record. ERR=sql_update.c:166 
Update problem: affected_rows=0

-> I found the query in the database:

        UPDATE Job SET JobStatus='T', EndTime='2005- 06-16 08:08:12',
        ClientId=NULL, JobBytes=471806485, JobFiles=3380, JobErrors=0,
        VolSessionId=3, VolSessionTime=1118389778, PoolId=1, FileSetId=2,
        JobTDate=11189 02092 WHERE JobId=36

        Indeed: JobId 36 doesn't exist. Just 1, 2, 3, 4 and 5.
        So this had to fail.

bscan: bscan.c:1121 Created JobMedia record JobId 35, MediaId 1
26-Jun 10:21 bscan: Got EOF at file 4  on device /dev/nst0, Volume "bacula10"
bscan: bscan.c:472 SOS_LABEL: Found Job record for JobId: 0
bscan: bscan.c:907 Fileset "Full Set" already exists.
bscan: bscan.c:1022 Could not update JobId=36 record. ERR=sql_update.c:166 
Update problem: affected_rows=0

-> Same story.

bscan: bscan.c:1121 Created JobMedia record JobId 36, MediaId 1
26-Jun 10:26 bscan: Got EOF at file 5  on device /dev/nst0, Volume "bacula10"
bscan: bscan.c:472 SOS_LABEL: Found Job record for JobId: 0
26-Jun 10:40 bscan: Got EOF at file 6  on device /dev/nst0, Volume "bacula10"
bscan: bscan.c:651 32,768 file records. At file:blk=6:23,680 bytes=4,860,615,106
[...]

This is the output of "list jobs" after the bscan:

+-----+----------+-------------------+----+---+--------+-------------+---------+
|JobId|Name      |StartTime          |Type|Lvl|JobFiles|JobBytes     |JobStatus|
+-----+----------+-------------------+----+---+--------+-------------+---------+
|    1|FullWeekly|2005-06-13 08:00:04|B   |I  |  21,077|1,434,980,289|T        |
|    2|FullWeekly|2005-06-16 08:00:04|B   |I  |   3,380|471,806,485  |T        |
|    3|FullWeekly|2005-06-18 08:00:04|B   |F  | 151,298|9,813,044,114|E        |
|    4|FullWeekly|2005-06-20 08:00:04|B   |I  |   1,620|809,455,547  |T        |
|    5|FullWeekly|2005-06-23 08:00:04|B   |I  |   4,111|531,193,241  |T        |
+-----+----------+-------------------+----+---+--------+-------------+---------+

The last full backup (Job 3) has a bad JobStatus here. So I cannot
restore any files since a valid full backup is needed. Although the last
email I received from the backup system right before the crash looked
like this:

  JobId:                  37
  Job:                    FullWeekly.2005-06-18_08.00.01
  Backup Level:           Full
  Client:                 torf-fd
  FileSet:                "Full Set" 2005-05-08 16:08:28
  Pool:                   "DefaultPool"
  Storage:                "Streamer"
  Start time:             18-Jun-2005 08:00:03
  End time:               18-Jun-2005 23:12:46
  FD Files Written:       242,982
  SD Files Written:       242,982
  FD Bytes Written:       16,503,960,600
  SD Bytes Written:       16,542,577,985
  Rate:                   301.4 KB/s
  Software Compression:   None
  Volume name(s):         bacula10|bacula11
  Volume Session Id:      4
  Volume Session Time:    1118389778
  Last Volume Bytes:      6,715,098,479
  Non-fatal FD errors:    0
  SD Errors:              0
  FD termination status:  OK
  SD termination status:  OK
  Termination:            Backup OK

So the backup was okay. And I fed Bacula both the tapes bacula10 and
bacula11.

I do trust Bacula backing up my data when my catalog is intact. But
shouldn't it work reliably, too, when I restore the catalog from tape?
I also tried to bscan on the last (outdated) catalog I found but only
saw a number of "duplicate entry" errors. From my understanding it
should be no problem to bscan a tape a dozen times but actually it
seemed to try to overwrite old entries but used 'INSERT INTO ...'.

Now I used 'bextract' on the last tapes and hoped for the best. This
doesn't leave a good feeling though. Can someone shed a bit of light on
this? I'm a tiny bit scared. And I don't understand the database format
enough to debug this myself.

Thanks.

 Christoph
-- 
~
~
~
".signature" [Modified] 3 lines --100%--                3,41         All


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bacula-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to