2007-05-21 13:50:07

by Eric Anopolsky

[permalink] [raw]
Subject: files mapped funny? (related to online defragmentation)

Hi,

I'm getting strange results when I map out the blocks used in files
larger than a several thousand KB. I never seem to get any more than
1024 contiguous data blocks in a row.

Here's a portion of the output of my script when I run it on a 176MB
file in my home directory:
...
Contiguous chunk 67: 2385568 - 2385591 (24 blocks)
Contiguous chunk 68: 2385608 - 2386448 (841 blocks)
Contiguous chunk 69: 2386450 - 2387473 (1024 blocks)
Contiguous chunk 70: 2387475 - 2388498 (1024 blocks)
Contiguous chunk 71: 2388500 - 2389523 (1024 blocks)
...

Maybe this is a bug in my script? Can anyone explain why this would
happen?

I'm attaching my script in case other ext2/3/4 newbies can get any use
out of it, and in case anyone needs to see it in order to answer my
question. It's pretty self-explanatory, though.

Cheers,

Eric


Attachments:
fibmap.py (1.57 kB)
signature.asc (189.00 B)
This is a digitally signed message part
Download all attachments

2007-05-21 18:01:06

by Mingming Cao

[permalink] [raw]
Subject: Re: files mapped funny? (related to online defragmentation)

On Mon, 2007-05-21 at 06:49 -0700, Eric wrote:
> Hi,
>
> I'm getting strange results when I map out the blocks used in files
> larger than a several thousand KB. I never seem to get any more than
> 1024 contiguous data blocks in a row.
>
> Here's a portion of the output of my script when I run it on a 176MB
> file in my home directory:
> ...
> Contiguous chunk 67: 2385568 - 2385591 (24 blocks)
> Contiguous chunk 68: 2385608 - 2386448 (841 blocks)
> Contiguous chunk 69: 2386450 - 2387473 (1024 blocks)
> Contiguous chunk 70: 2387475 - 2388498 (1024 blocks)
> Contiguous chunk 71: 2388500 - 2389523 (1024 blocks)
> ...
>
> Maybe this is a bug in my script? Can anyone explain why this would
> happen?
>
filefrag command comes with e2fsprogs will print the file fragmentation
info. I guess you can try filefrag -v command and see if that matches
what your scripts reported.

Mingming

> I'm attaching my script in case other ext2/3/4 newbies can get any use
> out of it, and in case anyone needs to see it in order to answer my
> question. It's pretty self-explanatory, though.
>
> Cheers,
>
> Eric
>

2007-05-22 02:08:40

by Eric Anopolsky

[permalink] [raw]
Subject: SOLVED: Re: files mapped funny? (related to online defragmentation)

> > I'm getting strange results when I map out the blocks used in files
> > larger than a several thousand KB. I never seem to get any more than
> > 1024 contiguous data blocks in a row.
> >
> filefrag command comes with e2fsprogs will print the file fragmentation
> info. I guess you can try filefrag -v command and see if that matches
> what your scripts reported.

Thanks for the pointer. It seems my program only counts data blocks, so
it sees the indirect block for each 1024 data blocks as a space between
extents. I will have to read the filefrag source and account for that.

Cheers,

Eric


Attachments:
signature.asc (189.00 B)
This is a digitally signed message part