[SOLVED] gzip: stdin: unexpected end of file

General support questions including new installations

[SOLVED] gzip: stdin: unexpected end of file

Postby hoodcanaljim » 2012/01/05 02:51:44

Hi

I preparation for upgrading my desktop machine from 5.7 to 6.2 I am backing up my /home files and /etc directories. But there are problems with the tar files I am creating. When run the following tar command and then try to get a listing of that file it shows this error.

Code: Select all
gzip: stdin: unexpected end of file
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now

This is the command used to create the file
Code: Select all
 tar -cvzf  /media/disk-1/ZZ.linux.d/pri/pri.music.tgz  /home/music 


When I run the command
Code: Select all
ls  -R /home/music  | wc -l   

it returns 2080

When I run the command
Code: Select all
tar -tzvf /media/disk-1/ZZ.linux.d/pri/pri.music.tgz  | wc -l

it returns 721 and the above error.

Am I looking at apples and oranges??
Is there a way to get tar to explain the errors??

It would appear there is something in the directory being tar'ed that creates the error because tar'ing the /etc directory and listing that tar gives no errors.

Thanks
Jim
hoodcanaljim
 
Posts: 196
Joined: 2006/02/05 17:49:10

Re: gzip: stdin: unexpected end of file

Postby pschaff » 2012/01/05 03:38:55

The difference in line count is no surprise and is due to the difference in handling of directories in "ls -l" versus "tar -tv". The "-" is optional on tar options - a bit of an oddity. What happens if you omit it? Nothing in my test.
Code: Select all
[build@poq1 ~]$ ls -R rpmbuild/
rpmbuild/:
BUILD  BUILDROOT  RPMS  SOURCES  SPECS  SRPMS  tmp

rpmbuild/BUILD:

rpmbuild/BUILDROOT:

rpmbuild/RPMS:
x86_64

rpmbuild/RPMS/x86_64:

rpmbuild/SOURCES:

rpmbuild/SPECS:

rpmbuild/SRPMS:

rpmbuild/tmp:
test
[build@poq1 ~]$ tar zcf test.tgz rpmbuild/
[build@poq1 ~]$ tar ztvf test.tgz
drwxrwxr-x build/build       0 2011-12-14 07:26 rpmbuild/
drwxrwxr-x build/build       0 2011-12-21 17:48 rpmbuild/RPMS/
drwxr-xr-x build/build       0 2012-01-04 22:26 rpmbuild/RPMS/x86_64/
drwxrwxr-x build/build       0 2012-01-04 22:26 rpmbuild/SRPMS/
drwxrwxr-x build/build       0 2012-01-04 22:27 rpmbuild/SPECS/
drwxr-xr-x build/build       0 2012-01-04 22:27 rpmbuild/tmp/
-rw-rw-r-- build/build       0 2012-01-04 22:27 rpmbuild/tmp/test
drwxr-xr-x build/build       0 2012-01-03 13:33 rpmbuild/BUILDROOT/
drwxrwxr-x build/build       0 2012-01-04 22:27 rpmbuild/BUILD/
drwxrwxr-x build/build       0 2012-01-04 22:27 rpmbuild/SOURCES/
[build@poq1 ~]$ tar ztvf test.tgz | wc -l
10
[build@poq1 ~]$ tar -ztvf test.tgz | wc -l
10
[build@poq1 ~]$ ls -R rpmbuild/ | wc -l
26
[build@poq1 ~]$
Perhaps you are right about the content of the archive being the issue, but I don't know what would cause that.
pschaff
Retired Moderator
 
Posts: 18277
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America

Re: gzip: stdin: unexpected end of file

Postby TrevorH » 2012/01/05 09:34:26

hoodcanaljim wrote:

This is the command used to create the file
Code: Select all
 tar -cvzf  /media/disk-1/ZZ.linux.d/pri/pri.music.tgz  /home/music 



Are you sure that this command actually completes successfully and creates the archive? The only time I've seen things like you report is when the target file resides on a filesystem that runs out of space...
User avatar
TrevorH
Forum Moderator
 
Posts: 9103
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

[SOLVED] gzip: stdin: unexpected end of file

Postby gerald_clark » 2012/01/05 14:54:08

If the disk in /media is VFAT, the tar file may be too big.
gerald_clark
 
Posts: 7166
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: gzip: stdin: unexpected end of file

Postby hoodcanaljim » 2012/01/05 17:11:55

If the limit on a VFAT drive is 4.0g then that is the problem. I was able to copy all the files onto the external drive, 12g of them. But the tar files are stopped at 4.0g.


Thanks
Jim
hoodcanaljim
 
Posts: 196
Joined: 2006/02/05 17:49:10

Re: gzip: stdin: unexpected end of file

Postby gerald_clark » 2012/01/05 17:25:45

That's the problem.
You could pipe the tar command through split.
gerald_clark
 
Posts: 7166
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: gzip: stdin: unexpected end of file

Postby hoodcanaljim » 2012/01/05 23:10:36

Thanks for all the help.

I am past this problem since I copied all the files onto to backup drive. I should be good to install 6.2 and reload files as required.


Thanks again Trevor, Gerald and Phil
Jim

This could be marked SOLVED.
hoodcanaljim
 
Posts: 196
Joined: 2006/02/05 17:49:10

Re: [SOLVED] gzip: stdin: unexpected end of file

Postby AlanBartlett » 2012/01/06 01:22:57

Thank you for reporting back.

This could be marked SOLVED.

Done, as requested. :-)
User avatar
AlanBartlett
Forum Moderator
 
Posts: 8975
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk


Return to CentOS 5 - General Support

Who is online

Users browsing this forum: No registered users and 1 guest