[SATLUG] EXT3 inner workings and stuff
Samuel Leon
leon36 at gmail.com
Mon Nov 12 20:20:46 CST 2007
Bruce Dubbs wrote:
> Samuel Leon wrote:
>> Bruce Dubbs wrote:
>>> Samuel Leon wrote:
>>>
>>>> Does the "ind/dind/tind" stand for indirect, double indirect, and triple
>>>> indirect?
>>> Yes.
>>>
>>>> And what exactly does this mean? Also is there any way to
>>>> determine the over all fragmentation level of an ext3 partition? From
>>>> what I have read "non-continuous" is not necessarily fragmentation.
>>> Its explained fairly well at a conceptual level in Wikipedia.
>>>
>>> http://en.wikipedia.org/wiki/Inode
>>>
>>> -- Bruce
>>
>> Yea I have read that. What I am curious about is exactly what an
>> indirect inode is. From that I have read an inode has a set size limit
>> and as a file fragments and the inode has to keep track of all the
>> blocks that a file is located at it can run out of space and then that
>> is when it creates an indirect inode to continue tracking the file. Is
>> this correct? What doesn't make since is that according to the fsck
>> stats that I posted, I have 4417 non-contiguous inodes and over 10,000
>> indirect inodes. So indirect can't just mean fragmented. If it did
>> then wouldn't non-contiguous inodes always be higher than the indirect
>> inodes or at least equal the same amount? What is the definition of
>> "non-contiguous" anyway, non-shared or broken up?
>
> The disk is managed in blocks of fixed size. That size is set when the
> disk is formatted with mkfs. You can see a lot of ext2/3 info with
> tune2fs -l /dev/<partition>.
>
> A typical block size is 1K bytes (2 physical sectors), 2K, or 4K. This
> means that the minimum file size is one block. (ReiserFS does it
> differently). The inode has to point to these blocks for the file
> contents, but there is only room for 12 block pointers in an inode and
> then additional areas have to be allocated to point to the data
> structures (typically 512 bytes) of pointers for larger files.
>
> www.tux4u.nl/freedocs/unix/draw/inode.pdf
>
> Typically, ext2/3 minimizes fragmentation because it looks for
> contiguous blocks when writing files. I don't know what you are doing
> to cause 8.4% non-contiguous inodes, but one of my most used partitions has:
> 217922 inodes used (20%)
> 4991 non-contiguous inodes (2.3%)
> # of inodes with ind/dind/tind blocks: 9511/114/0
> 1611831 blocks used (74%)
> 158972 regular files
> 10623 directories
>
> It looks like you have a lot of fairly large files. On average, you
> have 30466022 blocks used/ 50028 files = 608 blocks/file. My system has
> an average of only 10 blocks per file.
>
> The difference of you having 2609 double indirect blocks (vs my 114) is
> another indication of a lot of large files. A lot of large files will
> cause fragmentation on any file system.
>
> Non-contiguous means "breaks in the sequence of blocks". In other
> words, the read head of the drive will have to move more to access the file.
>
> -- Bruce
>
>
>
>
>
>
>
>
Ah, I see. Thank you. That pdf is pretty good. Very interesting.
Sam
More information about the SATLUG
mailing list