I see,<br>So for only the first 12 blocks, there is no need for extra blocks, but I couldn't find any mathematical logic for the rest.<br>I explain :<br>I've tried to create many files to which I assigned a fixed number of blocks, and the results are :<br>

for a 13 block file till a 1036 block file I had 3 extra blocks added<br>and then it's 4 extra blocks added (for example a 3060 block file)<br>and for a 4000 block file, it's 5 extra blocks<br>for 5000 it's 6<br>
and for 10 000 it's 11 blocks added!<br><br>so is there any logic?<br>or it depends on the machine (regardless if it is ext3, or another fs)?<br><br><br>Best regards<br><br>youness<br><br><br><br><div class="gmail_quote">
On Tue, Aug 18, 2009 at 8:05 PM, Eric Sandeen <span dir="ltr"><<a href="mailto:sandeen@redhat.com" target="_blank">sandeen@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div>Youness HAFFANE wrote:<br>
> Hi Eric,<br>
><br>
> I have understood from the document, that for each file, we have 3 extra<br>
> blocks (indirect) that refer to  :<br>
><br>
> - the group descriptor<br>
> - the block bitmap<br>
> - the inode bitmap<br>
><br>
> Is that right?<br>
<br>
</div>nope :)<br>
<div><br>
> If not, to what the indirect blocks refer to? and are there always only<br>
> 3 blocks for each file in ext2/3fs?<br>
<br>
</div>No.  basically the extra blocks are for keeping track of where the data<br>
blocks are, or for keeping track of where more indirect blocks are,<br>
which in turn keep track of where the data blocks are.<br>
<br>
Maybe <a href="http://www.nongnu.org/ext2-doc/ext2.html#DEF-INODES" target="_blank">http://www.nongnu.org/ext2-doc/ext2.html#DEF-INODES</a> has a better<br>
explanation:<br>
<br>
"There are pointers to the first 12 blocks which contain the file's data<br>
in the inode. There is a pointer to an indirect block (which contains<br>
pointers to the next set of blocks), a pointer to a doubly-indirect<br>
block (which contains pointers to indirect blocks) and a pointer to a<br>
trebly-indirect block (which contains pointers to doubly-indirect blocks). "<br>
<br>
It's all these indirect blocks that you're seeing.<br>
<font color="#888888"><br>
-Eric<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Y.<br>