'\"macro stdmacro
.if n .pH g1a.hdeadd @(#)hdeadd	40.6.1.1 of 1/17/90
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} hdeadd 1M "Essential Utilities" "\&"
.if \nX=1 .ds x} hdeadd 1M "Essential Utilities"
.if \nX=2 .ds x} hdeadd 1M "" "\&"
.if \nX=3 .ds x} hdeadd "" "" "\&"
.TH \*(x}
.SH NAME
\f4hdeadd\f1 \- add/delete hdelog (Hard Disk Error Log) reports 
.SH SYNOPSIS
\f4/usr/sbin/hdeadd\f1
\f4\-a\f1
[
.I aoptions
]
.P
\f4/usr/sbin/hdeadd\f1
\f4\-d\f1
[
.I doptions
]
.P
\f4/usr/sbin/hdeadd\f1
\f4\-e\f1
[ [
\f4\-D\f1
] \f2major minor\f1 ]
.P
\f4/usr/sbin/hdeadd\f1
\f4\-f\f1
\f2filename\f1
.P
\f4/usr/sbin/hdeadd\f1
\f4\-r\f1
[
\f4\-D\f1
] \f2major minor filename\f1
.P
\f4/usr/sbin/hdeadd\f1
\f4\-s\f1
[
\f4\-D\f1
] \f2major minor filename\f1
.SH DESCRIPTION
This command is part of the bad block handling utility.
It may be used only by the super-user for manually adding or deleting
disk error reports recorded by 
\f4hdelogger.\f1
These include disk errors reported while in firmware mode
and disk errors that
cause the system to \s-1PANIC\s0.
.PP
\f4hdeadd\fP
may be used to print the list of equipped disks or to determine if a
specific disk device is on the list.
In addition, this command has some options that are 
for use in testing the feature.
.P
The following options may be used with \f4hdeadd\fP:
.TP
\f4\-a\f1
\f4hdeadd\fP
allows a Hard Disk Error (\s-1HDE\s0) report to be added manually
to the \s-1HDE\s0 Log of a disk.
.TP
\f4\-d\f1
\f4hdeadd\fP
allows a specific report or a range of
reports to be deleted from the \s-1HDE\s0 Log of a disk.
.TP
\f4\-e\f1
prints out the list of major/minor device numbers of the
equipped hard disks.
If the
.I major
and
.I minor
device numbers are also provided,
it determines if that specification is an equipped hard disk.
The result is both printed on the standard output
and is used to determine the exit status.
A \s-1NORMAL\s0 (or \s-1TRUE\s0) exit means it is an equipped disk.
.TP
\f4\-f\f1
the file specified by
.I filename
is assumed to contain a canned set of \s-1HDE\s0 Log manipulations.
Each line of text contains one specification in the command argument form,
starting with a
\f4\-a\f1
or a
\f4\-d\f1
option.
.TP
\f4\-s\f1
saves a copy of the \s-1HDE\s0 Log of the specified (by
.I major/minor
device number)
disk in the file specified by
.IR filename .
.TP
\f4\-r\f1
restores the \s-1HDE\s0 Log of the specified disk from the file specified by
.IR filename .
.P
The valid
.I aoptions
are only
hard disk error
specifications.
.P
The valid
.I doptions
are either a
hard disk error
specification or an
error range
specification.
.P
A
hard disk error
specification includes the following values:
.TP .8i
\f4\-D\fP \f2maj\fP \f2min\fP
Specifies the major device number (\f2maj\fP)
and minor device number (\f2min\fP) of the disk.
.TP
\f4\-b\fP \f2blockno\fP
\f1Normal form:
Specifies the physical disk block number in integer counter form
(i.e., treating the disk as a simple stream of blocks).
Physical disk block numbering starts with zero meaning
sector 0 of track 0 of cylinder 0.
This is the normal form that is reported by the operating system.
.TP
\f4\-B \f2cyl\fP \f2trk\fP \f2sec\fP
\f1Alternate form:
Specifies the physical disk block number in terms of its physical
cylinder number (\f2cyl\fP),
track number within cylinder (\f2trk\fP),
and sector number within track (\f2sec\fP).
This alternate form is available
to cover the possibility of a non-operating system
detector reporting block numbers in this hardware form.
.TP
\f4\-t\fP \f2mmddhhmm\fP[\f2yy\fP]
\f1Optional:
Specifies the time of day when the error actually occurred.
If omitted when adding reports,
the current time is used.
If omitted when deleting reports,
any reports for the given block are deleted.
.P
An
error range
specification includes the following values:
.TP .8i
\f4\-D\fP \f2maj\fP \f2min\fP
Specifies the major device number (\f2maj\fP)
and minor device number (\f2min\fP) of the disk.
.TP
\f4\-F\fP \f2mmddhhmm\fP[\f2yy\fP]
\f1Optional:\f1
Specifies the "from" time for the time interval being purged.
If omitted, zero (the beginning of time) is used.
.TP
\f4\-T\fP \f2mmddhhmm\fP[\f2yy\fP]
\f1Optional:\f1
Specifies the "to" time for the time interval being purged.
If omitted, the end of time is used.
The range comparisons include the end values of the range in the purge.
.SH FILES
\f4/dev/hdelog\f1
.SH "SEE ALSO"
\f4hdefix\fP(1M), \f4hdelogger\fP(1M), \f4hdelog\fP(7).
.br
Bad Block Handling in the \f2System Administrator's Guide\f1.
.SH DIAGNOSTICS
The \s-1HDE\s0 commands exit with one of three values:
.TP .5i
0
means \s-1NORMAL\s0, or \s-1TRUE\s0
.TP
1
means bad command usage or execution errors
.TP
2
means \s-1BAD BLOCKS\s0 or \s-1FALSE\s0 (but command executed successfully)
.Ee
