tar compression file size(s)

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

tar compression file size(s)

Postby MikeFinch » Nov 14th, '13, 00:22

Hi All!
I have just used Dolphin to compress a folder. I right clicked the folder and chose 'Compress/Compress To...' and saved the .tar.gz file to the Home (same) directory. The size of the tar.gz file is 127.8kb.
I then saved the IDENTICAL folder to my external hard drive and the tar.gz produced is only 85.0kb.
Why the whopping difference? :o
Mike
MikeFinch
 
Posts: 61
Joined: Apr 12th, '12, 07:20

Re: tar compression file size(s)

Postby nigelc » Nov 14th, '13, 13:05

Hi,
What sort of data was/is it? It might have had lots of space characters in it, or repeating data.
nigelc
 
Posts: 266
Joined: Aug 28th, '11, 09:35

Re: tar compression file size(s)

Postby doktor5000 » Nov 14th, '13, 23:36

?
How does that matter for the created archive size, when using the same source data, but two differerent source media/filesystems creates different size archives?
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18052
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: tar compression file size(s)

Postby MikeFinch » Nov 20th, '13, 00:11

Hi Nigelc!

The files were/are php scripts. Yes lots of white space I suppose. Is it a coincidence that the largest was almost exactly 50% bigger than the smallest?

Mike 8-)
MikeFinch
 
Posts: 61
Joined: Apr 12th, '12, 07:20

Re: tar compression file size(s)

Postby nigelc » Nov 21st, '13, 06:38

Mike,
It makes quite a difference whether the files are random data.
These two files are the same random data. One is compressed and one not. The compressed is really bigger than the original.
Code: Select all
-rw-r--r-- 1 ewok ewok 1073915443 Nov 21 15:19 file01.gz
-rw-r--r-- 1 ewok ewok 1073741824 Nov 21 15:16 file-xx


This the same size file, but all zeros.
Code: Select all
-rw-r--r-- 1 ewok ewok    1042077 Nov 21 15:23 zero-xx.gz
nigelc
 
Posts: 266
Joined: Aug 28th, '11, 09:35

Re: tar compression file size(s)

Postby doktor5000 » Nov 22nd, '13, 00:06

Well, that's logical but not what's described in the initial post, or at least not how I've understood it.

OP says he compressed one folder to two different filesystems, getting different sizes of the generated tarball.
Differing factor is the filesystem, not the data from which the tarball is created which is identical as mentioned by OP.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18052
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: tar compression file size(s)

Postby MikeFinch » Nov 24th, '13, 09:09

Folks! Yes the files were identical. Still a 3:2 ratio in sizes and I still don't understand why.
Ah well!
Cheers. :lol:
MikeFinch
 
Posts: 61
Joined: Apr 12th, '12, 07:20

Re: tar compression file size(s)

Postby doktor5000 » Nov 24th, '13, 17:46

If you don't provide informations about the underlying filesystems of the the folders where you copied the tarball to, nobody can tell the cause of the differing size.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18052
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: tar compression file size(s)

Postby MikeFinch » Nov 28th, '13, 09:06

doktor5000

I think the file system in both cases was ext3.

Cheers! :oops:
MikeFinch
 
Posts: 61
Joined: Apr 12th, '12, 07:20

Re: tar compression file size(s)

Postby doktor5000 » Nov 28th, '13, 17:54

Could you show the output of
Code: Select all
tune2fs -l /dev/sdxN
for both filesystems?
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18052
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: tar compression file size(s)

Postby nigelc » Nov 29th, '13, 12:53

How would the type of filesystem affect the the compression ratio?
nigelc
 
Posts: 266
Joined: Aug 28th, '11, 09:35

Re: tar compression file size(s)

Postby doktor5000 » Nov 29th, '13, 14:37

Differing inode sizes, block size and bytes-per-inode ratios ...
And it's not the compression ratio that's affected, but simply the resulting filesize of the tarball.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18052
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: tar compression file size(s)

Postby MikeFinch » Dec 4th, '13, 02:58

Doktor5000

Haven't had a go using tune2fs etc but was wrong about the HD filesystem.

My Desktop PC is ext3 and the external HD is NTFS. Maybe that is the answer? Therefore the smaller one was NTFS.

Does this mean ext3 is less efficient (in terms of filesize)? Hope not.

MikeFinch :D
MikeFinch
 
Posts: 61
Joined: Apr 12th, '12, 07:20

Re: tar compression file size(s)

Postby doktor5000 » Dec 4th, '13, 10:38

So the differing factor is in the underlying filesystems. And that does not mean that NTFS is more efficient,
that only means the default filesystem configuration in your case provides better results with small files with NTFS with your workload.

Please mark the thread accordingly by editing the topic of the first post and prefix it by [SOLVED], thanks
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18052
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest