LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 06-07-2016, 08:59 AM   #1
dumblinuxuser
LQ Newbie
 
Registered: Nov 2013
Posts: 7

Rep: Reputation: Disabled
Directory Size of etc, lost+found vs regular directory size.


Hi

I am new to linux and have a question just by observation.
I understand that any directory when created has default size of 4096 however the directories such as etc, lost+found, dev have different sizes.

etc is 12288
lost+found is 16384

I have seen the size to be same irrespective of which distribution I use. Can someone help me understand why these directories have a different size.

Help much appreciated.
 
Old 06-07-2016, 09:52 AM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Pretty much will be until /etc gets lots of configuration files added.

The size of etc (12288) is exactly 3 disk blocks (mine is too). Frequently services will put multiple configuration files in one directory (as ssh does) partly for consolidation (all relevant files are together), and partly for security (it makes it easy to check the files access modes easily). A directory entry doesn't need a lot of space, so 3 disk blocks might not change...

lost+found is a bit more special. It has 4 disk blocks "preallocated", and is normally empty. The pre-allocation is so that IF a filesystem check (fsck) detects lost files, there is somewhere to put them, without allocating blocks from a potentially corrupted free list (a "lost file" is identified by fsck as an inode that isn't referenced in any directory). With the current journalling filesystems, lost+found is almost always empty as the journal will normally contain the list of transactions that have been outstanding, and the list will be processed for the initial cleanup. SOMETIMES a system crash/power failure can still leave some thing out though...

By default a directory just created gets only 1 disk block, with only two entries (. and ..), so the rest of the block is unused.
 
  


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
Directory Size mmhs Linux - Newbie 1 07-20-2012 03:47 AM
[SOLVED] Store the size of largest file from a file/directory listing into variable SIZE lainey Linux - Newbie 3 11-15-2011 12:29 PM
directory size includes size of .. leostar_10 Linux - Newbie 4 12-03-2007 04:12 PM
directory size santoshgnag Linux - General 1 06-26-2003 04:00 AM
Directory Size Helixx Linux - General 1 04-27-2001 08:49 PM

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

All times are GMT -5. The time now is 07:58 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