1827875 Members
1380 Online
109969 Solutions
New Discussion

tar - exit code 5 ???

 
SOLVED
Go to solution
KRI
Advisor

tar - exit code 5 ???

Hi !
How can I get detailed error destription about tar exit code 5 ?
Why my tar cvf /dev/rmt/0mn `cat files.txt` ends with error number 5 ???

Reasons exit(5):
tar: Cannot change directory to '%s'
tar: Path '%s' skipped
tar: cannot open %s
Missing links to %s
tar: %s: cannot access file
tar: Out of memory. Cannot detect symbolic link loops
tar: Loop of symbolic links detected, tar terminated
tar: cannot stat %s. Not dumped.
tar: Size of %s > %s. Not dumped.
tar: %s: directory read error
tar: %s: directory read error
tar: %s: symbolic link too long
tar: can't read symbolic link
tar: %s: cannot open file
tar: %s: link to name too long
Out of memory. Link information lost
%s: file changed size
tar: %s is not a file. Not dumped
tar: %s: symbolic link failed
%s: cannot link
tar: %s couldn't create character device
tar: %s couldn't create block device
tar: %s couldn't create fifo
tar: %s couldn't create directory
tar: %s couldn't create directory
tar: %s - cannot create
tar: chmod failed
tar: chown failed
tar: couldn't get uname for uid %d
tar: couldn't get gname for gid %d
tar: pwd failed
tar: %s: pathname too long
tar: %s: prefix too long
tar: %s: file name too long
%s: file name too long

KRI
8 REPLIES 8
Peter Kloetgen
Esteemed Contributor

Re: tar - exit code 5 ???

Hi,

you use command substitution for your tar input, which only works, if the output is a list of files.

try the following command instead:

cd /path_to_desired_directory_whith_file.txt

tar cvf /dev/rmt/0mn file.txt

this should work...

Allways stay on the bright side of life!

Peter
I'm learning here as well as helping
Deepak Extross
Honored Contributor

Re: tar - exit code 5 ???

Errno 5 is a general I/O error.
Can you post the output of "cat files.txt"?
KRI
Advisor

Re: tar - exit code 5 ???

Hi !

files.txt contains list of files to archive.

I want to find decrtiption about tar exit code 5.
Example 1:
> tar cvf /dev/rmt/0mn `cat files.txt`
:
a /tmp/AAAa16909.TMP 16291 blocks
a /tmp/AAAa17203.TMP 811 blocks
a /tmp/AAAa19393.TMP 308 blocks
a /tmp/AAAa21440.TMP 811 blocks
> echo $?
5

Example 2:
> tar cvf /dev/null `cat files.txt`
:
a /tmp/AAAa16909.TMP 16291 blocks
a /tmp/AAAa17203.TMP 811 blocks
a /tmp/AAAa19393.TMP 308 blocks
a /tmp/AAAa21440.TMP 811 blocks
> echo $?
5


What means 5 ???


KRI
Deepak Extross
Honored Contributor
Solution

Re: tar - exit code 5 ???

Well, if you look in /usr/include/sys/errno.h, you'll find that 5 is the number for EIO (I/O Error)

'man errno' also tells you that EIO is "I/O error - some physical I/O error. This error may in some cases occur on a call following the one to which it actually applies."

Its a very general error message, though. Is the tar you are getting valid? As in, does "tar xvf " extract the files correctly?
Paula J Frazer-Campbell
Honored Contributor

Re: tar - exit code 5 ???

Hi

Tar codes


exit(0)
no error & no warning.

exit(1)
Tar: cannot create temporary file (%s)
Invalid blocksize. (Max %d)
tar: blocksize %d too big, can't get memory
tar:Invalid or non-existent device file %s
Can only create standard output archives
tar: cannot open %s
tar: option not supported for this device %s
tar: cannot write to %s: write protected
tar: usage tar [-]{txruc}[eONvVwAfblhm{op}][0-7[lmh]] ......
Attempt to create archive of no files. Nothing dumped.
tar: cannot preserve extent attributes for %s. aborting...
Tar: cannot create temporary file (%s)
Invalid blocksize. (Max %d)
tar: blocksize %d too big, can't get memory
tar:Invalid or non-existent device file %s
Can only create standard output archives

exit(2)
directory checksum error
tar: %s: HELP - extract write error
tar: Cannot close %s
Tar: tape write error

exit(3)
Tar: tape read error
Tar: tape blocksize error
Tar: blocksize = 0; broken pipe?
Tar: error! blocksize changed

exit(4)
Tar: tape backspace error
Tar: ioctl to write filemarks failed (%d). aborting...
Tar: ioctl to determine device online failed. aborting...

exit(5)
tar: Cannot change directory to '%s'
tar: Path '%s' skipped
tar: cannot open %s
Missing links to %s
tar: %s: cannot access file
tar: Out of memory. Cannot detect symbolic link loops
tar: Loop of symbolic links detected, tar terminated
tar: cannot stat %s. Not dumped.
tar: Size of %s > %s. Not dumped.
tar: %s: directory read error
tar: %s: directory read error
tar: %s: symbolic link too long
tar: can't read symbolic link
tar: %s: cannot open file
tar: %s: link to name too long
Out of memory. Link information lost
%s: file changed size
tar: %s is not a file. Not dumped
tar: %s: symbolic link failed
%s: cannot link
tar: %s couldn't create character device
tar: %s couldn't create block device
tar: %s couldn't create fifo
tar: %s couldn't create directory
tar: %s couldn't create directory
tar: %s - cannot create
tar: chmod failed
tar: chown failed
tar: couldn't get uname for uid %d
tar: couldn't get gname for gid %d
tar: pwd failed
tar: %s: pathname too long
tar: %s: prefix too long
tar: %s: file name too long
%s: file name too long

NOTE: exit code is condsidered as 'NONFATAL_ERRCODE'



Paula
If you can spell SysAdmin then you is one - anon
Peter Kloetgen
Esteemed Contributor

Re: tar - exit code 5 ???

Hi Krzysztof,

is it possible, that the output of your command line is longer than 1024 characters alltogether? This would cause an error like described, because your total lenght of command line is limited!

Check the same command with a shorter input file and see if it works.

Allways stay on the bright side of life!

Peter
I'm learning here as well as helping
KRI
Advisor

Re: tar - exit code 5 ???

Thank You !

One of files, listed in files.txt (files.txt contains 16823 files), have incorect uid/gid !

Look:

a KSI/archiv/65CILB49000ER1-COP 8477 blocks
[my comment] 0 - error code
tar: KSI/archiv/ls.txt: cannot open file
[my comment] 5 - error code

-rw-rw-rw- 1 ksimail ksimail 4340120 GRU 17 12:47 /u/ksimail/KSI/archiv/65CILB49000ER1-COP

-rw------- 1 root sys 10570521 GRU 21 09:47 /u/ksimail/KSI/archiv/ls.txt

This is a problem. This was a problem !

Thx !
KRI
Paula J Frazer-Campbell
Honored Contributor

Re: tar - exit code 5 ???

Hi

Incorrect UID/GID

Check you passwd / group files for duplicates.


Paula
If you can spell SysAdmin then you is one - anon