defrag

Lowell Gilbert freebsd-questions-local at be-well.ilk.org
Thu Mar 1 22:34:04 UTC 2007


Ivan Voras <ivoras at fer.hr> writes:

> Bill Moran wrote:
>> In response to Ivan Voras <ivoras at fer.hr>:
>
>>> 352462 files, 2525857 used, 875044 free (115156 frags, 94986 blocks,
>>> 3.4% fragmentation)
>
>> 
>> Just to reiterate:
>> "Fragmentation" on a Windows filesystem is _not_ the same as "fragmentation"
>> on a unix file system.  They are not comparable numbers, and do not mean
>> the same thing.  The only way to avoid fragmentation on a unix file system
>> is to make every file you create equal to a multiple of the block size.
>
> Ok, my point was that 3.4% is a low number for a long used system, but,
> for education sake, what is the difference between Windows'
> "fragmentation" and Unix's "fragmentation"?
>
> I believe that a "fragmented file" in common usage refers to a file
> which is not stored continuously on the drive - i.e. it occupies more
> than one continuous region. How is UFS fragmentation different than
> fragmentation on other kinds of file systems?
>
> UFS has cylinder groups, blocks and block fragments. Obviously, a file
> larger than a cylinder group will get fragmented to spill over to
> another cylinder group. Block fragments only occur at the end of files.

If you know the standard computer science terminology, it can be
described quite tersely.  UFS fragmentation is a way of avoiding
internal fragmentation from wasting too much space.  MS-DOS-FS
fragmentation is an example of external fragmentation in the storage
space.  They don't really have anything to do with each other.

-- 
Lowell Gilbert, embedded/networking software engineer, Boston area
		http://be-well.ilk.org/~lowell/


More information about the freebsd-questions mailing list