1

I have an old tape drive and old tape that I recently found. I was able to get the tape drive connected to Linux and executed the following commands:

mt -f /dev/nst0 rewind dd if=/dev/nst0 of=dump.file 

My question is, if you do not know what format the tape was created under, what is the safest way to use dd? On the flip side, if you knew all the files were tar files, what would you then do?

1
  • 1
    "Safe" in what sense? What problem(s) are you expecting and wish to avoid? Commented Nov 8, 2018 at 13:49

2 Answers 2

4

From the this article on dd:

dd reads and writes data by blocks, and can convert the data between formats. dd is frequently used for devices such as tapes which have discrete block sizes, or for fast multi-sector reads from disks

dd will read raw bytes from one file (or device) and write it to another. It doesn't care (or even know) about file systems or file formats. All it sees are blocks of ones and zeros.

Note that you may (or may not) need to swap endian-ness if the tape was written on a big-endian machine, which used to be more popular.

You can do this as described here:

dd if=/dev/nst0 of=dump.file ibs=20b conv=swab

By the way, dd won't change anything on the input file (if). It only writes to the output file (of). So, it won't harm the data on your tape, if that's what you're worried about.

3

I've recently written a tool called tapeimgr that automatically extracts all files from a tape. Internally it wraps around dd and mt. More info here:

https://github.com/KBNLresearch/tapeimgr

It also automatically determines the block size (which can be pretty tedious to do manually). Byte swapping is not supported (yet), but having read @layne-bernardo's answer I've put this on the to-do list for an upcoming release. Disclaimer:: so far I've only tested the tool with a limited number of DDS and DLT-IV tapes, as well as a virtual tape library, so use at your own risk!

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.