LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-11-2012, 05:22 AM   #1
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 1,375

Rep: Reputation: 240Reputation: 240Reputation: 240
Cool Read Tape Contents


hi gurus, is there a general command to read the contents of a tape.

let's say an old tape lying around on the server room, and you don't know whether tar or cpio or other commands was used to write files on the tape.

is there such a general command to list the contents of a tape?


thank you for any input.
 
Old 05-11-2012, 07:54 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 16,430

Rep: Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938
Not that I know of. I would use the dd command to dump some data from the tape. By examining the header if one exists you might be able to determine the application or command that created the backup.
 
Old 05-11-2012, 11:58 AM   #3
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,415

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
I assume that you're askin about DAT tape drives. Suppose your tapes are loaded on /dev/st0.
Before reading the tape's data first you have to rewind the tape.
Code:
# mt -f /dev/st0 rewind
Then to list the contents of tape-
Code:
# tar -tzf /dev/st0
Or for more information you can check here.
 
Old 05-21-2012, 03:43 AM   #4
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 1,375

Original Poster
Rep: Reputation: 240Reputation: 240Reputation: 240
Question

Quote:
Originally Posted by michaelk View Post
Not that I know of. I would use the dd command to dump some data from the tape. By examining the header if one exists you might be able to determine the application or command that created the backup.
hi michael, what you mean by examining the header? how do i read the headers?

thank you.
 
Old 05-21-2012, 03:46 AM   #5
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 1,375

Original Poster
Rep: Reputation: 240Reputation: 240Reputation: 240
Question

Quote:
Originally Posted by Satyaveer Arya View Post
I assume that you're askin about DAT tape drives. Suppose your tapes are loaded on /dev/st0.
Before reading the tape's data first you have to rewind the tape.
Code:
# mt -f /dev/st0 rewind
Then to list the contents of tape-
Code:
# tar -tzf /dev/st0
Or for more information you can check here.
Hi Arya, it's LTO 2 tape drive, so basically if there's no general command. then the best way is just to overwrite the contents of the tape. or try the luck of using tar, cpio and other commands to determine what command was used to dump the data to the tape.
 
Old 05-21-2012, 05:27 AM   #6
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,415

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
I don't know exactly how to use or read the contents of LTO 2 tape drive. But in our data centre my colleague use windows application software to access that and you can refer this document here. I hope it will help you somehow.
 
Old 05-21-2012, 05:42 AM   #7
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,905

Rep: Reputation: 2921Reputation: 2921Reputation: 2921Reputation: 2921Reputation: 2921Reputation: 2921Reputation: 2921Reputation: 2921Reputation: 2921Reputation: 2921Reputation: 2921
Quote:
Originally Posted by JJJCR View Post
hi michael, what you mean by examining the header? how do i read the headers?

thank you.
If you could read the content, so you can have files you can identify the types by reading the first few bytes. The command file can do it and can give you an answer. But first you need to read the tape. With dd you can copy the content to disk and you will get much quicker access to the content.
 
Old 05-21-2012, 07:24 AM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 16,430

Rep: Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938
The file command might work or you could use a hex editor like hexedit to examine the data.
 
Old 05-27-2012, 06:11 AM   #9
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 1,375

Original Poster
Rep: Reputation: 240Reputation: 240Reputation: 240
thank you guys
 
Old 05-27-2012, 06:13 AM   #10
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 1,375

Original Poster
Rep: Reputation: 240Reputation: 240Reputation: 240
Very good and useful suggestions, thanks for all your help
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to read dump contents of tape driver. parkarnoor Linux - Newbie 3 01-13-2011 10:21 PM
Restoring tape contents g_ramesh Linux - Newbie 4 10-18-2010 07:29 AM
RedHat ES5 attempting to read tape contents on Quantum Superloader3 pearland71 Linux - Newbie 1 09-25-2010 07:31 AM
verify tape contents helpmhost Linux - Hardware 5 01-02-2008 02:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration