The Graham Utilities for OS/2 - Version 2


[Warpspeed]

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


DT - Disk Test

Summary

DT tests the files on a disk for readability. It reads all of the specified files and will report any errors it encounters.

Icon

Command Line Format

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

Switches

-a
All disks.
-b
Both file and logical disk modes.
-c
Cylinder mode.
-d
Logical Disk mode.
-h
Hard disks only.
-l
Keep a Log file.
-p<n>
Physical disk mode.
-r
ReRun count.
-s
Include subdirectories in the search.

Note : If no drive specifications are entered, only the current drive is tested.

Description

DT tests the files on a disk. It reads all of the specified files and will report any errors it encounters. There are two types of errors which can occur. These are: hard errors, due to hardware failures; and soft errors which are errors that are not due to hardware failures.

Over time, both the media and drive mechanisms can wear. A media error occurs when data written to disk is written to an area which has become unreliable to read or write. The data which you read may not be the same as that which you wrote. A media error is a hard error, as it is due to a hardware failure. CRC (Cyclic Redundancy Check) and data read errors are examples of hard errors which you may come across.

A soft error is an error which occurs where there is no physical problem with the disk media or drive mechanism. A soft error could be due to data corruption. The data can be read and written correctly with no errors, but the data is not what it should be. For example, in the FAT file system, an entry in the FAT table may be corrupted. It may point to a cluster which does not exist (sector not found error) or it may point to a cluster which is already owned by another file (cross linked clusters). Clearly any given cluster can only belong to a single file. Thus if two (or more) files think that they own the same cluster there is an error.

Some file systems such as HPFS support dynamic hot fixes. If a correctable disk error is detected during a write operation, the data effected by the error is transferred to another location on the disk, and the flawed area marked as such and no longer used. It has been noted that all disk errors are not caught in this fashion. So it may be possible to detect errors which have arisen over time. The FAT file system has no such facility for this type of error detection. Using DT, it is possible to detect if any files are located on a flawed area of a disk.

DT also displays an effective transfer rate of the data which is read from the disk. This is only an approximate value, as it is the transfer rate for the process in which DT is running. Remember - there may be other processes which are accessing the disk at the same time, so your transfer rate could vary considerably.

Note : DT attempts to open all of the files which it reads in OPEN_ACCESS_READONLY and OPEN_SHARE_DENYNONE mode. This means that it opens files in read-only mode, and that it does not restrict access to any other processes which may be trying to access the files. Under OS/2, processes can specify the access and share modes of files that they open. Some processes will open their files with a share mode of OPEN_SHARE_DENYALL, which means that no other process can open that file. When DT comes across a file which is in use by another process and can not open it, you will see the following error message:

SYS0032: The process cannot access the file because
it is being used by another process.
and the name of the file which could not be opened will be displayed.

In file test mode, areas of the disk which do not contain files will not be read. Use the -d or -p options to read all areas of the disk.

-a All disks

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

-b Both File and Logical disk mode

The default mode of DT is to only test read files. This switch forces DT to test read all files and all sectors on the logical disk.

-c Cylinder mode

When DT is reading either Logical or Physical disks, it reads one sector at a time. This thoroughly tests the system, however it is very slow. The -c switch, when used in conjunction with either the -d or -p switches, forces DT to read an entire track at a time. Reading an entire track at a time is considerably faster than reading each sector individually.

-d Logical disk mode

This switch causes DT to read all sectors on the specified logical disks. It displays some details about the disk. It also displays number of cylinders (tracks), heads, sectors per track, total sectors and total bytes to be read. The current cylinder, head and sector are displayed as they are being read. DT will report any errors it encounters.

-h Hard disks only

DT 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.

-l Keep a Log file

Using this switch causes DT to create a log file named DT.LOG in the current directory. This log file lists what DT does, including any errors it encounters.

-p Physical disk mode

This switch causes DT to read all sectors on the specified physical disk. It displays some details about the disk. It also displays number of cylinders (tracks), heads, sectors per track, total sectors and total bytes to be read. The current cylinder, head and sector are displayed as they are being read. It will report any errors it encounters. Only one physical disk can be read at a time.

-r ReRun count

The -r switch specifies the number of time that an operation is to be performed on a specified area of the disk. For disk mode tests, the sector or complete cylinder will be test read n times. For file mode tests, the file will be test read n times.

-s Subdirectories

DT 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.

Examples

DT -h
DT will attempt to read all files on all hard disks.
DT C:\*.EXE
DT will read all .EXE files in the root directory of drive C:.
DT C:\*.EXE /s
DT will read all .EXE files in the root directory of drive C: and all of its subdirectories.
DT C:\OS2\DLL\WARPCOMM.DLL
DT will read C:\OS2\DLL\WARPCOMM.DLL only.
DT -b E:
DT will read all of the files on Drive E: and then read all of the sectors on drive E:
DT -p1
DT will only read the sectors on physical disk 1.
DT E: -cd
DT will perform a logical disk test of E:; reading a complete cylinder at a time.