Q:

Does ext3 fragment when run at near-full capacity?

I know that one of the main drawing points for ex3 and other journaling filesystems is that they do not fragment like NTFS and such.
I once heard someone say that ext3 actually would fragment when operated at near-full capacity for a length of time. Is there any truth to this? I've been running my main home ext3 partition at 95%+ capacity for at least a year and would like to know if this is actually causing any fragmentation, and if so does it clean up after itself automatically?

A:

Technically, yes, it can fragment if there is not much free space available, and no, it doesn't clean up after itself. To check the fragmentation level of a partition:
fsck -nvf /dev/sda1 # replace sda1 with the relevant partition

and to see how fragmented a particular file is:
filefrag -v /path/to/file

Here is an article about how to defrag a Linux system, but chances are it is not affecting your system to a noticeable degree, so you don't need to worry about it.
If you're really interested, this article and its follow up were extremely helpful to me in understanding how the file system works.

