2

I noticed this when sync'ing a folder with hundreds of thousands of sub folders from my local 32-bit Ubuntu (10.04, ext3) to my remote 64-bit (10.04 ext3) VPS.

The size of the local directory is hundreds of M's larger than that of the remote server.

It turns out that the difference is caused by the different sizes of the folders --

$ uname -a
Linux <> 2.6.39.1-x86_64-<> #1 SMP Tue Jun 21 10:04:20 EDT 2011 x86_64 GNU/Linux
$ ls -ld electronics/
drwxr-xr-x 12 jerry jerry 4096 2012-01-22 06:13 electronics/


$ uname -a
Linux <> 2.6.32-37-generic #81-Ubuntu SMP Fri Dec 2 20:35:14 UTC 2011 i686 GNU/Linux
$ ls -ld electronics/
drwxr-xr-x 12 jerry jerry 12288 2012-01-22 14:13 electronics/

The question is: Why are the folder sizes different? And when I install a new Ubuntu, how to make them as small as possible?

2
  • My initial suspicion was that your block sizes were different ; directories seem to occupy 1 block by default (4096 bytes). But apparently, 4096 bytes is the maximum block size on ext3. To verify this : serverfault.com/questions/29887/… My second thought is therefore that the directories on your client have grown to accommodate extra file entries, but that they do not shrink afterwards. What happens if you delete one of these folders and recreate it with the same content?
    – Adrian
    Jan 23, 2012 at 13:18
  • I just copied the folder locally and the resulting folder is the same size (i.e., hundreds of M's larger than the remote folder). Any other hypothesis?
    – Jerry
    Jan 24, 2012 at 6:40

0

Browse other questions tagged .