Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2004-04-16
20
612 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
ID: 10843218
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
ID: 10843510
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
ID: 10844104
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
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 
LVL 24

Author Comment

by:sciuriware
ID: 10844923
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
ID: 10844961
You don't know how to perform a SCSI command based on the above parameters?

;JOOP!
0
 
LVL 55

Expert Comment

by:andyalder
ID: 10845101
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
ID: 10845244
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
ID: 10847463
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
ID: 10848007
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
ID: 10848282
Post the source code of the backup program.
0
 
LVL 22

Expert Comment

by:grg99
ID: 10848954
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
ID: 10849473
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
ID: 10849504
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
ID: 10849819
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
ID: 10850052
Post the source code of the program that wrote the data onto the tape.
0
 
LVL 24

Author Comment

by:sciuriware
ID: 10850787
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
ID: 10864354
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
ID: 10865650
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
ID: 10936495
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
ID: 10936517
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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Create your own, high-performance VM backup appliance by installing NAKIVO Backup & Replication directly onto a Synology NAS!
The article will include the best Data Recovery Tools along with their Features, Capabilities, and their Download Links. Hope you’ll enjoy it and will choose the one as required by you.
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…
This Micro Tutorial will teach you how to reformat your flash drive. Sometimes your flash drive may have issues carrying files so this will completely restore it to manufacturing settings. Make sure to backup all files before reformatting. This w…

860 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