Sean McCauliff | 26 Apr 2011 00:07
Picon
Favicon

Allocation of Indirect Blocks

Does ext3 allocate indirect blocks as needed or is there some fixed 
number of these like inodes?  Should I be concerned with running out of 
indirect blocks?

Thanks,
Sean
Eric Sandeen | 26 Apr 2011 00:13
Picon
Favicon
Gravatar

Re: Allocation of Indirect Blocks

On 4/25/11 5:07 PM, Sean McCauliff wrote:
> Does ext3 allocate indirect blocks as needed or is there some fixed number of these like inodes?  Should I be
concerned with running out of indirect blocks?

ext3 allocates them as needed.

In fact you will often see them allocated consecutively with the data blocks they refer to:

debugfs:  stat bigfile
Inode: 12   Type: regular    Mode:  0644   Flags: 0x0
Generation: 330185944    Version: 0x00000000
User:     0   Group:     0   Size: 8388608
File ACL: 0    Directory ACL: 0
Links: 1   Blockcount: 16450
Fragment:  Address: 0    Number: 0    Size: 0
ctime: 0x4db5f1c8 -- Mon Apr 25 17:12:24 2011
atime: 0x4db5f1c8 -- Mon Apr 25 17:12:24 2011
mtime: 0x4db5f1c8 -- Mon Apr 25 17:12:24 2011
BLOCKS:
(0-11):2561-2572, (IND):2573, (12-267):2574-2829, (DIND):2830, (IND):2831, (268-
523):2832-3087, (IND):3088, (524-779):3089-3344, (IND):3345, (780-1035):3346-360
1, (IND):3602, (1036-1291):3603-3858, (IND):3859, (1292-1547):3860-4115, (IND):4
116, (1548-1803):4117-4372, (IND):4373, (1804-2059):4374-4629, (IND):4630,  ...

... and so on (IND/DIND are indirect & double indirect blocks).

-Eric

> Thanks,
> Sean
(Continue reading)

Sean McCauliff | 26 Apr 2011 00:15
Picon
Favicon

Re: Allocation of Indirect Blocks

Cool.

Thanks,
Sean

Eric Sandeen wrote:
> On 4/25/11 5:07 PM, Sean McCauliff wrote:
>   
>> Does ext3 allocate indirect blocks as needed or is there some fixed number of these like inodes?  Should I
be concerned with running out of indirect blocks?
>>     
>
> ext3 allocates them as needed.
>
> In fact you will often see them allocated consecutively with the data blocks they refer to:
>
> debugfs:  stat bigfile
> Inode: 12   Type: regular    Mode:  0644   Flags: 0x0
> Generation: 330185944    Version: 0x00000000
> User:     0   Group:     0   Size: 8388608
> File ACL: 0    Directory ACL: 0
> Links: 1   Blockcount: 16450
> Fragment:  Address: 0    Number: 0    Size: 0
> ctime: 0x4db5f1c8 -- Mon Apr 25 17:12:24 2011
> atime: 0x4db5f1c8 -- Mon Apr 25 17:12:24 2011
> mtime: 0x4db5f1c8 -- Mon Apr 25 17:12:24 2011
> BLOCKS:
> (0-11):2561-2572, (IND):2573, (12-267):2574-2829, (DIND):2830, (IND):2831, (268-
> 523):2832-3087, (IND):3088, (524-779):3089-3344, (IND):3345, (780-1035):3346-360
> 1, (IND):3602, (1036-1291):3603-3858, (IND):3859, (1292-1547):3860-4115, (IND):4
(Continue reading)

Carlos Maiolino | 13 Jun 2011 17:52
Gravatar

Re: Allocation of Indirect Blocks

Hi Sean,

> Eric Sandeen wrote:
> >On 4/25/11 5:07 PM, Sean McCauliff wrote:
> >>Does ext3 allocate indirect blocks as needed or is there some fixed number of these like inodes?  Should I
be concerned with running out of indirect blocks?
> >ext3 allocates them as needed.
> >
> >In fact you will often see them allocated consecutively with the data blocks they refer to:
> >

Not sure if it's an useful comment, but even that ext2/3 uses indirect blocks as needed and you need not care
about it while writing to the FS, you'll still need to be careful about the maximum file size, which can be up
to 2TiB using default 4k blocks iirc.

Cheers

--

-- 
-Carlos

Gmane