Defrag technology

Status
Not open for further replies.
Hi all. I am writing an academic paper on IT architecture from an 'outsider’s perspective' (centred on the topic of innovation - "can’t see the wood for the trees"). Can I ask for some help on the process of defragmentation. With the varying file systems (NTFS, Fat, FAT32) it is difficult to understand how a Defrag program can successfully negotiate disks. I understand the concept of fragmented data, how it becomes fragmented, and know how, in general, a defrag is supposed to help. However, can someone explain to me in detail, or give me any advise/help/URL's as to how a defrag program really works:: from the pushing of the defrag button (so to speak)
How does it identify fragmented files?
How does it locate fragmented files?
How does it store this information?
What is the defragmentation process? eg. Scan, document, relocate?
Is there any information already stored about fragmented files on a day to day basis, or is it one clean scan when defrag is run?
Are there separate processes depending on the Filing system/OS system?
Where are indexes and lookup tables located, and how are these referenced?


This paper is referenced on the basis of helpfulness of response and this site will be properly referenced. - Maxmadx@hotmail.com for E-mails to be included in its general release.

Thanks.
 
How does it identify fragmented files?
As you know, the basic allocation unit of a hard disk is a cluster (block). The main purpose of a filesystem is to keep track of what files occupy what blocks. All the defrag program has to do is to look through the filesystem metadata (a simple table in FAT systems, complicated trees and chains of blocks in other systems) and check if the blocks that a file resides in are contiguous (the block numbers run in sequence). It does this for all files on the disk.
How does it locate fragmented files?
As was said before - you just have to look at the filesystem metadata and it will tell you what blocks a file lives in.
How does it store this information?
This is just a matter of programming. I suppose the most trivial way would be a list. One entry in the list is made up of a file name and a list of all the blocks the file is contained in.
What is the defragmentation process? eg. Scan, document, relocate?
Yes, this is pretty much it.
Is there any information already stored about fragmented files on a day to
day basis, or is it one clean scan when defrag is run?
All the needed info is contained in the filesystem itself and it is updated constantly since otherwise you would end up with a broken filesystem. Every time you run the defrag, the filesystem metadata is scanned and all the info is stored in some internal structures of the defrag program.
Are there separate processes depending on the Filing system/OS system?
Things are file system dependent since filesystems keep their metadata differently. And it is most certainly OS specific since working with disk blocks is a very intimate activity that is not allowed for user level programs. Windows XP supplies defragmentation routines that any programmer can use. Other versions of Windows required you to write special drivers.
Where are indexes and lookup tables located, and how are these referenced?
They are stored in the RAM. The exact implementation is really up to the skill and preference of the programmer(s).

All I just said is As I Know It. If your paper is something serious then you might want to double-check things and I hope other people correct me if I got it very wrong :p
 
Status
Not open for further replies.
Back