DISKCHECKD(8)

NAME
diskcheckd - daemon to check for disk read errors

SYNOPSIS
diskcheckd [-d] [-f conf_file] [-o save_file]

DESCRIPTION
diskcheckd is a daemon which runs in the background, reading entire disks to find any read errors on those disks. The disks which should be scanned, and the rates at which they should be scanned, must be specified in the configuration file, which is /usr/local/etc/diskcheckd.conf by default.

Any blank lines or lines starting with a ‘#’ character in this file are ignored. Each non-comment line of this file must be in one of two formats. The first format is ‘!xx’, and specifies that device names matching /dev/xx* should not be included in expansion of wildcards (see below). The second format consists of four white space separated fields, which are the full pathname of the disk device, the size of that disk, the frequency in days at which to check that disk, and the rate in kilobytes per second at which to check this disk. Naturally, it would be contradictory to specify both the frequency and the rate, so only one of these should be specified. Additionally, the size of the disk should not be specified if the rate is specified, as this information is unnecessary.

If the disk is specified as “*”, then diskcheckd will apply the given settings to all disks in the system, obtained using the kern.disks sysctl variable. If the size is specified as “*” (recommended), then the size of the disk will be automatically determined from the disklabel, if possible. Fields which are not specified should contain a single “*” character.

Note that diskcheckd always reads data from the disk in 64KB blocks, so the rate your specify may not be the exact rate at which the disk is actually checked. Similarly, if you specify the third field (days for complete scan) it is unlikely that a complete scan will actually take exactly this many days.

To run diskcheckd automatically at boot time, the diskcheckd_enable variable in rc.conf(5) should be set to “YES”.

When diskcheckd receives a SIGTERM or SIGINT signal, it saves its current state information to a file, so that after a reboot diskcheckd can resume reading from where it left off, rather than starting from the beginning of the disk again. The information saved to this file consists of the device filename and the current offset into that device.

diskcheckd can be instructed to reload the configuration file by sending it a SIGHUP signal.

diskcheckd accepts the following command line options:

-d  If this flag is specified, diskcheckd will not fork into the background and detach from its controlling terminal to become a daemon. This flag is primarily used for debugging.

-f  Specify the configuration file to use, instead of the default /usr/local/etc/diskcheckd.conf.

-o  Specify the file to save disk offsets to, instead of the default /var/db/diskcheckd.offsets.

FILES
/usr/local/etc/diskcheckd.conf
    Default configuration file.
/var/db/diskcheckd.offsets
    Default location of saved offsets.

EXAMPLES
To check all of /dev/ad0 for errors once every two weeks, use this entry in diskcheckd.conf:

    /dev/ad0	*	14	*

To check the first SCSI disk for errors at approximately 64KB/s, use the following entry:

    /dev/da0	*	*	64

To check all disks once every four weeks:

    *	*	28	*

DIAGNOSTICS
If any errors occur, they will be written to syslogd(8).

HISTORY
diskcheckd first appeared in FreeBSD 5.0.

AUTHORS
-nosplit diskcheckd and this manual page were written by Ben Smithurst <ben@FreeBSD.org>, with input from Poul-Henning Kamp <phk@FreeBSD.org>.

BUGS
diskcheckd assumes all disks have 512 byte sectors.