LinuxQuestions.org
Review your favorite Linux distribution.
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 08-25-2004, 06:32 AM   #1
jay2809
LQ Newbie
 
Registered: Aug 2004
Location: Cardiff
Posts: 3

Rep: Reputation: 0
Backup and Restore with TAR


Really, really new to Linux so sorry if this is obvious and I've missed it. I'm using SuSE 9 and I want to backup my home folder to tape which I've managed with

tar -cvf /dev/st0 /$HOME

This shows me all the files being backed up and my tape spins giving me the impression that its writing.

My Question: How do I get my files back? How can I verify the data is there?

Thanks in advance
 
Old 08-25-2004, 06:53 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,397

Rep: Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777
You could try
tar -tvf /dev/st0
which should list the filenames (t = table of contents)
or tar -xvf /tmp/test /dev/st0
which should extract the files into /tmp/test if you want to compare sizes/checksums etc.
Make sure the tape is rewound first.
I've tended to use taper (http://sourceforge.net/projects/taper/) as it has a nice (curses) based interface and is pretty stable. It's up to v7.
I suggest you try it out as it's free.

Last edited by chrism01; 08-25-2004 at 06:58 AM.
 
Old 08-25-2004, 06:53 AM   #3
Charalambos
Member
 
Registered: Aug 2004
Location: Switzerland
Distribution: debian
Posts: 149

Rep: Reputation: 15
To get the files back just apply the tar to extract the files.
--> tar xvf /dev/st0

To access the tape, work with the command "mt". Look up the different commands available in the man pages ("man mt").
Some examples:
- mt /dev/nrst0 rewind --> rewind the tape
- mt dev/nrst0 fsf 1 --> to the next file on the tape
- mt dev/nrst0 fsf --> skip to files (go to next but one file)

If you're using the driver st0, the tape will rewind after each backup.
If you want to avoid these, e.g you want to put several backups on the tape one after one, use the driver nrst0. This driver won't automatically rewind the tape. The command mt should always be used with the nrst0 driver only.
 
Old 08-25-2004, 06:54 AM   #4
jay2809
LQ Newbie
 
Registered: Aug 2004
Location: Cardiff
Posts: 3

Original Poster
Rep: Reputation: 0
so quick

you see, this is why Apple Macintosh will always rule. You post a question on a Mac forum and it gets answered before you can work it out for yourself.

The answer is simply tar -xvf /dev/st0 which restores all data to /root

Thanks me
 
Old 08-25-2004, 06:56 AM   #5
jay2809
LQ Newbie
 
Registered: Aug 2004
Location: Cardiff
Posts: 3

Original Poster
Rep: Reputation: 0
sorry

And whilst I was writing my findings two nice people have given me new things to try! OK so Linux might not be that bad

Thanks for imput guys, very useful, downloading taper now!
 
Old 08-25-2004, 06:59 AM   #6
Charalambos
Member
 
Registered: Aug 2004
Location: Switzerland
Distribution: debian
Posts: 149

Rep: Reputation: 15
Re: so quick

Quote:
Originally posted by jay2809
you see, this is why Apple Macintosh will always rule. You post a question on a Mac forum and it gets answered before you can work it out for yourself.
Well, seems they're way ahead of us.
Quote:
The answer is simply tar -xvf /dev/st0 which restores all data to /root
It will extract the files to where you execute the tar command.
 
Old 08-25-2004, 04:28 PM   #7
shengchieh
Member
 
Registered: Jul 2004
Location: Palo Alto, CA
Distribution: #! Korora
Posts: 472

Rep: Reputation: 30
You may also want to save space by compressing the file.
Learn about zip & unzip, gzip & gunzip, or bzip2 & bunzip2.
I think there is a way to compress and uncompress using tar
- others may know.

Sheng-Chieh
 
Old 08-25-2004, 04:47 PM   #8
Charalambos
Member
 
Registered: Aug 2004
Location: Switzerland
Distribution: debian
Posts: 149

Rep: Reputation: 15
Quote:
Originally posted by shengchieh
I think there is a way to compress and uncompress using tar
By adding the option z you compress / uncompress with gzip, with the parameter j with bzip2.
E.g: "tar cvzf tar-file.tar.gz files" you create a gzipped tar archive.
(".tar.gz" is the same as ".tgz")
 
  


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
tar to restore backup -- goes to sleep?!? JZL240I-U Linux - Software 4 05-10-2004 02:55 AM
Backup & Restore plan using tar markcasazza Linux - Newbie 1 04-14-2004 01:11 PM
tar backup & restore of current directory wishbone42 Linux - General 3 02-09-2004 02:30 AM
backup and restore using tar AZDAVE Linux - General 6 11-28-2003 08:40 PM
how can I restore a tar backup len snelly Linux - Newbie 1 04-30-2002 12:29 PM

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

All times are GMT -5. The time now is 12:17 AM.

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