Linux SCSI tape dd issue

Posted on 2007-07-28
Last Modified: 2013-12-16
I'm working with FC6 and an LT01 SCSI tape drive.  I'm trying to create a copy of the tape and my plan was to use dd to read the tape to a file and then dd the file back to a blank tape.   The problem is that I'm only get 64k of data from the tape and then it stops like it's reached the end of the tape.  I created the tape a couple of hours ago on a Windows 2003 server (sp2) and it contains 104gb of data.  Oddly, I cannot find 'mt' on my system.

My dd command was as follows:    dd if=/dev/st0 of=/tmp/tapefile bs=128k.   Buffer sizes less than 64k generate memory errors and no data.
Question by:AverygeJoe
    LVL 7

    Assisted Solution

    Both dd, tar and any other command will run on a single track.
    You first action is to install mt (package mt-st).
    Your second action is to rewind the tape (I know it is being done by default when you insert it, and still)
    Your third step is to dd the contents into a file.1
    This is the first track. Your next dd will take the 2nd track, and so on.
    Tape has "positions". You can forward or rewind the tape X amount of tracks (positions), seek the end to the tape (what is the last track), etc.

    You need to dd each and every track separately, and dd it back into a blank tape. This, assuming your block size is similar, should do the trick.
    LVL 14

    Accepted Solution

    the /dev/st0 ("auto-rewind device") device rewinds when it is closed

    you need to usie the "no-rewind" device /dev/nst0 to read all the files on the tape

    dd if=/dev/nst0 of=/tmp/tapefile1 bs=128k
    dd if=/dev/nst0 of=/tmp/tapefile2 bs=128k
    dd if=/dev/nst0 of=/tmp/tapefile3 bs=128k

    until you encounter the end of tape marker (i.e. you get an error reading the next file / all you get are 0-byte files)

    then swap tapes and write (again using the no-rewind device /dev/nst0)

    dd of=/dev/nst0 if=/tmp/tapefile1 bs=128k
    dd of=/dev/nst0 if=/tmp/tapefile2 bs=128k
    dd of=/dev/nst0 if=/tmp/tapefile3 bs=128k

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Save on storage to protect fatherhood memories

    You're the dad who has everything. This Father's Day, make sure your family memories are protected. My Passport Ultra has automatic backup and password protection to keep your cherished photos and videos safe. With up to 3TB, you have plenty of room to hold the adventures ahead.

    Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
    This article is an update and follow-up of my previous article:   Storage 101: common concepts in the IT enterprise storage This time, I expand on more frequently used storage concepts.
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

    758 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