LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-11-2016, 11:56 AM   #1
DimTheo
LQ Newbie
 
Registered: Nov 2016
Posts: 20

Rep: Reputation: Disabled
How to view files from a tape?


Hello

I have been backing up some files to a tape like this :

tar cvf - *many files here* | ssh root@192.168.1.2 dd of=/dev/rmt/1 obs=126b


the tape device is mounted on a solaris system

the tar process completes always fine with no errors but when i ssh into the solaris and try to view the files by typing tar tvf /dev/rmt/1 i get a tar : tape error

can you help? thanks
 
Old 11-11-2016, 12:06 PM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,555

Rep: Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088
You have to read the tape at the same block size used to write it.
Code:
tar -b 126 -tvf /dev/rmt/1
 
Old 11-11-2016, 06:59 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,008

Rep: Reputation: 3409Reputation: 3409Reputation: 3409Reputation: 3409Reputation: 3409Reputation: 3409Reputation: 3409Reputation: 3409Reputation: 3409Reputation: 3409Reputation: 3409
Wonder if you have to rewind it or set it to index.

https://docs.oracle.com/cd/E23824_01...efiles-30.html has some info.
 
Old 11-12-2016, 04:51 AM   #4
DimTheo
LQ Newbie
 
Registered: Nov 2016
Posts: 20

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by rknichols View Post
You have to read the tape at the same block size used to write it.
Code:
tar -b 126 -tvf /dev/rmt/1

hi

i still get the same errors

tar -b 126 -tvf /dev/rmt/1
tells me how i syntax tar

tar -tvf /dev/rmt/1 -b 126
tar: /dev/rmt/1: I/O error


any others tips please?
 
Old 11-12-2016, 05:04 AM   #5
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 16,644

Rep: Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615
probably the tape device was not rewound at the beginning. I don't know how did you take care about the position of the tape at all.
 
Old 11-12-2016, 08:03 AM   #6
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 1,772

Rep: Reputation: 798Reputation: 798Reputation: 798Reputation: 798Reputation: 798Reputation: 798Reputation: 798
Maybe you must read the tape with the reverse command?
Code:
dd if=/dev/rmt/1 ibs=126b | tar tvf -
Get the tape status with
Code:
mt /dev/rmt/1 status
Explicitly rewind the tape with
Code:
mt /dev/rmt/1 rewind
 
Old 11-16-2016, 05:15 AM   #7
DimTheo
LQ Newbie
 
Registered: Nov 2016
Posts: 20

Original Poster
Rep: Reputation: Disabled
thank you i got it to work with dd if=/dev/rmt/1 ibs=126b | tar tvf -

now i would like to copy all data from that tape to a local folder which i have already cd to
Would the command be

tar xvf - . | ssh root@192.168.1.2 dd of=/dev/rmt/1 obs=126b ?

thanks

Last edited by DimTheo; 11-16-2016 at 05:17 AM.
 
Old 11-16-2016, 05:20 AM   #8
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 16,644

Rep: Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615
reverse order:
ssh root@192.168.1.2 dd of=/dev/rmt/1 obs=126b | tar xvf -
 
Old 11-16-2016, 05:28 AM   #9
DimTheo
LQ Newbie
 
Registered: Nov 2016
Posts: 20

Original Poster
Rep: Reputation: Disabled
thanks
seems to be working
 
Old 11-16-2016, 05:31 AM   #10
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 16,644

Rep: Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615
sorry, I missed an important point:
sh root@192.168.1.2 dd if=/dev/rmt/1 obs=126b | tar xvf -
do not use the previous one, that may overwrite your tape!
 
Old 11-16-2016, 05:40 AM   #11
DimTheo
LQ Newbie
 
Registered: Nov 2016
Posts: 20

Original Poster
Rep: Reputation: Disabled
hhmm i get these

ssh root@192.168.1.2 dd if=/dev/rmt/1 obs=126b | tar xvf -
Password:
read: Not enough space
0+0 records in
0+0 records out
tar: This does not look like a tar archive
tar: Error exit delayed from previous errors
 
Old 11-16-2016, 05:59 AM   #12
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 16,644

Rep: Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615
probably you need to rewind the tape before
 
Old 11-16-2016, 06:01 AM   #13
DimTheo
LQ Newbie
 
Registered: Nov 2016
Posts: 20

Original Poster
Rep: Reputation: Disabled
i did , but no luck

mt -f /dev/rmt/1 rewind
bash-2.05# exit


ssh root@192.168.1.2 dd if=/dev/rmt/1 obs=126b | tar xvf -
Password:
read: Not enough space
0+0 records in
0+0 records out
tar: This does not look like a tar archive
tar: Error exit delayed from previous errors
 
Old 11-16-2016, 06:06 AM   #14
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 16,644

Rep: Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615Reputation: 5615
in post #7 you told it is working. Probably the content on the tape is now damaged, you need to rewrite it first.
 
Old 11-16-2016, 06:08 AM   #15
DimTheo
LQ Newbie
 
Registered: Nov 2016
Posts: 20

Original Poster
Rep: Reputation: Disabled
trut , with dd if
but you told me to use dd if

with if it craps out
with of , it s ok

should i use dd if or dd of ?

Last edited by DimTheo; 11-16-2016 at 06:12 AM.
 
  


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
Is Tar file to tape drive faster than dir/files to tape drive? Runge_Kutta Linux - General 2 03-11-2009 07:13 AM
tape contents view Ammad Linux - General 1 09-23-2008 07:57 AM
view the content of tape binuveranal Linux - Server 1 02-26-2008 11:18 PM
how to view content of tape angelfire Linux - Hardware 5 07-22-2006 04:21 AM
How can konqueror view html files in .gz & .bz2 files directly? ailinzhe Linux - Software 5 05-24-2004 08:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:19 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
Open Source Consulting | Domain Registration