xref: /netbsd-src/sbin/dkctl/dkctl.8 (revision ce099b40997c43048fb78bd578195f81d2456523)
1.\"	$NetBSD: dkctl.8,v 1.17 2006/01/12 20:28:29 wiz 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 December 26, 2005
37.Dt DKCTL 8
38.Os
39.Sh NAME
40.Nm dkctl
41.Nd program to manipulate disks
42.Sh SYNOPSIS
43.Nm
44.Ar device
45.Ar command
46.Op Ar arg Op ...
47.Sh DESCRIPTION
48.Nm
49allows a user or system administrator to manipulate and configure disks
50in various ways.
51It is used by specifying a disk to manipulate, the command
52to perform, and any arguments the command may require.
53.Sh COMMANDS
54The following commands are supported:
55.Bl -tag -width XXstrategyXXnameXX
56.It Ic getcache
57Get and display the cache enables for the specified device.
58.It Ic setcache Ar none | r | w | rw Op Ar save
59Set the cache enables for the specified device.
60The enables are as follows:
61.Bl -tag -offset indent -width XsaveX
62.It none
63Disable all caches on the disk.
64.It r
65Enable the read cache, and disable all other caches on the disk.
66.It w
67Enable the write cache, and disable all other caches on the disk.
68.It rw
69Enable both the read and write caches on the disk.
70.It save
71If specified, and the cache enables are savable, saves the cache
72enables in the disk's non-volatile parameter storage.
73.El
74.It Ic synccache Op Ar force
75Causes the cache on the disk to be synchronized, flushing all dirty
76write cache blocks to the media.
77If
78.Ar force
79is specified, the cache synchronization command will be issued even
80if the kernel does not believe that there are any dirty cache blocks
81in the disk's cache.
82.It Ic keeplabel Op Ar yes | no
83Specify to keep or drop the in-core disklabel on the last close of
84the disk device.
85(Keep if
86.Ar yes
87is specified, drop if
88.Ar no
89is specified.)
90.It Ic badsector Ar flush | list | retry
91Used for managing the kernel's bad sector list for
92.Xr wd 4
93devices.
94The software bad sector list is only maintained if the option
95.Dq WD_SOFTBADSECT
96was specified on kernel configuration.
97.Bl -tag -width XflushXX -offset indent
98.It flush
99Clears the in kernel list of bad sectors.
100.It list
101Prints out the list of bad sector ranges recorded by the kernel.
102.It retry
103Flushes the in kernel list and then retries all of the previously recorded
104bad sectors, causing the list to self update.
105This option
106.Em can only
107be used with character devices.
108.El
109.It Ic addwedge Ar name Ar startblk Ar blkcnt Ar ptype
110Define a
111.Dq wedge
112on the specified disk starting at block number
113.Ar startblk
114and spanning
115.Ar blkcnt
116blocks.
117The wedge will have the volume name
118.Ar name
119and the partition type
120.Ar ptype .
121The device name of the virtual block device assigned to the wedge will be
122displayed after the wedge has been successfully created.
123See
124.Xr dk 4
125for more information about disk wedges.
126.It Ic delwedge Ar dk
127Delete the wedge specified by its device name
128.Ar dk
129from the specified disk.
130.It Ic getwedgeinfo
131Display information about the specified disk wedge.
132.It Ic listwedges
133List all of the wedges configured on the specified disk.
134.It Ic strategy Op Ar name
135Get and set the disk I/O scheduler (buffer queue strategy) on the
136drive.
137If you do not provide a
138.Ar name
139argument, the currently selected strategy will be shown.
140To set the bufq strategy, the
141.Ar name
142argument must be specified.
143.Ar name
144must be the name of one of the built-in kernel disk I/O schedulers.
145To get the list of supported schedulers, use the following command:
146.Bd -literal -offset indent
147$ sysctl kern.bufq.strategies
148.Ed
149.El
150.Sh SEE ALSO
151.Xr ioctl 2 ,
152.Xr dk 4 ,
153.Xr sd 4 ,
154.Xr wd 4 ,
155.Xr disklabel 5 ,
156.Xr atactl 8 ,
157.Xr scsictl 8
158.Sh HISTORY
159The
160.Nm
161command first appeared in
162.Nx 1.6 .
163.Sh AUTHORS
164The
165.Nm
166command was written by
167.An Jason R. Thorpe
168of Wasabi Systems, Inc.
169