LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 01-04-2013, 03:29 PM   #1
YankeePride13
Member
 
Registered: Aug 2012
Distribution: Ubuntu 10.04, CentOS 6.3, Windows 7
Posts: 190

Rep: Reputation: 45
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!
 
Old 01-05-2013, 12:45 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 26,987
Blog Entries: 54

Rep: Reputation: 2742Reputation: 2742Reputation: 2742Reputation: 2742Reputation: 2742Reputation: 2742Reputation: 2742Reputation: 2742Reputation: 2742Reputation: 2742Reputation: 2742
What does "du --apparent-size -s /some/path" return on both systems?
 
Old 01-05-2013, 01:31 PM   #3
John VV
Guru
 
Registered: Aug 2005
Posts: 12,665

Rep: Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683Reputation: 1683
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) ?
 
Old 01-05-2013, 04:26 PM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 1,361

Rep: Reputation: 584Reputation: 584Reputation: 584Reputation: 584Reputation: 584Reputation: 584
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.
 
Old 01-07-2013, 08:02 AM   #5
YankeePride13
Member
 
Registered: Aug 2012
Distribution: Ubuntu 10.04, CentOS 6.3, Windows 7
Posts: 190

Original Poster
Rep: Reputation: 45
Quote:
Originally Posted by unSpawn View Post
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.
 
Old 01-07-2013, 08:04 AM   #6
YankeePride13
Member
 
Registered: Aug 2012
Distribution: Ubuntu 10.04, CentOS 6.3, Windows 7
Posts: 190

Original Poster
Rep: Reputation: 45
Quote:
Originally Posted by John VV View Post
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.
 
Old 01-07-2013, 08:08 AM   #7
YankeePride13
Member
 
Registered: Aug 2012
Distribution: Ubuntu 10.04, CentOS 6.3, Windows 7
Posts: 190

Original Poster
Rep: Reputation: 45
Quote:
Originally Posted by rknichols View Post
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.
 
Old 01-07-2013, 08:13 AM   #8
YankeePride13
Member
 
Registered: Aug 2012
Distribution: Ubuntu 10.04, CentOS 6.3, Windows 7
Posts: 190

Original Poster
Rep: Reputation: 45
Quote:
Originally Posted by YankeePride13 View Post
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.
 
Old 01-07-2013, 09:40 AM   #9
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Gentoo
Posts: 15,407
Blog Entries: 2

Rep: Reputation: 3994Reputation: 3994Reputation: 3994Reputation: 3994Reputation: 3994Reputation: 3994Reputation: 3994Reputation: 3994Reputation: 3994Reputation: 3994Reputation: 3994
Quote:
Originally Posted by YankeePride13 View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Porting application from Redhat to Ubuntu kaduu Linux - Newbie 6 11-18-2011 02:37 PM
Issues porting c program from SUSE to Redhat v9.2 serconsult Programming 11 07-31-2008 03:28 AM
Fedora & redhat How similar? [porting Fedora install script to Redhat] Four Linux - General 1 02-21-2008 05:56 PM
Free disk space in '/' getting smaller and smaller. simjii Suse/Novell 5 12-16-2005 11:24 AM
porting applications from suse to redhat mehtabhi Linux - Distributions 1 01-21-2003 11:52 PM


All times are GMT -5. The time now is 09:47 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration