Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I tar ~/Documents to create backups. My .tgz files are approximately 700MB. I have created three such files over the past 3 weeks and I used Ubuntu One to protect these from loss. In all three cases, the file size reported on the Ubuntu One website does not agree with the file size reported by Nautilus. In all three cases, the file size in the cloud is several MB smaller than the one on the desktop file system.

Example: My 2012 May 10 backup is 761MB but on the cloud it is 726MB.

Why is this happening?

share|improve this question
    
Possible duplicate? askubuntu.com/questions/145478 –  fossfreedom Jun 2 '12 at 22:30
add comment

3 Answers 3

up vote -2 down vote accepted

Ubuntu One uses zlib to compress data before sending it, to save some bandwidth when doing the transfer. It also stores the file content in the compressed form on the server, to avoid having to recompress it before sending it back down the stream.

The answer has nothing to do with file system block sizes.

share|improve this answer
2  
This can't be right. The file was already compressed with gzip, so it can not be compressed any more. –  psusi Sep 11 '13 at 13:26
    
@psusi Yes it can be compressed (or slightly deflated). Compression AND base 10 vs base 8 math, are both aspects which contribute to the difference in size reported locally versus on the server. Windows does not use base 10 descriptions of file sizes, nor do many of the command line tools. –  dobey Sep 11 '13 at 15:45
2  
No, gzipping a file that is already gzipped actually makes it a few bytes larger, not smaller, since it adds another header and can not compress the data any further. 761 million bytes is 726 MiB so the base 10 vs base 8 would explain this exact difference. A quick experiment uploading a very compressible text file shows that Ubuntu One reports the correct, uncompressed size in MiB. –  psusi Sep 11 '13 at 19:03
add comment

This is because Nautilus is showing you the file size in megabytes, while the Ubuntu One Web interface is showing you the file size in mibibytes. Compare:

  • 1 kilobyte = 1000 byte
  • 1 megabyte = 1000 kilobytes
  • 1 gigabyte = 1000 megabytes
  • ...

And:

  • 1 kibibyte = 1024 byte
  • 1 kibibyte = 1024 kibibytes
  • 1 gibibyte = 1024 mibibytes
  • ...

So, in your example: 761 are megabytes, 726 are mibibytes:

  • 761 MB = 761 × 1000 kB = 761 × 1000 × 1000 B = 761'000'000 B

Now let's convert 761'000'000 B to mibibytes:

  • 761'000'000 B = 761'000'000 ÷ 1024 KiB = 761'000'000 ÷ 1024 ÷ 1024 MiB ≈ 726 MiB

As you can see, the right symbol for mibibytes is not MB, but MiB. Unfortunately, mebibytes and related units have been defined just in recent times. Quoting Wikipedia:

The mebi- prefix was defined by the International Electrotechnical Commission (IEC) in December 1998.

Therefore nowadays many people are used to write MB while they actually mean MiB. This is a common mistake that you will find in Ubuntu One and many other applications.

share|improve this answer
    
U1 actually does say "MiB" –  psusi Sep 13 '13 at 13:51
    
@psusi: looking at one.ubuntu.com/files I see "100 MB" near my files generated with split --bytes=100M. –  Andrea Corbellini Sep 13 '13 at 13:57
    
Oh goofy, they do make the mistake everywhere else, it's just the upload window that said "MiB". –  psusi Sep 13 '13 at 14:02
add comment

The space allocated to files is determined by the cluster size for the formatted partition. Cluster size is highly variable in FAT32/FAT16/NTFS/EXT3/EXT4 file systems. That why you will see a difference.

If I had 12 ounces of fluid and only 10 ounce cups then it would require two cups to hold the 10 ounces of fluid.

20 ounces of storage space to hold 12 ounces.

40 ounces would require 4 cups or 40 ounces of available storage space.

Computers work in a similar way depending on the allocation unit sizes used on PC when it was formatted.

Look at the properties of a 1kb .txt file where the file size would show 1kb but it would then also show how much storage space it requires due to the size of your allocation units.

Source: computing.net

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.