1833347 Members
3220 Online
110051 Solutions
New Discussion

check tape

 
SOLVED
Go to solution
Nobody's Hero
Valued Contributor

check tape

I have a dds tape and someone asked me to check to see if data is on it but they dont know what system it came from or what format the tape is. So:
I tried:

# dd if=/dev/rmt/0 of=/tmp/datadump
0+0 records in
0+0 records out

Would this be a good generic way to tell if any data is on the tape?
UNIX IS GOOD
8 REPLIES 8
Ron Irving
Trusted Contributor

Re: check tape

Perhaps using tar would be a better way, (for this tired old brain anyway.)

# tar -tvf /dev/rmt/0

Hope that helps.

ron
Should have been an astronaut.
Shrikant Lavhate
Esteemed Contributor

Re: check tape

Hi,

best way use mt.
#mt /dev/rmt/0m status
OR
#mt -f /dev/rmt/0m status

It should give output like for empty tape.

Drive: QUANTUM DLT8000
Format:
Status: [0]
File: 0
Block: 0
Will it remain a personal, if I broadcast it here!
Nobody's Hero
Valued Contributor

Re: check tape

well that would work if the tape was tar format.

I have no idea what format the tape was written in.

And I believe: if the tape used a compressed format to backup data on this tape, then DD would not recognize the data.

Can any experts backup my theory on this?
Isnt there a generic way of saying, show me anything on this tape?

Or
do I need more clues? tape drive model used, block size..etc....
UNIX IS GOOD
Nobody's Hero
Valued Contributor

Re: check tape

Thanks ShrikantL.

I tried this but thought that if the data was compressed on the tape that this would still show as zero blocks? Am I correct in assuming this?
UNIX IS GOOD
Nobody's Hero
Valued Contributor

Re: check tape

This is what I get:

# mt -f /dev/rmt/0m status
Seagate DAT Drive tape drive:
sense key(0x13)= EOT residual= 0 retries= 0
file no= 0 block no= 0
UNIX IS GOOD
Shrikant Lavhate
Esteemed Contributor

Re: check tape

If there is any compression kinda thing on tape then it may show you in status. like the one below.


#mt status /dev/rmt/0m
Drive: HP C1537A
Format: DDS-3 format
Status: [41112500] BOT online compression immediate-report-mode

It was output for tape used in ignite backup which hanged in between.
Will it remain a personal, if I broadcast it here!
Tim Nelson
Honored Contributor

Re: check tape

If there is anything at all on the tape a dd would show something even garbage. Do not rely on the record # returned as you do not know what the block sizes are.

Try putting some data on another tape and then use dd to retrieve. At least this would show what a tape with something vs a tape with nothing would look like.

Bill Hassell
Honored Contributor
Solution

Re: check tape

Compression is handled completely by the tape drive. If it was compressed when recorded, it will be transparently expended when you read it. The compressed (best density) device files only control writing.

> # dd if=/dev/rmt/0 of=/tmp/datadump
> 0+0 records in
> 0+0 records out

This indicates that the first record on the tape is an end-of-file mark. There may be more files following this mark, so you first need to use the Berkeley device file for proper positioning of the tape (see man mt). Use the command: lssf /dev/rmt/*

# mt -f /dev/rmt/0mnb rewind
# mt -f /dev/rmt/0mnb fsf 1
# dd if=/dev/rmt/0mnb | xd -xc | more

If this produces some data records, the tape format may be difficult to identify. Some obscure system write a zero-length file at the front of a tape, followed by a proprietary backup format.

If this dd produces an EOT (end of tape) message, there is nothing on the tape at all -- despite what the label or owner say. Most modern tape drives will mark the end-of-tape following the last data written before a rewind. Someone may have written a null file to the tape and then popped it out. Any data previously on the tape can never be read again (except by an expensive data recovery company).




Bill Hassell, sysadmin