LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-07-2013, 06:57 AM   #1
diejengent
LQ Newbie
 
Registered: Nov 2012
Posts: 25

Rep: Reputation: Disabled
different sizes of directories? why?


Hello,

I just made a backup of a directory with the command "cp -Rp folder /backup/"

Then I wanted to make sure that the contents are the same by running "du -bcs" in both directories.

Turns out that the original directory was using 4096 bytes more than the backup directory; this was caused by the size of the directoy...

original directoy uses: 8192 bytes
backup directoy uses: 4096 bytes

Why is this? I mean it is an exact copy of the original directory.

Can anyone please explain why sometimes a directoy 'claims' more bytes than another directory?

Thanks in advance!
 
Old 02-07-2013, 07:26 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,258

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
You'll note that's a multiple of 4k. That's the min size of the next block. When there's a been a lot of additions and deletions, the dir file can end up with gaps.
By rebuilding it from scratch you can lose those.
https://en.wikipedia.org/wiki/Inode
http://www.cs.nyu.edu/courses/spring...ecture-24.html
 
Old 02-07-2013, 08:28 AM   #3
diejengent
LQ Newbie
 
Registered: Nov 2012
Posts: 25

Original Poster
Rep: Reputation: Disabled
Thanks alot...very clear to me now.

So is it roughly to compare like a directory being a 'partition' and when there has been more action within it it becomes more 'fragmented'?

Last edited by diejengent; 02-07-2013 at 08:29 AM.
 
  


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
Comparing Directories (diff..?) with its File's Sizes, Ignoring Filenames? mrm5102 Linux - Newbie 2 04-23-2012 09:42 AM
How to list the directories of a file system by their sizes? joaotelles Solaris / OpenSolaris 3 12-04-2008 03:11 PM
define different physical sizes on Multiple Monitors of different sizes MasterC Linux - Desktop 2 03-18-2008 05:24 PM
Searching multiple directories and sub directories for a file jeep99899 Linux - Newbie 2 10-13-2005 01:23 PM
Directories sizes franz1927 Fedora 1 03-07-2005 02:06 AM


All times are GMT -5. The time now is 10:58 PM.

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