Hi Dustin,

I tested amtapetype with version 2.6.1p1 with same HW. It goes through the 
compressions test in the beginning where I got
error in the  Amanda 3.1.0beta2 version, but then when it comes to end of tape 
the driver returns DEVICE_STATUS_DEVICE_ERROR 
with causes short write on tape device. But see below what mt -f status returns 
- EOT.

Thanks Gunnar 
 

bash-3.00# /opt/sfw/sbin/amtapetype -f tape:/dev/rmt/0n
Applying heuristic check for compression.
Wrote random (uncompressible) data at 9076215.87301587 bytes/sec
Wrote fixed (compressible) data at 38120106.6666667 bytes/sec
Compression: enabled
Writing one file to fill the volume.
Wrote less than 100MB to the device: Error writing block: Error 0



# mt -f /dev/rmt/0n status
HP Ultrium LTO 3 tape drive:
   sense key(0x13)= EOT   residual= 0   retries= 0
   file no= 2   block no= 0


1274535946.994402: amtapetype: Final linkage: <xfersourceran...@438858> 
-(PULL_BUFFER)-><xferdestdev...@4394b0>
1274578788.428012: amtapetype: Device /dev/rmt/0n error = 'Mysterious short 
write on tape device: Tried 32768,  got 0'
1274578788.458837: amtapetype: Device /dev/rmt/0n setting status flag(s): 
DEVICE_STATUS_DEVICE_ERROR
1274578788.459176: amtapetype: Device /dev/rmt/0n error = 'Error writing 
block:Error 0'
1274578788.459231: amtapetype: Device /dev/rmt/0n setting status flag(s): 
DEVICE_STATUS_DEVICE_ERROR
1274578788.498811: amtapetype: Cancelling <x...@3533f0 
(<xfersourceran...@438858> -> <xferdestdev...@4394b0>)>

-----Ursprungligt meddelande-----
Från: djmit...@gmail.com [mailto:djmit...@gmail.com] För Dustin J. Mitchell
Skickat: den 21 maj 2010 16:44
Till: Gunnarsson, Gunnar
Kopia: amanda-users@amanda.org
Ämne: Re: amtapetype Amanda 3.1.0beta2

Ah - after the device has encountered an error, it won't give properties 
anymore (case doesn't matter).  Try moving the block_size up in the script:

diff --git a/device-src/amtapetype.pl b/device-src/amtapetype.pl index 
5bd7411..80c0ad7 100644
--- a/device-src/amtapetype.pl
+++ b/device-src/amtapetype.pl
@@ -117,6 +117,9 @@ sub write_one_file(%) {
     my $pattern = $options{'PATTERN'} || 'FIXED';
     my $max_time = $options{'MAX_TIME'} || 0;

+    # get the block size now, while the device is still working
+    my $block_size = $device->property_get("block_size");
+
     # start the device
     my $hdr = Amanda::Header->new();
     $hdr->{type} = $Amanda::Header::F_DUMPFILE; @@ -182,7 +185,6 @@ sub 
write_one_file(%) {

     # OK, we finished, update statistics (even if we saw an error)
     my $blocks_written = $device->block();
-    my $block_size = $device->property_get("block_size");
     $stats->{$pattern}->{BYTES} += $blocks_written * $block_size;
     $stats->{$pattern}->{FILES} += 1;
     $stats->{$pattern}->{TIME}  += $duration;

Let me know if that helps?  Thanks for your patience!

Dustin

--
Open Source Storage Engineer
http://www.zmanda.com

Reply via email to