Archived from groups: microsoft.public.windowsxp.perform_maintain (
More info?)
All defraggers use Microsoft defrag APIs to defrag the disk. The program just tells windows what files it wants where.
To allow defragmentation without requiring detailed knowledge of the disk structure of the file system, a set of three control codes is provided. These enable applications to locate empty clusters, determine the disk location of file clusters, and move clusters on the disk. They transparently handle the problem of inhibiting and allowing other processes to read from and write to files during moves.
These operations can be performed without inhibiting other processes from running. However, the other processes will have slower response times while a disk drive is being defragmented.
To defragment a file, use the following steps:
1.. Use the FSCTL_GET_VOLUME_BITMAP control code to find a place on the volume large enough to accept the entire file. If necessary, move other files to make a place that's large enough. Ideally, there will be enough unallocated clusters after the first extent of the file that you can simply move subsequent extents into the space after the first extent.
2.. Use the FSCTL_GET_RETRIEVAL_POINTERS control code to get a map of the current layout of the file on the disk.
3.. Walk the RETRIEVAL_POINTERS_BUFFER structure returned by FSCTL_GET_RETRIEVAL_POINTERS. Use the FSCTL_MOVE_FILE control code to move each cluster as you walk the structure. You may need to renew either the bitmap or the retrieval structure, or both, from time to time as other processes write to the disk.
Two of the operations used in the defragmentation process require a handle to a volume. Only administrators can obtain a handle to a volume, so only administrators can defragment a volume. Your program should check the privileges of the user attempting to run defragmentation software, and it should not execute if the user does not have the appropriate credentials.
--
----------------------------------------------------------
http://www.uscricket.com
"Jolly" <Jolly@discussions.microsoft.com> wrote in message news:8BCFDAAD-A9CE-4AB5-AC4B-D27D65E9079B@microsoft.com...
> Just don'te ever use the built in windows defragmenter and get a much better
> one such as Diskeeper.
>
> "Col. Firefly" wrote:
>
>> Did the cleanup, started defrag and left overnight. Awoke to the WinXP light
>> blue screen that normally accompanies a chkdsk, but no activity or actual
>> displayed writing.
>>
>> Hit reset, computer appears to boot, but hangs after the WinXP logo
>> disappears. Directory services restore doesn't appear to find disks C: and
>> E:, even though I only defragged E:.
>>
>> Tried repair install, hangs on examining the RAID Array. Tried recovery
>> console, hangs on examining the RAID Array.
>>
>> RAID 0 array, with 3 partitions, split into C: (Windows), D: (Pagefile), and
>> E: (Programs). Running on the VIA 8237 Integrated SATA Controller.
>>
>> Any suggestions would be welcome.