LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-10-2014, 07:50 PM   #1
embeddedPROJECTS
LQ Newbie
 
Registered: Aug 2012
Location: Modena - Italy
Posts: 12

Rep: Reputation: Disabled
tar does not 'tar' / 'untar' tarballs anymore


When i try to extract my tar.gz archives with tar xvzf i get:

tar: muxPi_Arch_13.img: Wrote only 2559 of 10240 bytes

Tested gzip and it works, tryed to compress and extract with zip and 7zip
the same files and they worked, reinstalled tar and updated, problem remains.

Some people had a lack of space in the HDD but if i do a check is not what the problem
seems to be:

bash-4.2# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 413G 84G 309G 22% /
tmpfs 1.5G 524K 1.5G 1% /dev/shm
/dev/sdb1 459G 89G 347G 21% /mnt/HDD2


Any idea? Thanks.
 
Old 09-10-2014, 09:34 PM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,057

Rep: Reputation: Disabled
It's hard to help if we don't know the characteristics of the file. Please provide output of following command:
Code:
file <tarball>
Also, if possible indicate the way the tarball was built, its content, and if publicly available a link to it. Bear also in mind that the tar command is generally not relevant for compressed single files.

In addition for recent versions of tar, the z option (as the j option) is generally useless as tar can "guess" the compression algorithm.

Last edited by Didier Spaier; 09-10-2014 at 09:43 PM.
 
Old 09-11-2014, 12:44 AM   #3
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,557

Rep: Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761
I'm gonna bet that is not a tar file. Try bsdtar which is also installed. It can read a variety of formats. You can check the format by issuing the following

Code:
bsdtar tvvf muxPi_Arch_13.img
 
Old 09-11-2014, 07:21 AM   #4
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,557

Rep: Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761
Quote:
Originally Posted by Didier Spaier View Post
In addition for recent versions of tar, the z option (as the j option) is generally useless as tar can "guess" the compression algorithm.
Generally but not totally. If the compressed tar file is received through a pipe you must specify the correct decompressor, e.g.

Code:
$ cat example.tar.gz | tar x
tar: Archive is compressed. Use -z option
tar: Error is not recoverable: exiting now
$ cat example.tar.bz2 | tar x
tar: Archive is compressed. Use -j option
tar: Error is not recoverable: exiting now
$ cat example.tar.xz | tar x
tar: Archive is compressed. Use -J option
tar: Error is not recoverable: exiting now
$ cat example.tar.lz | tar x
tar: Archive is compressed. Use --lzip option
tar: Error is not recoverable: exiting now
As a side note, tar clearly knows which compressor is being used, so why not just use it rather than telling the user to specify it? Interestingly the other major tar variant (bsdtar) will just handle automatic decompression without an option, even when a pipe is used.
 
Old 09-11-2014, 08:02 AM   #5
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Quote:
Originally Posted by ruario View Post
As a side note, tar clearly knows which compressor is being used, so why not just use it rather than telling the user to specify it?
I think I prefer the "Hmmm, it looks like a _____ but I'd rather you confirm it" approach, even if it means more work on the part of the user.

Of course, UNIX purists would argue that tar shouldn't be doing any compression/decompression itself anyway!
 
Old 09-11-2014, 08:59 AM   #6
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,557

Rep: Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761
Quote:
Originally Posted by GazL View Post
I think I prefer the "Hmmm, it looks like a _____ but I'd rather you confirm it" approach, even if it means more work on the part of the user.
Fair enough but then why do they do automatic decompression when a pipe is not used. Either do it all the time or not at all. GNU tar's way of being automatic half the time is just weird IMHO.

Quote:
Originally Posted by GazL View Post
Of course, UNIX purists would argue that tar shouldn't be doing any compression/decompression itself anyway!
Yep.
 
Old 09-11-2014, 06:32 PM   #7
embeddedPROJECTS
LQ Newbie
 
Registered: Aug 2012
Location: Modena - Italy
Posts: 12

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Didier Spaier View Post
It's hard to help if we don't know the characteristics of the file. Please provide output of following command:
Code:
file <tarball>
Also, if possible indicate the way the tarball was built, its content, and if publicly available a link to it. Bear also in mind that the tar command is generally not relevant for compressed single files.

In addition for recent versions of tar, the z option (as the j option) is generally useless as tar can "guess" the compression algorithm.
It's a Raspberry .img i took with command dd, anyway files are good, on the other Slackware machine (same version) it works.

Here what you asked for:

file muxPi-14-Arch.tar.gz
muxPi-14-Arch.tar.gz: gzip compressed data, from Unix, last modified: Thu Mar 20 23:15:32 2014
 
Old 09-11-2014, 07:55 PM   #8
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Quote:
Originally Posted by embeddedPROJECTS View Post
When i try to extract my tar.gz archives with tar xvzf i get:

tar: muxPi_Arch_13.img: Wrote only 2559 of 10240 bytes

Tested gzip and it works, tryed to compress and extract with zip and 7zip
the same files and they worked, reinstalled tar and updated, problem remains.
I have read this several times but am not sure I understand just what you mean.

Does gzip successfully open that file, but tar will not? That would mean that it was created with gzip, but not tar.

Your file output would look the same in either case I think.

So, in other words, if it opens with gzip but not tar, then use gzip, the file is misnamed as tar.gz and should be just gz. Hope that made sense.

You also said that you created it with dd. Was that dd | gzip? Can you tell us the exact command used to create it?

Last edited by astrogeek; 09-11-2014 at 07:57 PM.
 
  


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 Off
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
how to untar files with tar.tar extension johnkalikavunkal Linux - General 5 07-11-2008 05:36 AM
BackUp & Restore with TAR (.tar / .tar.gz / .tar.bz2 / tar.Z) asgarcymed Linux - General 5 12-31-2006 02:53 AM
Untar filename.tar.tar Dr.Swing Linux - Newbie 12 09-27-2002 07:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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