snj doesn't like my accent, so use proper English month names.
[netbsd-mini2440.git] / sbin / dkctl / dkctl.8
bloba664dd75f24f04bec217452d24ed3cdf01694973
1 .\"     $NetBSD: dkctl.8,v 1.19 2009/07/30 05:54:43 spz 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 30, 2009
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 .Nm
46 .Ar device
47 .Ar command
48 .Op Ar arg Op ...
49 .Sh DESCRIPTION
50 .Nm
51 allows a user or system administrator to manipulate and configure disks
52 in various ways.
53 It is used by specifying a disk to manipulate, the command
54 to perform, and any arguments the command may require.
56 .Nm
57 is called without any command, it displays strategy, cache, and all of
58 the wedges of the specified device.
59 .Sh COMMANDS
60 The following commands are supported:
61 .Bl -tag -width XXstrategyXXnameXX
62 .It Ic getcache
63 Get and display the cache enables for the specified device.
64 .It Ic setcache Ar none | r | w | rw Op Ar save
65 Set the cache enables for the specified device.
66 The enables are as follows:
67 .Bl -tag -offset indent -width XsaveX
68 .It none
69 Disable all caches on the disk.
70 .It r
71 Enable the read cache, and disable all other caches on the disk.
72 .It w
73 Enable the write cache, and disable all other caches on the disk.
74 .It rw
75 Enable both the read and write caches on the disk.
76 .It save
77 If specified, and the cache enables are savable, saves the cache
78 enables in the disk's non-volatile parameter storage.
79 .El
80 .It Ic synccache Op Ar force
81 Causes the cache on the disk to be synchronized, flushing all dirty
82 write cache blocks to the media.
84 .Ar force
85 is specified, the cache synchronization command will be issued even
86 if the kernel does not believe that there are any dirty cache blocks
87 in the disk's cache.
88 .It Ic keeplabel Op Ar yes | no
89 Specify to keep or drop the in-core disklabel on the last close of
90 the disk device.
91 (Keep if
92 .Ar yes
93 is specified, drop if
94 .Ar no
95 is specified.)
96 .It Ic badsector Ar flush | list | retry
97 Used for managing the kernel's bad sector list for
98 .Xr wd 4
99 devices.
100 The software bad sector list is only maintained if the option
101 .Dq WD_SOFTBADSECT
102 was specified on kernel configuration.
103 .Bl -tag -width XflushXX -offset indent
104 .It flush
105 Clears the in kernel list of bad sectors.
106 .It list
107 Prints out the list of bad sector ranges recorded by the kernel.
108 .It retry
109 Flushes the in kernel list and then retries all of the previously recorded
110 bad sectors, causing the list to self update.
111 This option
112 .Em can only
113 be used with character devices.
115 .It Ic addwedge Ar name Ar startblk Ar blkcnt Ar ptype
116 Define a
117 .Dq wedge
118 on the specified disk starting at block number
119 .Ar startblk
120 and spanning
121 .Ar blkcnt
122 blocks.
123 The wedge will have the volume name
124 .Ar name
125 and the partition type
126 .Ar ptype .
127 Valid choices for ptype would be
128 .Ar unused ,
129 .Ar swap ,
130 .Ar ffs ,
131 .Ar lfs ,
132 .Ar ext2fs ,
133 .Ar cd9660 ,
134 .Ar ados ,
135 .Ar hfs ,
136 .Ar msdos ,
137 .Ar filecore ,
138 .Ar raidframe ,
139 .Ar ccd ,
140 .Ar appleufs ,
141 .Ar ntfs ,
143 .Ar cgd .
145 The device name of the virtual block device assigned to the wedge will be
146 displayed after the wedge has been successfully created.
148 .Xr dk 4
149 for more information about disk wedges.
150 .It Ic delwedge Ar dk
151 Delete the wedge specified by its device name
152 .Ar dk
153 from the specified disk.
154 .It Ic getwedgeinfo
155 Display information about the specified disk wedge.
156 .It Ic listwedges
157 List all of the wedges configured on the specified disk.
158 .It Ic strategy Op Ar name
159 Get and set the disk I/O scheduler (buffer queue strategy) on the
160 drive.
161 If you do not provide a
162 .Ar name
163 argument, the currently selected strategy will be shown.
164 To set the bufq strategy, the
165 .Ar name
166 argument must be specified.
167 .Ar name
168 must be the name of one of the built-in kernel disk I/O schedulers.
169 To get the list of supported schedulers, use the following command:
170 .Bd -literal -offset indent
171 $ sysctl kern.bufq.strategies
174 .Sh SEE ALSO
175 .Xr ioctl 2 ,
176 .Xr dk 4 ,
177 .Xr sd 4 ,
178 .Xr wd 4 ,
179 .Xr disklabel 5 ,
180 .Xr atactl 8 ,
181 .Xr scsictl 8
182 .Sh HISTORY
185 command first appeared in
186 .Nx 1.6 .
187 .Sh AUTHORS
190 command was written by
191 .An Jason R. Thorpe
192 of Wasabi Systems, Inc.