Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 07-10-2007, 12:19 AM   #1
LQ Newbie
Registered: Jul 2007
Posts: 3

Rep: Reputation: 0
Appending to a tar tape backup

I have a Red Hat Enterprise Linux ES release 4 (Nahant Update 5) system running on HP hardware including a HP Ultrium 448 Internal Tape Drive. All works well, except appending to a tar backup. I use the following command to backup everything on the system except the data2 directory.

cd /
tar --preserve-permissions --exclude-from backup-exclude --same-owner -cf /dev/st0 *

The backup-exclude file contains the following...


When the backup completed it verifies correct using
tar -tf /dev/st0

For business reasons I have to backup the data2 directory 10 hours after the initial backup starts... For this backup I use the following...

tar --preserve-permissions --preserve --same-owner -rf /dev/st0 data2/*

When I run the above command I get error messages for every file in the data2 folder saying

tar: data2/44401.dat: Not found in archive

What have I missed?

Regards ... AJ
Old 07-10-2007, 02:49 AM   #2
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
I found a couple of items in the tar info manual that might apply:

   `--append' cannot be performed on some tape drives, unfortunately,
due to deficiencies in the formats those tape drives use.  The archive
must be a valid `tar' archive, or else the results of using this
operation will be unpredictable.  *Note Media::.
   In order to update an archive, `tar' must be able to backspace the
archive in order to reread or rewrite a record that was just read (or
written).  This is currently possible only on two kinds of files: normal
disk files (or any other file that can be backspaced with `lseek'), and
industry-standard 9-track magnetic tape (or any other kind of tape that
can be backspaced with the `MTIOCTOP' `ioctl'.

   This means that the `--append' (`-r'), `--update' (`-u'),
`--concatenate' (`--catenate', `-A'), and `--delete' commands will not
work on any other kind of file.  Some media simply cannot be
backspaced, which means these commands and options will never be able
to work on them.  These non-backspacing media include pipes and
cartridge tape drives.

   Some other media can be backspaced, and `tar' will work on them once
`tar' is modified to do so.
I don't know if this would apply with your hardware. Could you create another backup on the same tape?

Last edited by jschiwal; 07-10-2007 at 02:53 AM.
Old 07-10-2007, 09:34 PM   #3
LQ Newbie
Registered: Jul 2007
Posts: 3

Original Poster
Rep: Reputation: 0
I have been doing some more work on this issue and have found that if the data2 directory is on the tape then the -r option appears to work.

I can't backup the data2 folder because it is likely that some files may be open (which will cause the back up to fail and subsequent tasks not to run).

The real issue is the message

tar: data2/44401.dat: Not found in archive

The message appears next to each file in the data2 folder.
Old 07-11-2007, 02:45 AM   #4
LQ Newbie
Registered: Jul 2007
Posts: 3

Original Poster
Rep: Reputation: 0

The issue was the --preserve paramater on the command line

tar --preserve-permissions --preserve --same-owner -rf /dev/st0 data2/*

If I use

tar --preserve-permissions --same-owner -rf /dev/st0 data2/*

it works perfectly...



backup, tar

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
BackUp & Restore with TAR (.tar / .tar.gz / .tar.bz2 / tar.Z) asgarcymed Linux - General 5 12-31-2006 03:53 AM
tar backup maximum 2gb only per tape tsaravan Linux - General 6 09-20-2006 07:45 AM
Using a DDS5 tape drive to restore from a DDS3 backup tape. AndrewCAtWayofthebit Linux - Hardware 1 05-14-2006 10:15 AM
newbie tar/tape backup questions mattl Fedora 3 04-24-2006 11:07 PM
How to perform appending backup on tape drive. Need urgent help LenkaNguyen Linux - Hardware 2 05-11-2002 09:16 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:44 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration