LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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-08-2004, 09:32 AM   #1
TheDirtyPenguin
Member
 
Registered: Feb 2004
Location: Leicester, UK
Distribution: suse 9 pro
Posts: 34

Rep: Reputation: 15
Tar/Tapes: Can somebody explain this to me......


Hey Folks,

Can somebody please explain what the crack is with this problem.

I have a backup folder in /var which contains 4 rsync'd server folders:

server08
server15
server16
server18

They all contain the etc folder from the server, and other important data I need to backup.

To send them to tape I have been using: (cd'ing to /var first)

tar -cv -b 16384 -f /dev/nst0 backup/ > /var/log/backup/tapebackup/BACKUP_`date +%Y%m%d`.log 2> /var/log/backup/tapebackup/BACKUP_`date +%Y%m%d`.log

Now, according to my logs, the backup went fine and everything went to plan.

However, If I do a

tar -t -b 16384 -f /dev/nst0

To list the contents of the tape, it firstly says

tar: This does not look like a tar archive
tar: Skipping to next header
tar: Archive contains obsolescent base-64 headers


And then it goes on to list the contents of the tape. However, it does NOT list the server15 folder and all its contents, and misses out some of server16

Now according to my backup logs, they backed up in the following order:

server15
server16
server18
server08

And when I list the contents I get:

Half of server16
server18
server08

And no server15. How come? Its driving me nuts! Does anybody know what I am doing wrong? Why are they backing up in that order? And whats happened to my server15!?!?

Thanks for any help!

P.S. This has been driving me nuts for weeks now. If I cant get it working I will have to give up on using tar and try using cpio. However cpio scares the hell out of me, and if anyone could give me a quick run down on how I would put together a cpio command for the above I would be forever grateful

Last edited by TheDirtyPenguin; 03-08-2004 at 09:44 AM.
 
Old 03-08-2004, 04:03 PM   #2
ac1980
Member
 
Registered: Aug 2003
Location: Trento, Italy
Distribution: Debian testing
Posts: 394

Rep: Reputation: 30
Don't want to be rude, but are you sure the tape does not have a non-writable pre-gap?
Or maybe the block device expects some command bytes after being opened for writing. Remember with such a blocksize, a single lost byte at the beginning will result in 8Mb unreadable data.

What I'd do is make /dev/tape a symlink to /dev/nst0, and then run tar without -f option. After all, tar was designed to run with tapes.

As a (ugly) workaround, you can decrease block size to, e.g., 2048, and tell tar to backup a placeholder 1MB file before the backup directory:
Code:
dd bs=1024 bc=1024 if=/dev/zero of=/tmp/vanumspatium
tar -cv -b 2048 /tmp/vanumspatium /var/backup/
rm /tmp/vanumspatium
 
Old 03-09-2004, 03:47 AM   #3
TheDirtyPenguin
Member
 
Registered: Feb 2004
Location: Leicester, UK
Distribution: suse 9 pro
Posts: 34

Original Poster
Rep: Reputation: 15
Thanks for the help!

I'm erasing the tapes now and I'll try reducing my blocksize (I have no idea how I came to that number anyway!)

I'll also try creating a symlink as you said.

Could you explain what creating a 1mb placeholder will do? It looks pretty cool but I'm not sure what it will do!

I'll let you know how I got on

Thanks again.
 
Old 03-09-2004, 04:37 AM   #4
ac1980
Member
 
Registered: Aug 2003
Location: Trento, Italy
Distribution: Debian testing
Posts: 394

Rep: Reputation: 30
Quote:
Could you explain what creating a 1mb placeholder will do? It looks pretty cool but I'm not sure what it will do!
That's not cool, it might be a patch if nothing else works.
I assume for some reason I don't know, a few bytes at the beginning of the stream get lost, so the first block is practically unreadable due to missing headers. If you can't fix this, at least you should ensure what you lose is not valuable data. The actual block size is (what you specify with -b)*512 bytes

It's been a while since I worked with tapes, however I think if you let tar know it's writing to a tape (by removing the -f option) it should work. Refer to tar manpage.
 
  


Reply



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
could somebody please explain .tar installs and makefiles gejoroni Linux - Newbie 6 07-24-2005 11:27 PM
from tapes to cd-audio alaios Linux - Software 1 03-20-2005 06:10 AM
Tar + Tapes = Troubles =@( TheDirtyPenguin Linux - General 1 03-04-2004 11:08 AM
Used DLT tapes justintime Linux - General 1 02-29-2004 02:42 PM

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

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