xref: /netbsd-src/sbin/dkctl/dkctl.8 (revision f648d12d47727113ad5330b0753bb2f2ef8e1045)
1.\"	$NetBSD: dkctl.8,v 1.9 2003/07/13 09:53:10 lukem Exp $
2.\"
3.\" Copyright 2002 Wasabi Systems, Inc.
4.\" All rights reserved.
5.\"
6.\" Written by Jason R. Thorpe for Wasabi Systems, Inc.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright
12.\"    notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\"    notice, this list of conditions and the following disclaimer in the
15.\"    documentation and/or other materials provided with the distribution.
16.\" 3. All advertising materials mentioning features or use of this software
17.\"    must display the following acknowledgement:
18.\"	This product includes software developed for the NetBSD Project by
19.\"	Wasabi Systems, Inc.
20.\" 4. The name of Wasabi Systems, Inc. may not be used to endorse
21.\"    or promote products derived from this software without specific prior
22.\"    written permission.
23.\"
24.\" THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
25.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
26.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
27.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL WASABI SYSTEMS, INC
28.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34.\" POSSIBILITY OF SUCH DAMAGE.
35.\"
36.Dd July 13, 2003
37.Dt DKCTL 8
38.Os
39.Sh NAME
40.Nm dkctl
41.Nd a program to manipulate disks
42.Sh SYNOPSIS
43.Nm
44.Ar device
45.Ar command
46.Oo
47.Ar arg Oo ...
48.Oc
49.Oc
50.Sh DESCRIPTION
51.Nm
52allows a user or system administrator to manipulate and configure disks
53in various ways.
54It is used by specifying a disk to manipulate, the command
55to perform, and any arguments the command may require.
56.Sh COMMANDS
57The following commands are supported:
58.Pp
59.Nm getcache
60.Pp
61Get and display the cache enables for the specified device.
62.Pp
63.Nm setcache
64.Ar none | r | w | rw
65.Op Ar save
66.Pp
67Set the cache enables for the specified device.
68The enables are as follows:
69.Bl -tag -width indent
70.It none
71Disable all caches on the disk.
72.It r
73Enable the read cache, and disable all other caches on the disk.
74.It w
75Enable the write cache, and disable all other caches on the disk.
76.It rw
77Enable both the read and write caches on the disk.
78.It save
79If specified, and the cache enables are savable, saves the cache
80enables in the disk's non-volatile parameter storage.
81.El
82.Pp
83.Nm synccache
84.Op Ar force
85.Pp
86Causes the cache on the disk to be synchronized, flushing all dirty
87write cache blocks to the media.
88If
89.Ar force
90is specified, the cache synchronization command will be issued even
91if the kernel does not believe that there are any dirty cache blocks
92in the disk's cache.
93.Pp
94.Nm keeplabel
95.Op Ar yes | no
96.Pp
97Specify to keep or drop the in-core disklabel on the last close of
98the disk device.
99(Keep if
100.Ar yes
101is specified, drop if
102.Ar no
103is specified.)
104.Pp
105.Nm badsector
106.Ar flush | list | retry
107.Pp
108Used for managing the kernel's bad sector list for wd* devices.
109.Bl -tag -width indent
110.It flush
111Clears the in kernel list of bad sectors.
112.It list
113Prints out the list of bad sector ranges recorded by the kernel.
114.It retry
115Flushes the in kernel list and then retries all of the previously recorded
116bad sectors, causing the list to self update.
117This option
118.Em can only
119be used with character devices.
120.El
121.Sh SEE ALSO
122.Xr ioctl 2 ,
123.Xr sd 4 ,
124.Xr wd 4 ,
125.Xr disklabel 5
126.Sh HISTORY
127The
128.Nm
129command first appeared in
130.Nx 1.6 .
131.Sh AUTHORS
132The
133.Nm
134command was written by Jason R. Thorpe of Wasabi Systems, Inc.
135