LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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, 05: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, 06:26 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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, 07: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 07:29 AM.
 
  


Reply



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 08:42 AM
How to list the directories of a file system by their sizes? joaotelles Solaris / OpenSolaris 3 12-04-2008 02:11 PM
define different physical sizes on Multiple Monitors of different sizes MasterC Linux - Desktop 2 03-18-2008 04:24 PM
Searching multiple directories and sub directories for a file jeep99899 Linux - Newbie 2 10-13-2005 12:23 PM
Directories sizes franz1927 Fedora 1 03-07-2005 01:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:39 AM.

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
Open Source Consulting | Domain Registration