LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Porting a system from RedHat to Ubuntu yields smaller directories (https://www.linuxquestions.org/questions/linux-server-73/porting-a-system-from-redhat-to-ubuntu-yields-smaller-directories-4175444201/)

YankeePride13 01-04-2013 03:29 PM

Porting a system from RedHat to Ubuntu yields smaller directories
 
Hello,

Has anyone ported a system from Red Hat to Ubuntu before? (or vice versa).

I have a system that I recently upgraded and made the switch from Red Hat 4 to Ubuntu 12.04. to move the files over from one system to the next I ran an rsync. The result was the same number of files but the size on the directory was smaller. Is this normal? Or is there a problem that I'm not seeing. I thought maybe the two systems either handle disk usage differently or maybe used a different character encoding...let me know if you've run into this. Thanks!

unSpawn 01-05-2013 12:45 PM

What does "du --apparent-size -s /some/path" return on both systems?

John VV 01-05-2013 01:31 PM

a wild guess
the difference in the file systems on the ancient rhel4 and the modern Ubuntu 12.04

what was being used on rhel4 ?
And what is currently being used on 12.04 ( LTS -- guessing) ?

rknichols 01-05-2013 04:26 PM

A directory (that is, the directory file itself) never shrinks. Once it has grown to accommodate a large number of file names, that space is never released. When you make a copy of that directory, the new directory will be sized for the current number of files.

YankeePride13 01-07-2013 08:02 AM

Quote:

Originally Posted by unSpawn (Post 4863543)
What does "du --apparent-size -s /some/path" return on both systems?

Old Box (Red Hat 4):

Code:

# du --apparent-size -s /home/user/
217325  /home/user/

New Box (Ubuntu 12.04 LTS):

Code:

# du --apparent-size -s /home/user/
217334  /home/user/

As you can see it's a very small difference, which is what makes me think that it has something to do with the differences between the way the file systems save files/directories.

YankeePride13 01-07-2013 08:04 AM

Quote:

Originally Posted by John VV (Post 4863557)
a wild guess
the difference in the file systems on the ancient rhel4 and the modern Ubuntu 12.04

what was being used on rhel4 ?
And what is currently being used on 12.04 ( LTS -- guessing) ?

on rhel4 it was ext3 and on ubuntu 12.04 it's ext4.

YankeePride13 01-07-2013 08:08 AM

Quote:

Originally Posted by rknichols (Post 4863625)
A directory (that is, the directory file itself) never shrinks. Once it has grown to accommodate a large number of file names, that space is never released. When you make a copy of that directory, the new directory will be sized for the current number of files.

Interesting, I'm going to test this.

YankeePride13 01-07-2013 08:13 AM

Quote:

Originally Posted by YankeePride13 (Post 4864570)
Interesting, I'm going to test this.

After playing around with it quick, it seems the directory size output from
Code:

du --apparent-size -s /home/user/
changes to reflect the contents so this is not the answer.

TobiSGD 01-07-2013 09:40 AM

Quote:

Originally Posted by YankeePride13 (Post 4864567)
on rhel4 it was ext3 and on ubuntu 12.04 it's ext4.

And I think you have found the answer. Different filesystems will use up different amounts of space for storing the same data.


All times are GMT -5. The time now is 01:34 PM.