Complete test for bacula http://bacula.org/rel-manual/Testing_Your_Tape_Drive.html ---------- Tape reader root@FortCigogne:~# uname -a Linux FortCigogne 2.6.15-27-server #1 SMP Sat Sep 16 02:57:21 UTC 2006 i686 GNU/Linux root@FortCigogne:~# dmesg [...] [12643.800813] SCSI subsystem initialized [12643.885487] Configuring Adaptec (SCSI-ID 7) at IO:230, IRQ 11, DMA priority 5 [12643.886867] scsi0 : Adaptec 1542 [12643.887258] isa bounce pool size: 16 pages [12644.289096] Vendor: SCANNER Model: Rev: 2.03 [12644.289203] Type: Scanner ANSI SCSI revision: 01 CCS [12644.399348] 0:0:1:0: Attached scsi generic sg0 type 6 [12645.494004] Vendor: HP Model: C1537A Rev: L708 [12645.494108] Type: Sequential-Access ANSI SCSI revision: 02 [12645.494523] 0:0:6:0: Attached scsi generic sg1 type 1 [12645.671950] st: Version 20050830, fixed bufsize 32768, s/g segs 256 [12645.672980] st 0:0:6:0: Attached scsi tape st0<4>st0: try direct i/o: no (alignment 512 B), max page reachable by HBA 4095 [12655.228333] st0: Block limits 1 - 16777215 bytes. ---------- Test btape Version: 1.36.3 (22 April 2005) root@FortCigogne:~# btape -c /etc/bacula/bacula-sd.conf /dev/st0 Tape block granularity is 1024 bytes. btape: butil.c:258 Using device: "/dev/st0" for writing. btape: btape.c:335 open_dev /dev/st0 OK *test === Write, rewind, and re-read test === I'm going to write 1000 records and an EOF then write 1000 records and an EOF, then rewind, and re-read the data to verify that it is correct. This is an *essential* feature ... btape: btape.c:786 Wrote 1000 blocks of 64412 bytes. btape: btape.c:465 Wrote 1 EOF to /dev/st0 btape: btape.c:802 Wrote 1000 blocks of 64412 bytes. btape: btape.c:465 Wrote 1 EOF to /dev/st0 btape: btape.c:811 Rewind OK. 1000 blocks re-read correctly. Got EOF on tape. 1000 blocks re-read correctly. === Test Succeeded. End Write, rewind, and re-read test === === Write, rewind, and position test === I'm going to write 1000 records and an EOF then write 1000 records and an EOF, then rewind, and position to a few blocks and verify that it is correct. This is an *essential* feature ... btape: btape.c:898 Wrote 1000 blocks of 64412 bytes. btape: btape.c:465 Wrote 1 EOF to /dev/st0 btape: btape.c:914 Wrote 1000 blocks of 64412 bytes. btape: btape.c:465 Wrote 1 EOF to /dev/st0 btape: btape.c:923 Rewind OK. Reposition to file:block 0:4 Block 5 re-read correctly. Reposition to file:block 0:200 Block 201 re-read correctly. Reposition to file:block 0:999 Block 1000 re-read correctly. Reposition to file:block 1:0 Block 1001 re-read correctly. Reposition to file:block 1:600 Block 1601 re-read correctly. Reposition to file:block 1:999 Block 2000 re-read correctly. === Test Succeeded. End Write, rewind, and re-read test === === Append files test === This test is essential to Bacula. I'm going to write one record in file 0, two records in file 1, and three records in file 2 btape: btape.c:435 Rewound /dev/st0 btape: btape.c:1505 Wrote one record of 64412 bytes. btape: btape.c:1507 Wrote block to device. btape: btape.c:465 Wrote 1 EOF to /dev/st0 btape: btape.c:1505 Wrote one record of 64412 bytes. btape: btape.c:1507 Wrote block to device. btape: btape.c:1505 Wrote one record of 64412 bytes. btape: btape.c:1507 Wrote block to device. btape: btape.c:465 Wrote 1 EOF to /dev/st0 btape: btape.c:1505 Wrote one record of 64412 bytes. btape: btape.c:1507 Wrote block to device. btape: btape.c:1505 Wrote one record of 64412 bytes. btape: btape.c:1507 Wrote block to device. btape: btape.c:1505 Wrote one record of 64412 bytes. btape: btape.c:1507 Wrote block to device. btape: btape.c:465 Wrote 1 EOF to /dev/st0 btape: btape.c:335 open_dev /dev/st0 OK btape: btape.c:435 Rewound /dev/st0 btape: btape.c:1052 Now moving to end of medium. btape: btape.c:482 Moved to end of medium. We should be in file 3. I am at file 3. This is correct! Now the important part, I am going to attempt to append to the tape. btape: btape.c:1505 Wrote one record of 64412 bytes. btape: btape.c:1507 Wrote block to device. btape: btape.c:465 Wrote 1 EOF to /dev/st0 btape: btape.c:435 Rewound /dev/st0 Done appending, there should be no I/O errors Doing Bacula scan of blocks: 1 block of 64448 bytes in file 1 End of File mark. 2 blocks of 64448 bytes in file 2 End of File mark. 3 blocks of 64448 bytes in file 3 End of File mark. 1 block of 64448 bytes in file 4 End of File mark. Total files=4, blocks=7, bytes = 451,136 End scanning the tape. We should be in file 4. I am at file 4. This is correct! The above Bacula scan should have output identical to what follows. Please double check it ... === Sample correct output === 1 block of 64448 bytes in file 1 End of File mark. 2 blocks of 64448 bytes in file 2 End of File mark. 3 blocks of 64448 bytes in file 3 End of File mark. 1 block of 64448 bytes in file 4 End of File mark. Total files=4, blocks=7, bytes = 451,136 === End sample correct output === If the above scan output is not identical to the sample output, you MUST correct the problem or Bacula will not be able to write multiple Jobs to the tape. === Write, backup, and re-read test === I'm going to write three records and an EOF then backup over the EOF and re-read the last record. Bacula does this after writing the last block on the tape to verify that the block was written correctly. This is not an *essential* feature ... btape: btape.c:435 Rewound /dev/st0 btape: btape.c:665 Wrote first record of 64412 bytes. btape: btape.c:676 Wrote second record of 64412 bytes. btape: btape.c:687 Wrote third record of 64412 bytes. btape: btape.c:465 Wrote 1 EOF to /dev/st0 btape: btape.c:703 Backspaced over EOF OK. btape: btape.c:708 Backspace record OK. btape: btape.c:726 Block re-read correct. Test succeeded! === End Write, backup, and re-read test === === Forward space files test === This test is essential to Bacula. I'm going to write five files then test forward spacing btape: btape.c:435 Rewound /dev/st0 btape: btape.c:1505 Wrote one record of 64412 bytes. btape: btape.c:1507 Wrote block to device. btape: btape.c:465 Wrote 1 EOF to /dev/st0 btape: btape.c:1505 Wrote one record of 64412 bytes. btape: btape.c:1507 Wrote block to device. btape: btape.c:1505 Wrote one record of 64412 bytes. btape: btape.c:1507 Wrote block to device. btape: btape.c:465 Wrote 1 EOF to /dev/st0 btape: btape.c:1505 Wrote one record of 64412 bytes. btape: btape.c:1507 Wrote block to device. btape: btape.c:1505 Wrote one record of 64412 bytes. btape: btape.c:1507 Wrote block to device. btape: btape.c:1505 Wrote one record of 64412 bytes. btape: btape.c:1507 Wrote block to device. btape: btape.c:465 Wrote 1 EOF to /dev/st0 btape: btape.c:1505 Wrote one record of 64412 bytes. btape: btape.c:1507 Wrote block to device. btape: btape.c:1505 Wrote one record of 64412 bytes. btape: btape.c:1507 Wrote block to device. btape: btape.c:465 Wrote 1 EOF to /dev/st0 btape: btape.c:1505 Wrote one record of 64412 bytes. btape: btape.c:1507 Wrote block to device. btape: btape.c:465 Wrote 1 EOF to /dev/st0 btape: btape.c:435 Rewound /dev/st0 btape: btape.c:1266 Now forward spacing 1 file. We should be in file 1. I am at file 1. This is correct! btape: btape.c:1278 Now forward spacing 2 files. We should be in file 3. I am at file 3. This is correct! btape: btape.c:435 Rewound /dev/st0 btape: btape.c:1291 Now forward spacing 4 files. We should be in file 4. I am at file 4. This is correct! btape: btape.c:1309 Now forward spacing 1 more file. We should be in file 5. I am at file 5. This is correct! === End Forward space files test === *fill This command simulates Bacula writing to a tape. It requires either one or two blank tapes, which it will label and write. If you have an autochanger configured, it will use the tapes that are in slots 1 and 2, otherwise, you will be prompted to insert the tapes when necessary. It will print a status approximately every 322 MB, and write an EOF every 3.2 GB. If you have selected the simple test option, after writing the first tape it will rewind it and re-read the last block written. If you have selected the multiple tape test, when the first tape fills, it will ask for a second, and after writing a few more blocks, it will stop. Then it will begin re-reading the two tapes. This may take a long time -- hours! ... Do you want to run the simplified test (s) with one tape or the complete multiple tape (m) test: (s/m) m Multiple tape test selected. 26-Nov 22:13 btape: btape Warning: Requested Volume "TestVolume1" on /dev/st0 is not a Bacula labeled Volume, because: ERR=block.c:793 Read zero bytes at 0:0 on device /dev/st0. 26-Nov 22:13 btape: btape Error: mount.c:485 Hey!!!!! WroteVol non-zero !!!!! Mount blank Volume on device /dev/st0 and press return when ready: Wrote Volume label for volume "TestVolume1". block.c:793 Read zero bytes at 0:0 on device /dev/st0. Mount Volume "TestVolume1" on device /dev/st0 and press return when ready: 26-Nov 22:14 btape: Wrote label to prelabeled Volume "TestVolume1" on device "/dev/st0" Wrote Start of Session label. Begin writing Bacula records to first tape ... Wrote blk_block=5000, dev_blk_num=5000 VolBytes=322,495,473 rate=773.4 KB/s Wrote blk_block=10000, dev_blk_num=10000 VolBytes=645,055,425 rate=775.3 KB/s Wrote blk_block=15000, dev_blk_num=15000 VolBytes=967,615,369 rate=768.6 KB/s Flush block, write EOF Wrote blk_block=20000, dev_blk_num=5000 VolBytes=1,290,175,313 rate=770.3 KB/s Wrote blk_block=25000, dev_blk_num=10000 VolBytes=1,612,735,265 rate=759.3 KB/s Wrote blk_block=30000, dev_blk_num=15000 VolBytes=1,935,295,209 rate=735.6 KB/s Flush block, write EOF Wrote blk_block=35000, dev_blk_num=5000 VolBytes=2,257,855,161 rate=721.6 KB/s Wrote blk_block=40000, dev_blk_num=10000 VolBytes=2,580,415,105 rate=709.1 KB/s Wrote blk_block=45000, dev_blk_num=15000 VolBytes=2,902,975,049 rate=696.8 KB/s Flush block, write EOF Wrote blk_block=50000, dev_blk_num=5000 VolBytes=3,225,535,001 rate=667.5 KB/s Wrote blk_block=55000, dev_blk_num=10000 VolBytes=3,548,094,945 rate=639.0 KB/s Wrote blk_block=60000, dev_blk_num=15000 VolBytes=3,870,654,889 rate=648.1 KB/s Flush block, write EOF Wrote blk_block=65000, dev_blk_num=5000 VolBytes=4,193,214,841 rate=655.3 KB/s Wrote blk_block=70000, dev_blk_num=10000 VolBytes=4,515,774,785 rate=661.7 KB/s Wrote blk_block=75000, dev_blk_num=15000 VolBytes=4,838,334,737 rate=668.0 KB/s Flush block, write EOF Wrote blk_block=80000, dev_blk_num=5000 VolBytes=5,160,894,681 rate=673.7 KB/s Wrote blk_block=85000, dev_blk_num=10000 VolBytes=5,483,454,625 rate=677.8 KB/s Wrote blk_block=90000, dev_blk_num=15000 VolBytes=5,806,014,577 rate=681.6 KB/s Flush block, write EOF Wrote blk_block=95000, dev_blk_num=5000 VolBytes=6,128,574,521 rate=683.8 KB/s Wrote blk_block=100000, dev_blk_num=10000 VolBytes=6,451,134,473 rate=686.7 KB/s Wrote blk_block=105000, dev_blk_num=15000 VolBytes=6,773,694,417 rate=686.0 KB/s Flush block, write EOF Wrote blk_block=110000, dev_blk_num=5000 VolBytes=7,096,254,361 rate=685.8 KB/s Wrote blk_block=115000, dev_blk_num=10000 VolBytes=7,418,814,313 rate=686.7 KB/s Wrote blk_block=120000, dev_blk_num=15000 VolBytes=7,741,374,257 rate=688.6 KB/s Flush block, write EOF Wrote blk_block=125000, dev_blk_num=5000 VolBytes=8,063,934,209 rate=691.0 KB/s Wrote blk_block=130000, dev_blk_num=10000 VolBytes=8,386,494,153 rate=694.1 KB/s Wrote blk_block=135000, dev_blk_num=15000 VolBytes=8,709,054,097 rate=696.7 KB/s Flush block, write EOF Wrote blk_block=140000, dev_blk_num=5000 VolBytes=9,031,614,049 rate=697.7 KB/s 27-Nov 01:50 btape: End of Volume "TestVolume1" at 9:5438 on device /dev/st0. Write of 64512 bytes got -1. 27-Nov 01:51 btape: Re-read of last block succeeded. btape: btape.c:2236 Last block at: 9:5437 this_dev_block_num=5438 btape: btape.c:2270 End of tape 9:0. VolumeCapacity=9,059,934,809. Write rate = 697.5 KB/s 27-Nov 01:51 btape: End of medium on Volume "TestVolume1" Bytes=9,059,934,809 Blocks=140,438 at 27-Nov-2006 01:51. Mount blank Volume on device /dev/st0 and press return when ready: Wrote Volume label for volume "TestVolume2". block.c:793 Read zero bytes at 0:0 on device /dev/st0. Mount second Volume on device /dev/st0 and press return when ready: 27-Nov 01:54 btape: Wrote label to prelabeled Volume "TestVolume2" on device "/dev/st0" 27-Nov 01:54 btape: New volume "TestVolume2" mounted on device /dev/st0 at 27-Nov-2006 01:54. Done writing ... Wrote End of Session label. Wrote state file last_block_num1=5437 last_block_num2=11 Done filling tapes at 0:13. Now beginning re-read of first tape ... Mount first tape. Press enter when ready: 27-Nov 01:57 btape: Ready to read from volume "TestVolume1" on device /dev/st0. Reading the first 1000 records. 1000 records read now at 0:509 Reposition from 0:509 to 9:5437 Reading block 5437. The last block of the first tape matches. Mount second tape. Press enter when ready: 27-Nov 02:04 btape: Ready to read from volume "TestVolume2" on device /dev/st0. Reposition from 0:0 to 0:1 Reading block 1. The first block on the second tape matches. Reposition from 0:2 to 0:11 Reading block 11. The last block on the second tape matches. Test succeeded.