• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 752
  • Last Modified:

Reading variable block data from a tape with block sizes of 262144 bytes

I am tryin to read data from a NetBackup tape.

I can read the first block which is 1024 bytes, the following file mark and then the next block (again 1024 bytes) after that the block size is 262144 bytes and when I try and read 262144 bytes varibale from these blocksI the SCSI command hangs.

I am obviously using variable block sizes.

If I read just one byte from each block then the ILI correctly reports the difference between the bytes I have read and the block size.

The problem seems to be that the MaximumBlockSize as returned hy GET_TAPE_DRIVE_INFORMATION is 64K - is there a way of changing this (XP Pro) or am I missing something?

0
sandy771
Asked:
sandy771
  • 4
  • 3
1 Solution
 
DavidPresidentCommented:
Any CDB with a pass-through length > 64KB is high risk. The reason is that the max size of a pass-through command is vendor/controller specific, and the only guarantee is that the min pass-through length is 64KB.

You are just going to have to find a SCSI controller that supports pass-through up to 262144 bytes, or use a different O/S like LINUX that lets you set the max pass-through length by tweaking a kernel parm and rebuilding a kernel.

Sorry
0
 
sandy771Author Commented:
Thanks - I'll look atthe spec for the 29160 and see if that supports > 64K and get anothe rcard if required. Clearly the drive supports this siize.

Interesting that you suggest "or use a diffeerent OS" - what difference will that make if the card is the problem. (Card change is easy - never done any linux programming so time may be against me for that option.
0
 
sandy771Author Commented:
Hmm I cant see anything in the 29160 material that says what the maximum blocksize for the adpater is - clutching at straws now and will try running my code on a Win & box
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
TapeDudeCommented:
I regularly read block sizes > 64k using Adaptec controllers (29160, 29320 etc) under Windows XP without any problems, using ASPI as well as standard IO through the miniport drivers.

You may find this useful:

   http://support.microsoft.com/kb/2005265
0
 
DavidPresidentCommented:
The maximum length of a passthrough CDB is a function of both firmware & drivers, but if you're not a LINUX/UNIX person, then I agree it is unwise to go down that path due to learning curve. This is what you need to do to figure out the max pass-thru limit for any given card/firmware/BIOS/Driver combo ...

Do the IOCTL_STORAGE_QUERY_PROPERTY, and look at the MaximumTransferLength field in the structure. This is the limit.

Also, there is another constraint ..

Before you use MaximumTransferLength for SPTI DataTransferLength, 1st check
the system PAGE_SIZE. If MaximumTransferLength is less than
(MaximumPhysicalPages - 1) * PAGE_SIZE then you can go with
SPTI DataTransferLength = MaximumTransferLength.
Otherwise you need to set:
SPTI DataTransferLength = (MaximumPhysicalPages - 1) * PAGE_SIZE.

0
 
DavidPresidentCommented:
Also, don't forget about those storport, scsiport, and miniport drivers for various flavors of windows and controllers.  While I have never bothered to check to see if the max passthrough changes for any given card with the various windows drivers and operating systems, it would be wise if you are going past the known-to-always-work 64KB that you don't make any assumptions, so you need to do the IOCTL_STORAGE_QUERY_PROPERTY on the controller/HBA to make sure that the target system will handle the CDB.
0
 
sandy771Author Commented:
Added the registry value and rebooted - now all OK.

Thanks
0
 
sandy771Author Commented:
Not sure whether to continue with this question or ask another.

I have the same problem on a Win7 X64 bit system - however in this case I have made the registry patch but I still cant read more than 64K at a time. This has a adaptec 29320 card rather than the 29160LP but the I am happy I patched the correct registry key.

Any ideas?

Also why is this question marked as part answered when I have awarded TapeDude the points?
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now