Contig (defragmentation utility)
Encyclopedia
Contig is a command line
Command-line interface
A command-line interface is a mechanism for interacting with a computer operating system or software by typing commands to perform specific tasks...

 defragmentation
Defragmentation
In the maintenance of file systems, defragmentation is a process that reduces the amount of fragmentation. It does this by physically organizing the contents of the mass storage device used to store files into the smallest number of contiguous regions . It also attempts to create larger regions of...

 utility for Windows currently owned by Microsoft subsidiary SysInternals.

Operation

Contig is designed to defragment individual files, or specified groups of files, and does not attempt to move files to the beginning of the partition. Unlike the Windows built-in defragmenter tool, Contig can defragment individual files, individual directories, and subsets of the file system using wildcards.

Contig does not move any data except that belonging to the file in the question, so the amount it can defragment a file is limited to the largest contiguous block of free space on a system. Use of contig exchanges decreased file fragmentation for increased free space fragmentation.

Combined usage of the -s parameter and the wildcard symbol * allows whole directories and drives to be defragmented: for example,
contig -s C:\*
will defrag all the files on hard drive C. The -s parameters means to browse directories recursively.

Directories, for example, can be defragmented with the following command. This will help speed up accessing files in a directory with many hundreds or thousands of files.
for /R /D %a in (*.*) do contig "%a"


Adding the -v parameter to the command runs contig in verbose mode.
For instance:
contig -v -s C:\*


When the filesystem is NTFS, contig can also analyse and defragment the following files:
$mft, $LogFile, $Volume, $Attrdef, $Bitmap, $Boot, $BadClus, $Secure, $UpCase, $Extend

This feature is undocumented on Microsoft TechNet's site, but contig displays displays this information when run this way:
contig -v -s C:\

without the * character after the drive name.
(At least this works when runnig contig from an external drive.)

For instance:
contig -v -s $mft


A small change to the Windows registry allows entire folders to be defragmented from Windows Explorer. New unfragmented files with specified name and length can be created.

Derivative programs that use Contig include Power Defragmenter GUI and Multiple Applicator 6.8. A related freeware product by the same author is PageDefrag
PageDefrag
PageDefrag is a program, developed by Sysinternals , for Microsoft Windows that runs at start-up to defragment the virtual memory page file, the registry files and the Event Viewer's logs .Defragmenting these files may improve performance...

.

Limitations

  • Contig can't defragment files accessed through directory mount points (as opposed to drive letter mounts). Using an additional (temporary) drive letter will circumvent this problem. See subst
    Subst
    subst is a command on the DOS, IBM OS/2 and Microsoft Windows operating systems used for substituting paths on physical and logical drives as virtual drives...

     command.
  • Contig doesn't work in Telnet
    TELNET
    Telnet is a network protocol used on the Internet or local area networks to provide a bidirectional interactive text-oriented communications facility using a virtual terminal connection...

     sessions, but it is possible to execute it on remote machines using Sysinternals PsExec.

See also

  • Comparison of defragmentation software
    Comparison of defragmentation software
    -Comparison:...

  • Defragmentation
    Defragmentation
    In the maintenance of file systems, defragmentation is a process that reduces the amount of fragmentation. It does this by physically organizing the contents of the mass storage device used to store files into the smallest number of contiguous regions . It also attempts to create larger regions of...

  • File system fragmentation
    File system fragmentation
    In computing, file system fragmentation, sometimes called file system aging, is the inability of a file system to lay out related data sequentially , an inherent phenomenon in storage-backed file systems that allow in-place modification of their contents. It is a special case of data fragmentation...

  • List of defragmentation software

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK