?
Solved

Copy raw data from a LTO-3 tape with dd

Posted on 2014-09-03
5
Medium Priority
?
947 Views
Last Modified: 2014-09-09
I am trying to read the content of a LTO tape in Linux using the 'dd' and 'mt' tools. I am at the beginning of a file an run this command:

dd if=/dev/nst0 of=file bs=64k

and get an i/o error and the tape drive head moves 1 block. Now, I ran again the above command and the file is being copied from the tape, but the header is incomplete (I guess because of that 1st block I cannot read).

I may be missing something. Can you please help me with this ?
0
Comment
Question by:Nosfedra
[X]
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
  • 2
  • 2
5 Comments
 
LVL 3

Author Comment

by:Nosfedra
ID: 40301136
It looks like it's a file preamble, 312 bytes in size. Now I can read them both, and concatenate the files in the end.
0
 
LVL 40

Accepted Solution

by:
noci earned 668 total points
ID: 40302315
tapes are written with a fixed header part followed by a parity error block (signaling EOF)
then a data block according to the data in the header. then an EOF marker.
then a datablock (trailer) which is the same as the header with some extra fields filled in. (EOF) marker, and another (EOF) marker to signal then of tape or another header/data/trailer set.
0
 
LVL 17

Assisted Solution

by:Gerald Connolly
Gerald Connolly earned 332 total points
ID: 40303392
Looks like standard tape layout. File split into blocks followed by tape-mark, repeat until hit logical end of tape
0
 
LVL 40

Assisted Solution

by:noci
noci earned 668 total points
ID: 40303945
Actually the tape hardware knows only about datablocks (up to a certain size)  and EOF markers.
you need to specify the sizes of block and be happy to get an EOF message.

the actual format of the headers may vary.
ISO dictates that the HDR1,HDR2, up to HDR4 headers are all 80 bytes long and are either ASCII of EBCDIC.
those headers specify how the data blob after the EOF can be read.
The traler has the same records as HDR1..4 but they are aptly named: EOF1..EOF4.  In those records the counts are filled in here in the HDR the count fields are 0.
0
 
LVL 3

Author Closing Comment

by:Nosfedra
ID: 40311431
Guys, thanks for your feedback. That's what I did:

while EOD
do
  read preamble
  read file
  goto next EOF -- which is actually the beginning of the next file
done
0

Featured Post

Automating Terraform w Jenkins & AWS CodeCommit

How to configure Jenkins and CodeCommit to allow users to easily create and destroy infrastructure using Terraform code.

Question has a verified solution.

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

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
Your data is at risk. Probably more today that at any other time in history. There are simply more people with more access to the Web with bad intentions.
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

752 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