Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Sep 1998 10:07:12 -0400
From:      "Steve Friedrich" <SteveFriedrich@Hot-Shot.com>
To:        "freebsd" <freebsd-questions@FreeBSD.ORG>, "Peter Kok" <peter@sweda.com.hk>
Subject:   Re: fragmentation
Message-ID:  <199809241407.KAA02432@laker.net>

next in thread | raw e-mail | index | archive | help
On Thu, 24 Sep 1998 15:47:41 +0800, Peter Kok wrote:

>what is the meaning of
>frags?
>
>and how do you do defragmentation?

See my recent email regarding books also, but here's a short answer...

You're probably aware that DOS and Winblows use "clusters" of sectors,
due to poor design choices by IBM/Microsoft/Intel in the initial design
of the PC.  Information is stored in disk sectors which are frequently
512 byte blocks.  Because of sector addressing constraints in the PC,
DOS and Winblows have to assign these disk sectors to a file in
"clusters" instead of single sectors.  The result is that if the size
of your partition requires a cluster size of 8KB, then when you right a
1 byte file, DOS/Winblows allocates 8KB to that file, and marks 8KB
worth of sectors in the FAT table (File Allocation Table).  That's an
incredible waste of space, and products are available to shrink the
cluster size (Partition Magic).

But Unix filesystems take the little spill-over data, i.e., if you had
a file that was 513 bytes, 512 bytes would be placed into a block and
the remaining byte is a frag that would be placed in a block with frags
from other files.  Note that most, if not all, UNIX System V
implementations switched to 1024 byte blocks long ago, and BSD variants
typically use 4096 byte blocks.  These blocks get written to the disk
as sectors, which vary in size according to the design of the disk. 
Many hard disks will allow you to format the disk with various size
sectors.

So UNIX systems manage frags, and there is no need to defragment. 
System V may not support frags at all, I don't know or really care. BSD
was really the most popular, at least until they lost funding.  A few
years ago, many concepts from BSD, SCO, XENIX, etc., were rolled into
System V and to my knowledge, SCO currently owns the rights to it.

If any of the above is inaccurate, I welcome gentle, polite
corrections... 8o)
Unix systems measure "uptime" in years, Winblows measures it in minutes.



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199809241407.KAA02432>