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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
08-25-2004, 06:32 AM
|
#1
|
LQ Newbie
Registered: Aug 2004
Location: Cardiff
Posts: 3
Rep:
|
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
|
|
|
08-25-2004, 06:53 AM
|
#2
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,397
|
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.
|
|
|
08-25-2004, 06:53 AM
|
#3
|
Member
Registered: Aug 2004
Location: Switzerland
Distribution: debian
Posts: 149
Rep:
|
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.
|
|
|
08-25-2004, 06:54 AM
|
#4
|
LQ Newbie
Registered: Aug 2004
Location: Cardiff
Posts: 3
Original Poster
Rep:
|
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
|
|
|
08-25-2004, 06:56 AM
|
#5
|
LQ Newbie
Registered: Aug 2004
Location: Cardiff
Posts: 3
Original Poster
Rep:
|
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!
|
|
|
08-25-2004, 06:59 AM
|
#6
|
Member
Registered: Aug 2004
Location: Switzerland
Distribution: debian
Posts: 149
Rep:
|
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.
|
|
|
08-25-2004, 04:28 PM
|
#7
|
Member
Registered: Jul 2004
Location: Palo Alto, CA
Distribution: #! Korora
Posts: 472
Rep:
|
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
|
|
|
08-25-2004, 04:47 PM
|
#8
|
Member
Registered: Aug 2004
Location: Switzerland
Distribution: debian
Posts: 149
Rep:
|
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")
|
|
|
All times are GMT -5. The time now is 12:17 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|