Solved

Copy raw data from a LTO-3 tape with dd

Posted on 2014-09-03
5
853 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 17

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Server Rebuild after 2 drive in raid crashed 16 75
Samba Question 11 73
Disk Cloning 9 52
WordPress: Debugging from my Windows 10 Desktop 6 25
VM backup deduplication is a method of reducing the amount of storage space needed to save VM backups. In most organizations, VMs contain many duplicate copies of data, such as VMs deployed from the same template, VMs with the same OS, or VMs that h…
Fine Tune your automatic Updates for Ubuntu / Debian
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

808 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