DIAG(8S)

NAME
diag - stand-alone disk initialization and diagnosis

SYNOPSIS
>b stand/diag

DESCRIPTION
Diag is a general purpose stand-alone package for initializing, diagnosing, and repairing disks. It supports the various SMD and SCSI disk controllers.

Note: Diag is not a system utility and can only be called from the Sun Workstation PROM monitor.

The most common use of diag is formatting and labelling a disk — see the format, label, and partition commands.

Immediately after startup, diag prompts for information about the particular disk drive(s) and controller(s) it is to work with. There is a facility for specifying additional information about nonstandard disks.

Diag tries to access the disk controller you have defined. If the attempt succeeds, it gives you a status report on the disk and issues the `diag>' prompt. If the attempt fails (if the controller is ill-defined or nonexistent), you get a bus error message, and return to the PROM monitor.

Once configured, diag accepts the comands listed below. Only enough characters to uniquely identify the command need be typed.

abortdma
    Aborts/does not abort the dmatest command when a data miscompare is detected. That is, if the internal variable set by abortdma is `on' (default), the dmatest command aborts as soon as it finds an error; otherwise, the dmatest continues.

clear
    Sends a restore command to a disk. This is needed to manually reset disk faults.

diag
    Re-initializes the diag program itself — goes back to phase one of the initialization process described above.

dmatest
    Begins a continuous DMA test. The test copies random data to and from the designated controller, comparing data. If a miscompare is found, an error message is displayed and the test aborts (unless the abortdma command is used — see abortdma, above). Note: this command is available only with the Xylogics 450 Controller.

errors
    Reports/does not report all errors as they occur (toggles; default is reporting off).

fix Formats and verifies a range of tracks; any defective tracks/sectors found are automatically corrected using mapping or slipping. Note: this command is available for SMD controllers only.

format
    For SMD disks, formats the entire disk; for SCSI disks, initiates the SCSI format program.

sformat
    Initiates a special formatting program that allows manual manipulation of the defect list. Note: this command is available for SMD controllers only. For SCSI controllers, use the format command.

help or ?
    Displays a list of the available commands.

info
    Reports/suppresses report of all disk activity as it completes (toggles; default is reporting off).

label
    Labels the disk.

map Displays current mappings and allows you to explicitly map one track/sector to a different track/sector. Usually used for manual bad sector mapping. The format and fix commands usually do this automatically when a bad track/sector is found. Note: the map command is disk controller-dependent: you can map tracks with an Interphase controller, and sectors with Xylogics controllers. This command is not available for use with SCSI disk controllers.

mapcheck
    Enables/disables checking for overlapping mapped sectors/tracks during the position, read, test, or write commands. If the internal variable set by mapcheck is `on' when an error occurs (default), then the current mappings (if any) are read from the disk and checked to see if there are overlapping mappings over the area of the disk where the transfer failed.

partition
    Creates, assigns, or modifies logical partition tables for a disk. The UNIX operating system requires logical partitions. The label command writes the partition map to the disk. There are standard partition tables for each type of disk that diag knows about.

position
    Continuously tests the disk by reading random sectors from the disk. To abort the test, type a ^C (CONTROL-C).

quit
    Quits from diag and returns to the PROM monitor.

rhdr
    Reads and displays the track headers for a specified track. Note: this command is available for Xylogics controllers only.

read
    Reads specified blocks from the disk. The read command prompts for the starting block number, number of blocks, and the block increment. The read command doesn't report the data it reads — it is intended for verifying that blocks are readable.

scan
    Continuously scans over a range of sectors looking for defective sectors by writing/reading/verifying various bit patterns to sequential sectors. Any data on the disk in the range to be scanned is destroyed. Sectors previously mapped are not scanned, so any errors reported will be newly found defective sectors. If used with a Xylogics controller, defective sectors can be automatically mapped/slipped when they are found. To abort the scan, type a ^C (CONTROL-C).

seek
    Performs a seek test on the disk: it can either continuously seek between two specified blocks or seek to every cylinder and every possible cylinder distance.

slip
    Explicitly slips one sector on a track. Usually used for manual bad sector slipping. The format and fix commands usually do this automatically when bad sectors are found and the proper conditions exist. Note: slipping is available only with Xylogics controllers, and only when the disk has a spare data sector per track.

slipmsgs
    Displays/suppresses display of track headers before and after each slip operation that occurs during the fix, format, and slip commands (toggles; default is display off).

status
    Reports the ready status of each drive on the current controller.

test
    Continuously tests the disk by writing random data to random sectors on the disk and then verifying that the correct data can be read back. The test command destroys data on the disk. To abort the test, type a ^C (CONTROL-C).

time
    Turns timing on/off. When timing is on, diag reports on how long certain operations take — diag is less verbose in this state so it doesn't waste time displaying messages (toggles; default is timing off).

translate
    Translates a given block number into its decimal value, hexadecimal value, and logical disk address.

verify
    Reads and displays the label from the disk. Shows the logical partition assignments. This is done automatically when the label command has labelled the disk.

version
    Displays the SCCS identification string for this version of diag.

whdr
    Modifies and writes the track headers for a specified track. Note: this command is available with Xylogics controllers only. Also, it should be used only for specialized patching — misuse may destroy track data.

write
    Verifies that blocks are writable by writing garbage data to specified blocks on the disk. The write command prompts for the starting block number, number of blocks, and the block increment.

+   Adds two block numbers and reports the result in decimal, hexadecimal, and as a logical disk address.

-   Subtracts two block numbers and reports the result in decimal, hexadecimal, and as a logical disk address.

Block numbers may be entered either as an absolute decimal block number, or as a disk address of the form cylinder/head/sector.

Any diag command may be aborted by typing a ^C (CONTROL-C).