Re: defrag on linux system

From: Michel Bardiaux (michel.bardiaux_at_mediaxim.be)
Date: 09/13/05


Date: Tue, 13 Sep 2005 13:26:16 +0200

Kasper Dupont wrote:
> Michel Bardiaux wrote:
>
>>I have similar problems with disks holding realtime compressed video.
>>Old files are perpetually destroyed to make room for new ones while
>>keeping the disk 99% full, and that seems to be one of those rare cases
>>where fragmentation *does* grow with time.
>
>
> True, this is the main reason why ext2 and ext3 by default
> reserve 5% of the disk space.

Believe me, 5% of a 4Tbytes RAID causes some raised eyebrows when
discussing volumes... and budgets!

> There are only few ways to
> prevent fragmentation in such cases. Prevent the disk from
> getting full, larger allocation units, or moving data around
> once it is necesarry to avoid fragmentation.
>
>
>>Unfortunately the idea that
>>fragmentation could matter even in special cases is heresy to many, and
>>its almost impossible to have a serene discussion about it. Nevertheless
>>one useful suggestion was made: preallocate the files, never destroy
>>them but recycle by renaming.
>
>
> I'd say that approach to avoid fragmentation is going a litle
> too far.

Why?

> Larger allocation units would probably help. If the
> file system is only used for videos, we will be talking about
> large files,

Actually, the typical sizes are 4.5MB, 9MB and 67MB.

> and larger allocation units is not going to
> cause any significant harm on disk usage. Unfortunately not
> all file systems will let you set allocation units very large.
>
How do you change allocation unit size on an ext3? Preferrably without
dumping/restoring the disk; online would even be better.

-- 
Michel Bardiaux
R&D Director
T +32 [0] 2 790 29 41
F +32 [0] 2 790 29 02
E mailto:mbardiaux@mediaxim.be
Mediaxim NV/SA
Vorstlaan 191 Boulevard du Souverain
Brussel 1160 Bruxelles
http://www.mediaxim.com/


Relevant Pages

  • Re: defrag on linux system
    ... > I have similar problems with disks holding realtime compressed video. ... reserve 5% of the disk space. ... I'd say that approach to avoid fragmentation is going a litle ... Larger allocation units would probably help. ...
    (comp.os.linux.development.system)
  • Re: Transpose a large file(>2GB)
    ... Since Linux allows sparse files it doesn't write anything in the blocks between these two blocks. ... Filesystems might protect themselves against these access patterns to avoid fragmentation (ext2/3 already prevent several processes accessing the disk at the same time writing to the same cylinder groups to avoid fragmentation), in fact if I understand the source code of ext2 correctly this is one of the things indirect block allocation prevent partially. ...
    (comp.lang.ruby)
  • Re: Linux and defragging - not quite the "old faithful"
    ... > of reduced performance (disk reads and writes). ... > i've already given potential options in my reply ... Michel Bardiaux ...
    (comp.os.linux.misc)