On Friday 04 August 2017 12:43:33 Chris Hoogendyk wrote:
> Gene,
>
> Thanks for your input. I have seen your commentary on this issue on
> the list before, but had neglected to recall the details.
>
Working from a very old memory, with even older memory, I think I did it
right. I was going to check to see if I still had a copy of that script
but apparently that never made it into my /GenesAmandaHelper-0.61
directory.
> I tried it, and it didn't seem to work any magic. Here is my session
> with the amtapetype run at the end.
>
>
> $ sudo mt -f /dev/nst1 rewind
>
> $ sudo dd if=/dev/nst1 bs=512k count=1 of=tape-header
Ok, but you only needed 32k, or at least thats all I needed with the
prehistoric drives I was using. I've been using vtapes since they became
available, more dependable that tape ever was, and when you need
something back, thousands of times faster.
> 1+0 records in
> 1+0 records out
> 524288 bytes (524 kB) copied, 0.00732916 s, 71.5 MB/s
>
> $ ls -l tape-header
>
> -rw-r----- 1 root sysadmin 524288 Aug 4 12:06 tape-header
>
> $ more tape-header
>
> AMANDA: TAPESTART DATE 20170801124200 TAPE
> amtapetype-1158747886 ^L
>
> $ sudo mt -f /dev/nst1 rewind
>
> $ sudo mt -f /dev/nst1 compression 0
>
> $ sudo mt -f /dev/nst1 defcompression 0
>
> $ sudo dd if=tape-header bs=512k count=1 of=/dev/nst1
>
> 1+0 records in
> 1+0 records out
> 524288 bytes (524 kB) copied, 24.7811 s, 21.2 kB/s
>
> $ sudo mt -f /dev/nst1 rewind
>
> $ sudo tapeinfo -f /dev/sg15
>
> Product Type: Tape Drive
> Vendor ID: 'IBM '
> Product ID: 'ULTRIUM-HH7 '
> Revision: 'G9Q1'
> Attached Changer API: No
> SerialNumber: '10WT039810'
> MinBlock: 1
> MaxBlock: 8388608
> SCSI ID: 1
> SCSI LUN: 0
> Ready: yes
> BufferedMode: yes
> Medium Type: 0x78
> Density Code: 0x5c
> BlockSize: 0
> DataCompEnabled: no
You succeeded here
> DataCompCapable: yes
> DataDeCompEnabled: yes
but it can still decompress compressed data
> CompType: 0xff
> DeCompType: 0xff
> BOP: yes
> Block Position: 0
> Partition 0 Remaining Kbytes: -1
> Partition 0 Size in Kbytes: -1
> ActivePartition: 0
> EarlyWarningSize: 0
> NumPartitions: 0
> MaxPartitions: 3
>
> $ sudo amtapetype -f -c -b 512k /dev/nst1
>
> Checking for FSF_AFTER_FILEMARK requirement
> Applying heuristic check for compression.
> Wrote random (uncompressible) data at 207,231,278.163934
> bytes/sec [added commas] Wrote fixed (compressible) data at
> 280,913,510.4 bytes/sec [aligned for comparison] Compression:
> enabled
>
That is, IMO odd, Jean-Louis can you comment?
And my curiosity makes me ask what does tapeinfo now say, after running
amtapetype?
> $
>
> On 8/3/17 7:26 PM, Gene Heskett wrote:
> > On Thursday 03 August 2017 15:59:00 Will Aoki wrote:
> >> On Mon, Jul 31, 2017 at 04:37:37PM -0400, Chris Hoogendyk wrote:
> >>> Here is my latest attempt, working with a new, never been loaded,
> >>> LTO7 tape. I should note that I have a page in my server notebook
> >>> from July 2014 showing almost this exact sequence of commands when
> >>> setting up my LTO6 library.
> >
> > Quite a high percentage of the modern tape drives, will, after a
> > rewind, if asked for a read, will reread the tape header, see that
> > compression is enabled, and will very helpfully (not!) re-enable it.
> > I have in the past, read out the amanda header, the first VISIBLE
> > 32k block on the tape, rewound the tape, turn the compression off
> > and instantly, before the drive is moved again, rewrite that 32k
> > amanda header block, which then locks the compression off until such
> > time as you rewind it, re-enable it and write something to lock it
> > back on.
> >
> >>> Bottom line is that tapeinfo tells me compression is off, it's a
> >>> new tape, then amtapetype tells me compression is on.
> >
> > Tapeinfo IIRC gets that info from the drives firmware without moving
> > the tape.
> >
> > amtapetype actually reads the tape, moving it to determine that.
> > Moving it resets it by reading the tapes hidden header.
> >
> > So rewind it
> > dd the amanda header out to a scratch file
> > rewind it
> > turn the compression off
> > dd that scratch file back to the tape
> >
> > Then you should have agreement between Tapeinfo and amtapetype,
> > saying the compression is off.
> >
> > If you are recycling tapes, do the above to each tape you insert
> > until you have done this little routine with every tape destined to
> > be inserted into this drive. But do not do it ahead of its scheduled
> > re-use as that invalidates the backup you might need before the next
> > scheduled amanda run if something upchucks between doing it, and the
> > run that re-uses it.
> >
> >> I wasn't able to get compression turned off on the LTO-7 drive in
> >> my Quantum SuperLoader 3. I ended up deciding to leave compression
> >> on, as it didn't seem to do any harm in my testing.
> >>
> >> My drive:
> >>
> >> Product Type: Tape Drive
> >> Vendor ID: 'IBM '
> >> Product ID: 'ULTRIUM-HH7 '
> >> Revision: 'FA17'
> >> Attached Changer API: No
> >> SerialNumber: '10WT------'
> >> MinBlock: 1
> >> MaxBlock: 8388608
> >> SCSI ID: 23
> >> SCSI LUN: 0
> >> Ready: yes
> >> BufferedMode: yes
> >> Medium Type: 0x78
> >> Density Code: 0x5c
> >> BlockSize: 0
> >> DataCompEnabled: yes
> >> DataCompCapable: yes
> >> DataDeCompEnabled: yes
> >> CompType: 0xff
> >> DeCompType: 0xff
> >> BOP: yes
> >> Block Position: 0
> >> Partition 0 Remaining Kbytes: -1
> >> Partition 0 Size in Kbytes: -1
> >> ActivePartition: 0
> >> EarlyWarningSize: 0
> >> NumPartitions: 0
> >> MaxPartitions: 3
> >>
> >> My tapetype:
> >>
> >> #Checking for FSF_AFTER_FILEMARK requirement
> >> #Applying heuristic check for compression.
> >> #Wrote random (uncompressible) data at 92327868.852459 bytes/sec
> >> #Wrote fixed (compressible) data at 165647058.823529 bytes/sec
> >> #Compression: enabled
> >> #Writing one file to fill the volume.
> >> #Wrote 6015744049152 bytes at 86102 kb/sec
> >> #Writing smaller files (60157427712 bytes) to determine filemark.
> >> define tapetype lto-7 {
> >> # Couldn't seem to get compression disabled...
> >> comment "Created by amtapetype; compression enabled"
> >> length 5874750048 kbytes
> >> filemark 12 kbytes
> >> speed 86102 kps
> >> blocksize 32 kbytes
> >> part_size 200G
> >> part_cache_type memory
> >> part_cache_max_size 48G
> >> }
> >
> > Cheers, Gene Heskett
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>