Re: ¿Do ext2 partitions need defragmentation?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 16 Dec 2003, Elton Woo wrote:
> On Tue, 2003-12-16 at 14:02, Fernando Alvarez wrote:
> > Hi!
> > Sorry if my question seems trivial for some of you, but I don't have
> > much experience with Linux or Unix.
> > As anybody knows, regular defragmentation is recommended on Windows
> > partitions (FAT and NTFS).
> 
> Normally you don't have to manually defrag a linux system.

Fernando,

Let me add to Elton's good comments.

> Disk checking is normally done at bootup.

Checking is done both by newer windows and Unix systems.

The need to defragment a file-system depends on the file-system
data structures and the way that the OS puts data in them.

Modern UNIX/Linux file-systems (like ext2) have data structures
and software designs such that fragmentation is minimized and
almost non existent.

Older MS file-systems needed lots of help!

Thus, the first level answer is that regular defragmentation is
simply not needed on Linux today.

The second part is complexity and side effects:

To defragment a file-system in place there is a need for a user
space process to fiddle with raw disk blocks in ways that might
crash the operating system or risk data corruption.  To avoid
corruption data locks would need to be applied to also invalidate
data buffer caches correctly.

Another is that moving data blocks that belong to a file is a
risk to the data.

As long as there is a modest amount of free space in a file-system
the system will make good decisions for the placement of data on
the disk and fragmentation will not be a problem.

The ultimate defragmentation tool is:
   full backup - mkfs - restore 
;-)

Some days I consider moving a largish directory to a scratch
directory on another file-system and then back knowing that the
single move (mv) back command can be optimized by the OS.

Some Unix companies have built defrag tools because customers
expect them.  Often this is marketing filling a check box in an FRP.

And, In the Linux community if there is a real need someone will do it.


-- 
	T o m  M i t c h e l l
	mitch48 -a*t- yahoo-dot-com




[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux