DLT tape gives only half blocks back of what was written.

Some 11 Tb was dumped for me on 330 DLT tapes using a blocksize of 512Kb.

When I read those tapes on a HP target machine I get only the 1st half of every block.
Funny that it doesn't matter if I use dd with bs=256k or bs=512k, the result is the same:
the first 256Kb of every block. Even a JAVA 1.4 program using RandomAccessFile to byte[512*1024]
produces the same result.
I presume that the original writing program (in C) wrote some SCSI commands to the drive
in order to get it to write (and read) 512 Kb blocks.

Who knows how to archieve the reading of all 35Gb per tape?

;JOOP!
LVL 24
sciuriwareAsked:
Who is Participating?
 
dovidmichelConnect With a Mentor Commented:
Well the SCSI Mode Select command is used to set the block size. Here is a copy from the DLT 7000 SCSI Reference Manual.  

SCSI Commands
MODE SELECT (6) / (10) Command (15h) / (55h)
MODE SELECT Mode Parameter List - Field Descriptions

Header
4 bytes in length, contains information about the remainder of the
Parameter List and is always present.

Block Descriptor
8 bytes in length, allows the initiator to set the drive’s Logical Block Size
and number of Descriptor Logical Block Addresses.
-----------------------------------------------------------
But it would problably be better if the details were provided, such as:
Model DLT drive used to backup.
Model DLT drive used to restore.
OS and application used to backup.
Does each tape contain a separate backup?
or
Does the data just span from one tape to the next to the next?
If the latter are the tapes labled in order?
0
 
sciuriwareAuthor Commented:
Hi,
1) this has nothing to do with backup; each tape contains up to 67000 blocks of 512Kb..
2) the drive is DLT-7000
3) the OS is HP-UX - 11.11
4) I found that manual on a shelf; I don't have a clue how to use those data in (say) a C program
to set the drive to read - 512Kb - blocks, before I read.
;JOOP!
0
 
dovidmichelCommented:
For HP UX 11 dd the input default block size is 512 so I would think that it should not be necessary to use bs=.
I guess you could try using ibs= any ways to specify an input block size of 512, but...

Perhaps tcio will help, from the HP UX man.
"You may experience trouble writing directly to or reading directly from a cartridge tape. For best results, use tcio(1) as an input or output filter. For example for input from a cartridge tape, use

tcio -ivS 256 /dev/rct/c4t1d0 | dd ... | ..."
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
sciuriwareAuthor Commented:
You still don't get it:
1) the default blocksize of dd is 512 bytes and that has been so for 34 years ....
2) it is the drive that delivers 256Kb for each block of 512Kb requested.


;JOOP!
0
 
sciuriwareAuthor Commented:
You don't know how to perform a SCSI command based on the above parameters?

;JOOP!
0
 
andyalderCommented:
The machine that wrote the tape, or the drive attached to that machine, was probably faulty. Are you really getting only 256Kb or are you getting 512kb with 256kb of nulls?
0
 
sciuriwareAuthor Commented:
Please READ the details in my question.
I can see that the software package that writes (and re-reads) the tapes performs SCSI commands.
And all those 11.5 Terabytes are there!

;JOOP!
0
 
grg99Commented:
Are you saying the tape has physical blocks 512K long?   That sounds mighty unlikely.  When I was working with SCSI tapes block sizes were MUCH smaller than that.

You may have to go back to the original writer of the tape and ask exactly how the tape was written.    It may even require a special tape drive with special firmware.
0
 
sciuriwareAuthor Commented:
No no no!
The tapes are read and written with a special program (in C) 6 years old.
And DLT-7000 has a maximum blocksize of 16M.

Please do not comment if you don't know about that.
;JOOP!
0
 
andyalderCommented:
Post the source code of the backup program.
0
 
grg99Commented:
Ok, here's one possibility:  some tape driver hardware requires a contiguous buffer space as long as the block size, other tape hardware can make do with a linked list of non-sequential memory areas.    This space has to not only be one unbroken area, but it has to be allocated from the system or kernel heap.     Unfortunately some kernels either cannot allocate or do not have one unbroken stretch of kernel memory large enough.

You may want to look into increasing the kernel heap by a few megabytes, or see if there's some limit to kernel heap block size.   You might also see if there's some quota on memory usage that you're running up against.



0
 
sciuriwareAuthor Commented:
Until now only dovidmichel showed some understanding of the problem.

Apart from that,why did I collect only **** on this question?  Please read the question and the first answer I got.

If you don't understand it or have no knowledge of the topic, don't show that to me.
And don't comment on this question just  because of the 500 points.
;JOOP!
0
 
andyalderCommented:
Unless you post the source code of the backup prog nobody is going to be able to help you. For all you have told us at present the first block may have been written with one block size and the next block with a different size.
0
 
sciuriwareAuthor Commented:
andyalder, you can't read English:

there is no backup and I clearly stated that all 67000 blocks are 512Kb.
Please keep away from this question.

;JOOP!
0
 
andyalderCommented:
Post the source code of the program that wrote the data onto the tape.
0
 
sciuriwareAuthor Commented:
The program in question contains only calls to libraries I don't have.
Otherwise I had been able to do it myself.
So, how do I code SCSI commands to the tape drive based on the manual data above?

;JOOP!
0
 
dovidmichelCommented:
sciuriware,

Sorry but I am not a programmer. I work with SCSI commands to help troubleshoot problems, so although I understand the commands I don't know how to write code.

Perhaps reviewing the manual will be enough to get you going.

http://www.quantum.com/am/service_support/downloads/dlt7000.htm

The DLT 7000 Product Manual is the one that contains the SCSI commands, and is the one I pulled the above data from. Also listed are a couple of documents on installing the drive on HP systems, perhaps there might be something helpful there. Sorry I was not more help. Perhaps there is a parameter in the driver that can be changed to set the block size.
0
 
sciuriwareAuthor Commented:
As I said, that manual is on my desk, and it doesn't help me much.
By now, I know I must practise the right ioctl() call, but today a technician will come and
check if the tape drive can be strapped to that block size.
;JOOP!
0
 
sciuriwareAuthor Commented:
Because I must close this question I'm giving the points to dovidmichel.
His solution is surely right but I failed to use it in a program.

Apart from that, there is a problem in HP-UX so when you start SCSI programming to a drive
you're completely on your own and in fact you must write a kind of driver in your application
down from the bottom.
We chose to connect the drive to a Solaris system and then there's no problem.
B.T.W.: LINUX can also handle the blocksize directly.

;JOOP!
0
 
sciuriwareAuthor Commented:
P.S.: to dovidmichel:

please post some constructive contribution on:
 http://www.experts-exchange.com/Programming/Programming_Languages/C/Q_20956904.html
and I'll accept that too.
;JOOP!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.