DIAG(8S) — MAINTENANCE COMMANDS
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.
abortdmaAborts/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.
clearSends a restore command to a disk. This is needed to manually reset disk faults.
diagRe-initializes the diag program itself — goes back to phase one of the initialization process described above.
dmatestBegins 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.
errorsReports/does not report all errors as they occur (toggles; default is reporting off).
fixFormats 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.
formatFor SMD disks, formats the entire disk; for SCSI disks, initiates the SCSI format program.
sformatInitiates 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.
infoReports/suppresses report of all disk activity as it completes (toggles; default is reporting off).
labelLabels the disk.
mapDisplays 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.
mapcheckEnables/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.
partitionCreates, 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.
positionContinuously tests the disk by reading random sectors from the disk. To abort the test, type a ^C (CONTROL-C).
quitQuits from diag and returns to the PROM monitor.
rhdrReads and displays the track headers for a specified track. Note: this command is available for Xylogics controllers only.
readReads 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.
scanContinuously 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).
seekPerforms 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.
slipExplicitly 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.
slipmsgsDisplays/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).
statusReports the ready status of each drive on the current controller.
testContinuously 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).
timeTurns 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).
translateTranslates a given block number into its decimal value, hexadecimal value, and logical disk address.
verifyReads and displays the label from the disk. Shows the logical partition assignments. This is done automatically when the label command has labelled the disk.
versionDisplays the SCCS identification string for this version of diag.
whdrModifies 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.
writeVerifies 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).
Sun Release 3.5 — Last change: 25 July 1986