[Sussex] Why Linux doesn't need defrag

Andy Smith andy at lug.org.uk
Thu Aug 17 23:13:57 UTC 2006


On Thu, Aug 17, 2006 at 02:23:02PM +0100, Desmond Armstrong wrote:
> 1/ The Linux uses swap file so that things are written cleanly at the 
> end of session.

Swap (nor any other aspect of virtual memory) has no relevance to
keeping files contiguous.  Even a machine with no swap will do
equally well at keeping its filesystems contiguous.

The simple answer is that modern filesystems make an effort to keep
the blocks that from a given file as contiguous as possible.

This is one of the reasons why it is suggested that 5% to 10% of
each filesystem is reserved for superuser - when a filesystem
becomes more than about 90% full, almost all files have to be very
fragmented as the extents of contiguous free space are obviously
very limited.  This results in permanent performance loss which
can't be avoided without destroying the filesystem and restoring
from backup.

Cheers,
Andy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.lug.org.uk/pipermail/sussex/attachments/20060817/ee2a8d66/attachment.pgp 


More information about the Sussex mailing list