Solved

Copy raw data from a LTO-3 tape with dd

Posted on 2014-09-03
5
790 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 39

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 39

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

How to Backup Ubuntu to Amazon S3

CloudBerry Backup offers automatic cloud backup and restoration for Linux. It has both GUI and command line interface (CLI) ensuring its flexibility in use. Find out more

Join & Write a Comment

Microservice architecture adoption brings many advantages, but can add intricacy. Selecting the right orchestration tool is most important for business specific needs.
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
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 show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…

743 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