Solved

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

Posted on 2004-04-16
20
609 Views
Last Modified: 2010-04-03
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!
0
Comment
Question by:sciuriware
  • 11
  • 4
  • 3
  • +1
20 Comments
 
LVL 22

Accepted Solution

by:
dovidmichel earned 500 total points
Comment Utility
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
 
LVL 24

Author Comment

by:sciuriware
Comment Utility
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
 
LVL 22

Expert Comment

by:dovidmichel
Comment Utility
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
 
LVL 24

Author Comment

by:sciuriware
Comment Utility
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
 
LVL 24

Author Comment

by:sciuriware
Comment Utility
You don't know how to perform a SCSI command based on the above parameters?

;JOOP!
0
 
LVL 55

Expert Comment

by:andyalder
Comment Utility
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
 
LVL 24

Author Comment

by:sciuriware
Comment Utility
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
 
LVL 22

Expert Comment

by:grg99
Comment Utility
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
 
LVL 24

Author Comment

by:sciuriware
Comment Utility
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
 
LVL 55

Expert Comment

by:andyalder
Comment Utility
Post the source code of the backup program.
0
Google Storage: Standard vs. Nearline vs. Coldline

Google Cloud Storage has a number of classes to choose from. Although there are a lot in common, they vary in price and usage terms. This post explains Google Cloud Storage classes and helps to understand which  one to choose.

 
LVL 22

Expert Comment

by:grg99
Comment Utility
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
 
LVL 24

Author Comment

by:sciuriware
Comment Utility
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
 
LVL 55

Expert Comment

by:andyalder
Comment Utility
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
 
LVL 24

Author Comment

by:sciuriware
Comment Utility
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
 
LVL 55

Expert Comment

by:andyalder
Comment Utility
Post the source code of the program that wrote the data onto the tape.
0
 
LVL 24

Author Comment

by:sciuriware
Comment Utility
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
 
LVL 22

Expert Comment

by:dovidmichel
Comment Utility
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
 
LVL 24

Author Comment

by:sciuriware
Comment Utility
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
 
LVL 24

Author Comment

by:sciuriware
Comment Utility
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
 
LVL 24

Author Comment

by:sciuriware
Comment Utility
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

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Solid State Drive Performance Tips: Solid state storage technology is now a standard.  After testing and using several different brands and revisions of SSD's over the years I have put together a collection of tips,tools and suggestions that I ha…
Ever notice how you can't use a new drive in Windows without having Windows assigning a Disk Signature?  Ever have a signature collision problem (especially with Virtual Machines?)  This article is intended to help you understand what's going on and…
This video teaches viewers how to encrypt an external drive that requires a password to read and edit the drive. All tasks are done in Disk Utility. Plug in the external drive you wish to encrypt: Make sure all previous data on the drive has been …
This tutorial will walk an individual through the process of installing the necessary services and then configuring a Windows Server 2012 system as an iSCSI target. To install the necessary roles, go to Server Manager, and select Add Roles and Featu…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now