If "mtx" is working from command line, cut and paste the following
perl script, changing parameters where necessary. That will help you
erase the tapes. Also using "dd" command is not a good thing. Make
sure Bacula processes are not running while you run this script.
HTH.
Win
-------------------------------------------- start of script
-------------------------------------------------------------------------------------
#!/usr/bin/perl
use warnings;
$changer_device = "/dev/sg7"; # Define your changer device
$tape_device = "/dev/nst0"; # Define your tape device
$tempfile = "/tmp/changer_slots.$$"; # Create a temporary file to
keep the slots index
$settle_time = "10"; # Time to allow the tape to
settle in drive
# <-- Make sure nothing is loaded in the tape device -->
`mtx -f $changer_device unload`;
# <-- Get the slot number(s) where tapes are actually loaded and store
in tempfile -->
`mtx -f $changer_device status|grep ":VolumeTag="|awk \'{print
\$3}\'|cut -d: -f1 > $tempfile`;
# <-- Read through the tempfile for each tape loaded in respective
slot and erase it -->
open (SLOTS, "$tempfile") || die "Cannot open file: $!";
while (<SLOTS>) {
print "Loading tape from slot $_...\n";
`mtx -f $changer_device load $_`;
print "Letting tape drive settle for $settle_time seconds...\n";
`sleep $settle_time`;
print "Rewinding tape ...\n";
`mt -f $tape_device rewind`;
print "Writing EOF to tape ...\n";
`mt -f $tape_device weof`;
print "Rewinding tape ...\n";
`mt -f $tape_device rewind`;
print "Unloading tape ...\n";
`mtx -f $changer_device unload $_`;
print "Done erasing tape in slot $_ !\n----------\n";
}
close (SLOTS);
unlink $tempfile;
------------------------------------- end of script
-------------------------------------------------------------
On Thu, May 7, 2009 at 12:44 PM, Hayden Katzenellenbogen
<hayden AT nextlevelinternet DOT com> wrote:
> Yvan,
>
> Could you paste a copy of your bacula-sd.conf. The device and auto changer
> sections.
>
> I have found that if I load the tape into the drive then run the fill test it
> will not give the WEOF error, but when it loads the second tape it will give
> the WEOF error.
>
> If I have any other tape in the drive before I start and btape loads tape one
> for the fill test I get the WEOF error on both the first and second tape.
>
> The btape test runs 100% including the append test. Here is a snippet of the
> last fill test I ran. I had already loaded tape 1 into the drive before
> start. I also did an erase on both tapes using John's two mt commands.
>
> Also would it make a difference that I am running this on Ubuntu 8.0.4 LTS
> and using a fiber channel drive?
>
> H
>
> root@archive:~/bacula/etc# ../bin/btape -c bacula-sd.conf /dev/nst0
> Tape block granularity is 1024 bytes.
> btape: butil.c:285 Using device: "/dev/nst0" for writing.
> 05-May 15:40 btape JobId 0: 3301 Issuing autochanger "loaded? drive 0"
> command.
> 05-May 15:40 btape JobId 0: 3302 Autochanger "loaded? drive 0", result is
> Slot 1.
> btape: btape.c:383 open device "Drive-1" (/dev/nst0): OK
> *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.
> Wrote Volume label for volume "TestVolume1".
> Wrote Start of Session label.
> 15:44:05 Begin writing Bacula records to first tape ...
> Wrote blk_block=5000, dev_blk_num=4999 VolBytes=322,495,488 rate=80623.9 KB/s
> Wrote blk_block=10000, dev_blk_num=9999 VolBytes=645,055,488 rate=92150.8 KB/s
> Wrote blk_block=15000, dev_blk_num=14999 VolBytes=967,615,488 rate=96761.5
> KB/s
> Wrote blk_block=20000, dev_blk_num=4499 VolBytes=1,290,175,488 rate=86011.7
> KB/s
> Wrote blk_block=25000, dev_blk_num=9499 VolBytes=1,612,735,488 rate=76796.9
> KB/s
> Wrote blk_block=30000, dev_blk_num=14499 VolBytes=1,935,295,488 rate=80637.3
> KB/s
>
>
> Wrote blk_block=13055000, dev_blk_num=15500 VolBytes=842,204,095,488
> rate=70625.1 KB/s
> 19:02:52 Flush block, write EOF
> Wrote blk_block=13060000, dev_blk_num=4000 VolBytes=842,526,655,488
> rate=70598.9 KB/s
> Wrote blk_block=13065000, dev_blk_num=9000 VolBytes=842,849,215,488
> rate=70608.1 KB/s
> Wrote blk_block=13070000, dev_blk_num=14000 VolBytes=843,171,775,488
> rate=70611.5 KB/s
> Wrote blk_block=13075000, dev_blk_num=3500 VolBytes=843,494,335,488
> rate=70603.0 KB/s
> Wrote blk_block=13080000, dev_blk_num=8500 VolBytes=843,816,895,488
> rate=70612.3 KB/s
> 05-May 19:03 btape JobId 0: End of Volume "TestVolume1" at 1226:13010 on
> device "Drive-1" (/dev/nst0). Write of 64512 bytes got -1.
> 05-May 19:03 btape JobId 0: Re-read of last block succeeded.
> btape: btape.c:2360 Last block at: 1226:13009 this_dev_block_num=13010
> btape: btape.c:2394 End of tape 1226:0. VolumeCapacity=844,107,844,608. Write
> rate = 70595.3 KB/s
> 05-May 19:03 btape JobId 0: End of medium on Volume "TestVolume1"
> Bytes=844,107,844,608 Blocks=13,084,509 at 05-May-2009 19:03.
> 05-May 19:03 btape JobId 0: 3307 Issuing autochanger "unload slot 1, drive 0"
> command.
> 05-May 19:04 btape JobId 0: 3301 Issuing autochanger "loaded? drive 0"
> command.
> 05-May 19:04 btape JobId 0: 3302 Autochanger "loaded? drive 0", result:
> nothing loaded.
> 05-May 19:04 btape JobId 0: 3304 Issuing autochanger "load slot 2, drive 0"
> command.
> 05-May 19:04 btape JobId 0: 3305 Autochanger "load slot 2, drive 0", status
> is OK.
> 05-May 19:04 btape: Fatal Error at dev.c:1705 because:
> dev.c:1704 Attempt to WEOF on non-appendable Volume
> Wrote Volume label for volume "TestVolume2".
> 05-May 19:04 btape JobId 0: Wrote label to prelabeled Volume "TestVolume2" on
> device "Drive-1" (/dev/nst0)
> 05-May 19:04 btape JobId 0: New volume "TestVolume2" mounted on device
> "Drive-1" (/dev/nst0) at 05-May-2009 19:04.
> Done writing 0 records ...
> Wrote End of Session label.
> Wrote state file last_block_num1=13009 last_block_num2=11
>
>
> 19:04:42 Done filling tapes at 0:13. Now beginning re-read of first tape ...
> 05-May 19:04 btape JobId 0: 3307 Issuing autochanger "unload slot 2, drive 0"
> command.
> 05-May 19:05 btape JobId 0: 3304 Issuing autochanger "load slot 1, drive 0"
> command.
> 05-May 19:05 btape JobId 0: 3305 Autochanger "load slot 1, drive 0", status
> is OK.
> 05-May 19:05 btape JobId 0: Ready to read from volume "TestVolume1" on device
> "Drive-1" (/dev/nst0).
> Rewinding.
> Reading the first 10000 records from 0:0.
> 10000 records read now at 1:5084
> Reposition from 1:5084 to 1226:13009
> Reading block 13009.
>
> The last block of the first tape matches.
>
> 05-May 19:06 btape JobId 0: 3307 Issuing autochanger "unload slot 1, drive 0"
> command.
> 05-May 19:07 btape JobId 0: 3304 Issuing autochanger "load slot 2, drive 0"
> command.
> 05-May 19:07 btape JobId 0: 3305 Autochanger "load slot 2, drive 0", status
> is OK.
> 05-May 19:07 btape JobId 0: Ready to read from volume "TestVolume2" on device
> "Drive-1" (/dev/nst0).
> 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.
>
> *
>
>
>
>
>
>
>
> -----Original Message-----
> From: yvan [mailto:yvan AT skywalker.is-a-chef DOT com]
> Sent: Thursday, May 07, 2009 6:15 AM
> To: Win Htin
> Cc: bacula-users AT lists.sourceforge DOT net
> Subject: Re: [Bacula-users] Tape MTEOM error with Dell TL2000 (IBM > TS3100)
>
> Hi !
>
> Yes, doing that at the moment. It takes a long time to reset all my
> tapes, erase them, and start some tests on them .... it takes days ...
> More to come soon ...
>
> By the way, what is the best way to erase a tape ? I tried a
> "dd if=/dev/zero of=/dev/st0" but I had to stop it after 24h (maybe I
> should use bigger block size to increase speed ?)
> mt -f /dev/st0 erase gives me some error : Input/Ouput error after a few
> seconds...
>
> Le 05.05.2009 14:12, Win Htin a écrit :
>> Did you erase the tapes before re-running the backups?
>>
>> I would recommend first to completely erase the tape(s), run "btape"
>> to make sure everything is working fine and then start testing the
>> actual backups. Capture the output while running "btape" and go
>> through it line by line to make sure you don't have even a single
>> error.
>>
>> BTW, I forgot to mention I'm running Bacula version 2.2.6 on RHEL4 and
>> 2.4.3 on RHEL5.2.
>>
>> HTH,
>> Win
>>
>>
>>> Message: 7
>>> Date: Mon, 04 May 2009 13:13:45 +0200
>>> From: yvan<yvan AT skywalker.is-a-chef DOT com>
>>> Subject: Re: [Bacula-users] Tape MTEOM error with Dell TL2000 (IBM
>>> TS3100)
>>> To: bacula-users AT lists.sourceforge DOT net
>>> Message-ID:<49FECDE9.8050204 AT skywalker.is-a-chef DOT com>
>>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>>>
>>> Hi,
>>>
>>> thank you for the advices. We have very similar configurations, and I'm
>>> sure I'm not too far from the solution. I tried to use your settings in
>>> the storage daemon config file, and the "mt" options as well, than I
>>> didn't try so far.
>>>
>>> But, as soon as I put those settings, I have another error
>>>
>>> Hardware End of Medium = No # defaut is Yes
>>> Fast Forward Space File = No # This line required if above
>>>
>>> which is :
>>> 3-May 02:20 setmseblx0007-sd JobId 170: Error: Unable to position to end
>>> of data on device "IBMLTO4" (/dev/nst0): ERR=dev.c:1354 ioctl MTFSF
>>> error on "IBMLTO4" (/dev/nst0). ERR=Input/output error.
>>>
>>> Strange that it works for you then ... I issued all the "mt" commands
>>> you wrote. Tapeinfo gives me the samed infos as you have, but it's MTFSF
>>> error or MTEOM ...
>>>
>>> Regards
>>> Yvan Broccard
>>>
>
>
> ------------------------------------------------------------------------------
> The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
> production scanning environment may not be a perfect world - but thanks to
> Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
> Series Scanner you'll get full speed at 300 dpi even with all image
> processing features enabled. http://p.sf.net/sfu/kodak-com
> _______________________________________________
> Bacula-users mailing list
> Bacula-users AT lists.sourceforge DOT net
> https://lists.sourceforge.net/lists/listinfo/bacula-users
>
--
email : win.htin AT gmail DOT com
"The unexamined life is not worth living" -- Socrates
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users
|