DISK(8) — UNIX Programmer’s Manual
NAME
disk − disk initialization and diagnosis
SYNOPSIS
/usr/etc/disk [ option flags ] [ action flags ] raw-device
DESCRIPTION
Disk is a disk utility program that can be used to initialize, inspect, repair and configure optical and SCSI disks.
The option flags are used with the −i action flag to specify certain parameters when initializing a disk:
−h hostname
Specifies a hostname to be stored in the disk label. The actual hostname of a machine is not determined by the disk label, but in the case of removable optical media this field may be set for informational purposes to indicate which machine the disk belongs to.
−l labelname
The labelname of a disk is printed in the message log when the system boots. For optical media this is also the name used as the mount point in the home directory when the disk is automounted.
−t disk_type
The disk configuration information in /etc/disktab is named by an identifier called the disk type. By default, when the disk program is run it will attempt to determine the proper disk type to use. Use this flag to override the default. This is used when you want to reinitialize a disk using a different set of configuration parameters from /etc/disktab (e.g. a different number and/or size of filesystem partition(s)).
The action flags are used to perform a specific command in the disk program (only one may be specified):
−i This flag will initialize a disk including writing out a new disk label containing information about the host name, label name and information found in /etc/disktab. A boot program will be installed onto the boot block area of the disk from the file /usr/standalone/boot. If specified in the configuration information in /etc/disktab, the initialize flag will also build empty UNIX filesystems on the disk. WARNING: The initialize flag will destroy all data on the disk. Example: "/etc/disk -h myhost -l mydisk -i /dev/rod0a"
−e This flag will eject the optical disk from a drive. No attempt is made to unmount the filesystems on this disk before ejecting.
−b The boot program in /usr/standalone/boot will be written onto the boot block area of the disk.
−q The default disk type information returned by the device driver for this disk will be printed. This flag is used by the Builddisk application to determine what kind of disk is present.
−s If the device driver keeps any special statistics for the disk they will be printed with this flag.
−H hostname
This flag can be used to change the hostname field of the disk label without disturbing other fields in the label.
−L labelname
This flag can be used to change the labelname field of the disk label without disturbing other fields in the label.
−T This flag will write, read and verify a sequence of test patterns on the disk. WARNING: This flag will overwrite data on the disk.
−B This flag does a bulk erase of an entire optical disk. WARNING: This flag will destroy any data on the disk. Note: This flag is used during optical disk duplication and is not intended for general use.
If no action flags are specified the program operates in an interactive mode. In the interactive mode you may type the interrupt character at any time to abort the current command. Typing ’?’ will list the available commands. Many of the commands will prompt for additional arguments or sub-commands. There are many interactive commands in addition to the ones described by the option flags above:
seek The seek command can be used to construct a screen graph of seek time versus cylinder span. The screen graphics do not use the Window Server and will overwrite the entire screen. For this reason the command is best used when the Window Server is not running. You can use the incr, dwell, disc, and wait commands to measure seek times in different ways. The vertical axis measures seek time in milliseconds on a log scale. The horizontal axis measures cylinder span on a log scale. Maximum, minimum and average values are plotted.
incr Toggles whether the cylinder span amount will be incrementing or random during the seek command (default random).
dwell Sets the number of measurements taken at a particular cylinder span amount during increment mode.
disc Toggles if discrete data point are plotted for the seek command instead of max/min/avg.
pong This command will continuously seek between two cylinders on the disk.
read, write, verify, rw, rwr
These commands will read, write and verify data on the disk. All block numbers used in these commands are absolute disk block numbers and do not correspond to block numbers reported from the filesystem. No bad sector forwarding or additions are performed with these commands. On an optical disk, these commands can be used to write a sector that has become unreadable due to an uncorrectable ECC errors. WARNING: These commands may destroy disk data.
look, set These commands may be used to inspect and modify the data buffers used in the read and write commands described above.
abort This command toggles whether an error will stop the read and write commands described above.
byte If data verify errors occur while writing this command toggles whether every byte of data that differs is printed or not.
all This command tests all sectors on the disk sequentially and can graphically display the ECC correction count obtained during the test.
label This command is used to print and change information in the disk label. If you just want to change the hostname or labelname fields then use the −H hostname or −L labelname action flags described earlier.
bad This command allow you to display and edit the bad block table maintained on optical disks.
bitmap This command allow you to display and edit the sector status bitmap maintained on optical disks.
FILES
/etc/disktabfor disk geometry and partition layout information
/usr/standalone/bootthe default program written onto the boot block area
SEE ALSO
BUGS
Like all low-level diagnostics written early in the life of a new computer, this program exhibits evolutionary development. Some features may be difficult to understand or not work exactly as advertised.
NeXT, Inc. — June 22, 1989