LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-04-2004, 10:50 AM   #1
TheDirtyPenguin
Member
 
Registered: Feb 2004
Location: Leicester, UK
Distribution: suse 9 pro
Posts: 34

Rep: Reputation: 15
Tar + Tapes = Troubles =@(


Howdy Folks.

Need some help please regarding tarring files to tape and restoring them. My question is how to I tar several files to tape and then have access to restore all of them. At present I can only backup and restore 1. Everything I backup after the first one cannot be found on the tape.

I have 4 folders which I want to tar up, backup, and remove each night (they change via rsync)

This is my procedure:

1. Tar up the first file,

tar -czvf folder1.tar.gz folder1

2. Back it up to tape,

tar -cv -b 16384 -f /dev/nst0 folder1.tar.gz

3. Then remove folder1.tar.gz (short on space on server)

Then I do steps 1, 2 and 3 for folders 2, 3 and 4.

I get no errors reported and my logs show that the files have been sent to tape.
The problem I have is when I try to restore. I can only restore the FIRST .tar.gz file. I have been using this to restore:

tar -xv -b 16384 -f /dev/nst0 folderX.tar.gz

If I try to restore folders 2,3 and 4 I get an error that they cannot be found on the tape. I thought I knew what the problem was; I thought it was because I only had 1 archive and that I was create a new archive each time. So I tried backing the first file as normal:

tar -cv -b 16384 -f /dev/nst0 folder1.tar.gz

And then backing up the others with:

tar -rv -b 16384 -f /dev/nst0 folder1.tar.gz

So instead creating a new archive I appended the files to the old one. However that didnt work, when I listed the files on the tape I only got the first file.

I then tried using:

tar -Av -b 16384 -f /dev/nst0 folder1.tar.gz

to concatenate the file to the archive and again, it seemed to backup fine, but on listing the files on the tape, I only get the first.

Should what I have tried worked? Am I missing something? Unfortunately I do not have enough space on the server to create a single tar ball of the folders (one is 16GB) so that oh so simple, stressless, option is out.

If you can help, you'll save my job!

Thanks guys
 
Old 03-04-2004, 11:08 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 26,192

Rep: Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087Reputation: 6087
/dev/nst0 does not rewind tape upon completion of writing. I'm not a tar expert but your probably not appending but creating 3 seperate blocks on tape. Once the folder1 is restored you need to foward to the next tape block.

BTW you do not need to tar the files to hard drive before writing to tape.

tar -b 16384 -cvf /dev/st0 /directory1 /directory2

Change directory1 directory2 to your actual data.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i decompress this tar.tar file? hmmm sounds new.. tar.tar.. help ;) kublador Linux - Software 14 10-25-2016 02:48 AM
from tapes to cd-audio alaios Linux - Software 1 03-20-2005 06:10 AM
Tar troubles adler321 Linux - Software 1 10-25-2004 03:15 PM
Tar/Tapes: Can somebody explain this to me...... TheDirtyPenguin Linux - General 3 03-09-2004 04:37 AM
Troubles with tar rebayona Linux - General 7 01-09-2002 08:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:52 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