summaryrefslogtreecommitdiff
path: root/static/netbsd/man8/dkctl.8
blob: 5f7ceeda03d33ecf0dba843b765b1d7f49594fc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
.\"	$NetBSD: dkctl.8,v 1.30 2024/09/14 08:30:44 mlelstv Exp $
.\"
.\" Copyright 2002 Wasabi Systems, Inc.
.\" All rights reserved.
.\"
.\" Written by Jason R. Thorpe for Wasabi Systems, Inc.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\"    must display the following acknowledgement:
.\"	This product includes software developed for the NetBSD Project by
.\"	Wasabi Systems, Inc.
.\" 4. The name of Wasabi Systems, Inc. may not be used to endorse
.\"    or promote products derived from this software without specific prior
.\"    written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL WASABI SYSTEMS, INC
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd March 29, 2020
.Dt DKCTL 8
.Os
.Sh NAME
.Nm dkctl
.Nd program to manipulate disks
.Sh SYNOPSIS
.Nm
.Ar device
.Nm
.Ar device
.Ar command
.Op Ar arg Op ...
.Sh DESCRIPTION
.Nm
allows a user or system administrator to manipulate and configure disks
in various ways.
It is used by specifying a disk to manipulate, the command
to perform, and any arguments the command may require.
.Ar device
is the disk (wdN, sdN, ...) containing the wedges unless noted otherwise.
If
.Nm
is called without any command, it displays strategy, cache, and all of
the wedges of the specified device.
.Sh COMMANDS
The following commands are supported:
.Bl -tag -width XXstrategyXXnameXX
.It Ic addwedge Ar name Ar startblk Ar blkcnt Ar ptype
Define a
.Dq wedge
on the specified disk starting at block number
.Ar startblk
and spanning
.Ar blkcnt
blocks.
You need to create the partition first with
.Xr fdisk 8
or
.Xr gpt 8 ,
.Nm
will just name it.
The wedge will have the volume name
.Ar name
and the partition type
.Ar ptype .
Valid choices for ptype would be
.Ar unused ,
.Ar swap ,
.Ar ffs ,
.Ar lfs ,
.Ar ext2fs ,
.Ar cd9660 ,
.Ar ados ,
.Ar hfs ,
.Ar msdos ,
.Ar filecore ,
.Ar raidframe ,
.Ar ccd ,
.Ar appleufs ,
.Ar ntfs ,
.Ar cgd ,
and
.Ar zfs .
.Pp
The device name of the virtual block device assigned to the wedge will be
displayed after the wedge has been successfully created.
See
.Xr dk 4
for more information about disk wedges.
.It Ic badsector Ar flush | list | retry
Used for managing the kernel's bad sector list for
.Xr wd 4
devices.
The software bad sector list is only maintained if the option
.Dq WD_SOFTBADSECT
was specified on kernel configuration.
.Bl -tag -width XflushXX -offset indent
.It flush
Clears the in kernel list of bad sectors.
.It list
Prints out the list of bad sector ranges recorded by the kernel.
.It retry
Flushes the in kernel list and then retries all of the previously recorded
bad sectors, causing the list to self update.
This option
.Em can only
be used with character devices.
.El
.It Ic delwedge Ar dk
Delete the wedge specified by its device name
.Ar dk
from the specified disk.
.It Ic getcache
Get and display the cache enables for the specified device.
.It Ic getwedgeinfo
Display information about the specified disk wedge.
.Ar device
in this case is the wedge name.
.It Ic getgeometry
Display media and sector size of the specified disk, wedge or volume.
.It Ic keeplabel Op Ar yes | no
Specify to keep or drop the in-core disklabel on the last close of
the disk device.
(Keep if
.Ar yes
is specified, drop if
.Ar no
is specified.)
.It Ic listwedges Oo Fl e Oc Op Fl q
List all of the wedges configured on the specified disk.
With
.Fl e
exit with a non-zero exit status if there are no wedges
configured on that disk.
With
.Fl q
(quiet mode)
there is no output related to the wedges that do, or do not, exist.
.It Ic makewedges
Delete all wedges configured on the specified disk, and autodiscover
the wedges again.
Wedges that are in use are not deleted and conflicting
or overlapping wedges are not created.
You need to list wedges to find out what has changed.
.It Ic setcache Ar none | r | w | rw Op Ar save
Set the cache enables for the specified device.
The enables are as follows:
.Bl -tag -offset indent -width XsaveX
.It none
Disable all caches on the disk.
.It r
Enable the read cache, and disable all other caches on the disk.
.It w
Enable the write cache, and disable all other caches on the disk.
.It rw
Enable both the read and write caches on the disk.
.It save
If specified, and the cache enables are savable, saves the cache
enables in the disk's non-volatile parameter storage.
.El
.It Ic strategy Op Ar name
Get and set the disk I/O scheduler (buffer queue strategy) on the
drive.
If you do not provide a
.Ar name
argument, the currently selected strategy will be shown.
To set the bufq strategy, the
.Ar name
argument must be specified.
.Ar name
must be the name of one of the built-in kernel disk I/O schedulers.
To get the list of supported schedulers, use the following command:
.Bd -literal -offset indent
$ sysctl kern.bufq.strategies
.Ed
.It Ic synccache Op Ar force
Causes the cache on the disk to be synchronized, flushing all dirty
write cache blocks to the media.
If
.Ar force
is specified, the cache synchronization command will be issued even
if the kernel does not believe that there are any dirty cache blocks
in the disk's cache.
.El
.Pp
Note: The
.Ic addwedge
and
.Ic delwedge
commands only modify the in-kernel representation of disks; for
modifying information on the disks themselves, refer to
.Xr fdisk 8
or
.Xr gpt 8 .
.Sh SEE ALSO
.Xr ioctl 2 ,
.Xr dk 4 ,
.Xr sd 4 ,
.Xr wd 4 ,
.Xr disklabel 5 ,
.Xr atactl 8 ,
.Xr fdisk 8 ,
.Xr gpt 8 ,
.Xr scsictl 8
.Sh HISTORY
The
.Nm
command first appeared in
.Nx 1.6 .
.Sh AUTHORS
The
.Nm
command was written by
.An Jason R. Thorpe
of Wasabi Systems, Inc.