Solved

Copy raw data from a LTO-3 tape with dd

Posted on 2014-09-03
5
830 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
  • 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 334 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 16

Assisted Solution

by:Gerald Connolly
Gerald Connolly earned 166 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 334 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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Create your own, high-performance VM backup appliance by installing NAKIVO Backup & Replication directly onto a Synology NAS!
Are you looking to recover an email message or a contact you just deleted mistakenly? Or you are searching for a contact that you erased from your MS Outlook ‘Contacts’ folder and now realized that it was important.
This tutorial will walk an individual through the process of installing of Data Protection Manager on a server running Windows Server 2012 R2, including the prerequisites. Microsoft .Net 3.5 is required. To install this feature, go to Server Manager…
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.

809 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