The Graham Utilities for OS/2 - Version 2


[Warpspeed]

[Table of Contents] [Index] [Previous] [Next]


HPFSDfrg - Defragment HPFS files

Summary

HPFSDfrg defragments specified files on HPFS volumes.

Icon

Command Line Format

Usage: HPFSDfrg {Switches} <File Spec> Drive Spec(s)

Switches

-f
Force file names to lower case.
-h
Hard disks only.
-on
Optimise files with greater than n extents.
-s
Subdirectories.
-on
Run on Machine Name.

Description

HPFSDfrg is a command line utility which reports the number of extents (or fragments) which each file matching the given file specification is in, and then defragments them if they are in more than a specified number of fragments.

HPFSDfrg is capable of defragmenting one file, one directory, one drive or all drives in one invocation.

If you tell HPFSDfrg to defragment a non HPFS drive you will get the following message:

Drive is not HPFS.
As HPFSDfrg runs it searches all specified files and determines the number of fragments which each file is in. If it is in a greater number of extents than specified (a default of two), defragmentation of that file is attempted. For a file to be successfully defragmented there must be enough free space on the drive for a copy of the file. If there is insufficient space on the drive to defragment a particular file you will see the message:
No space on drive to defragment filename.
HPFSDfrg must also be able to obtain exclusive access to the file. If any other processes are accessing a file, HPFSDfrg will not defragment the file.

HPFSDfrg will attempt to defragment a file up to ten times. Sometimes when a file is copied the file actually fragments into more extents than the original file contained. If the file is particularly large or the free space is heavily fragmented (lots of little free spaces as opposed to fewer large ones), the retry count of ten may be exceeded and you will see the message:

Free space is too fragmented to allow defragmentation.

HPFSDfrg will then continue with the next file.

-d Display defragged files only

This switch causes HPFSDfrg to only display the names of the files that it attempts to defragment. The default operation of HPFSDfrg is to display all filenames and the number of extents that they are in.

-f Force file names to lower case

On FAT partitions, file names are always displayed in lower case. HPFS partitions retain their case, but the file system does not differentiate between the case of file names, and they are displayed in the form in which they were entered. The -f option forces all displayed file names to be displayed in lower case.

-h Hard disks only

HPFSDfrg will scan all logical disk drives defined by the system, starting at drive C:. The drives are scanned in order, starting at C:, then D: and so on.

-o Specify optimisation threshold

By default, HPFSDfrg attempts to defragment files with more than two extents. You may use this switch to change the default. However, if you set the optimisation threshold to too small a number, you may fragment the free spaces. You can use HPFSView and HPFSInfo to check the number of free spaces.

-r Retry count

The default operation of HPFSDfrg is to attempt to defragment a file up to ten times. If the fragmentation of the file can not be improved upon in ten attempts, HPFSDfrg will issue the free space is too fragmented message. This switch allows you to override the default of ten attempts.

-s Subdirectories

HPFSDfrg will include subdirectories as part of its search of the specified disk drives. If a subdirectory name is included as part of the file specification, then the search will include that subdirectory and all subdirectories below it. If no subdirectory is given as part of the file specification, then the current directory and all below it are included in the search.

-on Run on Machine Name

This switch forces DEPIPE to be loaded and allows HPFSDfrg to access disk drives located on remote machines. The Machine Name must be specified with a leading "\\". The machine name of the remote machine will have been specified when the network software on the remote machine was installed.

Note : DESVR must be running on the remote machine for this option to work.

Consult Appendix H - DESVR for further details.

Examples

HPFSDfrg
HPFSDfrg will attempt to defragment all files in the current directory.
HPFSDfrg /s
HPFSDfrg will attempt to defragment all files in the current directory and all directories below it.
HPFSDfrg -h
HPFSDfrg will attempt to defragment all files with more than two extents on all hard disks.
HPFSDfrg -o3
This changes the optimisation threshold to files with more than three extents and attempts to optimise all files in the current directory.
HPFSDFRG -on \\DATA C:\ /s
HPFSDfrg will attempt to defragment all files with more than two extents on drive C: on the remote machine named DATA.