2006-01-12 23:28:29 +03:00
|
|
|
.\" $NetBSD: dkctl.8,v 1.17 2006/01/12 20:28:29 wiz Exp $
|
2002-01-10 01:30:14 +03:00
|
|
|
.\"
|
|
|
|
.\" 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.
|
|
|
|
.\"
|
2005-12-26 13:38:52 +03:00
|
|
|
.Dd December 26, 2005
|
2002-01-10 01:30:14 +03:00
|
|
|
.Dt DKCTL 8
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm dkctl
|
2004-09-25 16:44:25 +04:00
|
|
|
.Nd program to manipulate disks
|
2002-01-10 01:30:14 +03:00
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
|
|
|
.Ar device
|
|
|
|
.Ar command
|
2004-09-25 16:44:25 +04:00
|
|
|
.Op Ar arg Op ...
|
2002-01-10 01:30:14 +03:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
.Nm
|
|
|
|
allows a user or system administrator to manipulate and configure disks
|
2002-10-01 17:40:23 +04:00
|
|
|
in various ways.
|
|
|
|
It is used by specifying a disk to manipulate, the command
|
2002-01-10 01:30:14 +03:00
|
|
|
to perform, and any arguments the command may require.
|
|
|
|
.Sh COMMANDS
|
|
|
|
The following commands are supported:
|
2006-01-12 23:28:29 +03:00
|
|
|
.Bl -tag -width XXstrategyXXnameXX
|
2004-09-25 16:44:25 +04:00
|
|
|
.It Ic getcache
|
2002-01-10 01:30:14 +03:00
|
|
|
Get and display the cache enables for the specified device.
|
2004-09-25 16:44:25 +04:00
|
|
|
.It Ic setcache Ar none | r | w | rw Op Ar save
|
2002-10-01 17:40:23 +04:00
|
|
|
Set the cache enables for the specified device.
|
|
|
|
The enables are as follows:
|
2004-09-25 16:44:25 +04:00
|
|
|
.Bl -tag -offset indent -width XsaveX
|
2002-01-10 01:30:14 +03:00
|
|
|
.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
|
2004-09-25 16:44:25 +04:00
|
|
|
.It Ic synccache Op Ar force
|
2002-01-10 01:30:14 +03:00
|
|
|
Causes the cache on the disk to be synchronized, flushing all dirty
|
2002-10-01 17:40:23 +04:00
|
|
|
write cache blocks to the media.
|
|
|
|
If
|
2002-01-10 01:30:14 +03:00
|
|
|
.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.
|
2004-09-25 16:44:25 +04:00
|
|
|
.It Ic keeplabel Op Ar yes | no
|
2002-07-01 22:49:57 +04:00
|
|
|
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.)
|
2004-09-25 16:44:25 +04:00
|
|
|
.It Ic badsector Ar flush | list | retry
|
|
|
|
Used for managing the kernel's bad sector list for
|
|
|
|
.Xr wd 4
|
|
|
|
devices.
|
2004-08-30 13:38:28 +04:00
|
|
|
The software bad sector list is only maintained if the option
|
|
|
|
.Dq WD_SOFTBADSECT
|
|
|
|
was specified on kernel configuration.
|
2006-01-12 23:28:29 +03:00
|
|
|
.Bl -tag -width XflushXX -offset indent
|
2003-04-15 22:27:26 +04:00
|
|
|
.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
|
2003-04-16 17:05:01 +04:00
|
|
|
bad sectors, causing the list to self update.
|
|
|
|
This option
|
2003-04-15 22:39:58 +04:00
|
|
|
.Em can only
|
|
|
|
be used with character devices.
|
2003-04-15 22:27:26 +04:00
|
|
|
.El
|
2004-09-25 16:44:25 +04:00
|
|
|
.It Ic addwedge Ar name Ar startblk Ar blkcnt Ar ptype
|
2004-09-25 07:31:35 +04:00
|
|
|
Define a
|
2004-09-25 16:44:25 +04:00
|
|
|
.Dq wedge
|
2004-09-25 07:31:35 +04:00
|
|
|
on the specified disk starting at block number
|
|
|
|
.Ar startblk
|
|
|
|
and spanning
|
|
|
|
.Ar blkcnt
|
|
|
|
blocks.
|
|
|
|
The wedge will have the volume name
|
|
|
|
.Ar name
|
|
|
|
and the partition type
|
|
|
|
.Ar ptype .
|
|
|
|
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.
|
2004-09-25 16:44:25 +04:00
|
|
|
.It Ic delwedge Ar dk
|
2004-09-25 07:31:35 +04:00
|
|
|
Delete the wedge specified by its device name
|
|
|
|
.Ar dk
|
|
|
|
from the specified disk.
|
2004-09-25 16:44:25 +04:00
|
|
|
.It Ic getwedgeinfo
|
2004-09-25 07:31:35 +04:00
|
|
|
Display information about the specified disk wedge.
|
2004-09-25 16:44:25 +04:00
|
|
|
.It Ic listwedges
|
2004-09-25 07:31:35 +04:00
|
|
|
List all of the wedges configured on the specified disk.
|
2005-12-26 13:38:52 +03:00
|
|
|
.It Ic strategy Op Ar name
|
2006-01-12 23:28:29 +03:00
|
|
|
Get and set the disk I/O scheduler (buffer queue strategy) on the
|
|
|
|
drive.
|
|
|
|
If you do not provide a
|
2005-12-26 13:38:52 +03:00
|
|
|
.Ar name
|
2006-01-12 23:28:29 +03:00
|
|
|
argument, the currently selected strategy will be shown.
|
|
|
|
To set the bufq strategy, the
|
2005-12-26 13:38:52 +03:00
|
|
|
.Ar name
|
2006-01-12 23:28:29 +03:00
|
|
|
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:
|
2005-12-26 13:38:52 +03:00
|
|
|
.Bd -literal -offset indent
|
|
|
|
$ sysctl kern.bufq.strategies
|
|
|
|
.Ed
|
2004-09-25 16:44:25 +04:00
|
|
|
.El
|
2002-01-10 01:30:14 +03:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr ioctl 2 ,
|
2004-09-25 07:31:35 +04:00
|
|
|
.Xr dk 4 ,
|
2002-01-10 01:30:14 +03:00
|
|
|
.Xr sd 4 ,
|
2003-07-13 13:53:10 +04:00
|
|
|
.Xr wd 4 ,
|
2004-09-16 22:02:27 +04:00
|
|
|
.Xr disklabel 5 ,
|
|
|
|
.Xr atactl 8 ,
|
|
|
|
.Xr scsictl 8
|
2002-01-10 01:30:14 +03:00
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
command first appeared in
|
|
|
|
.Nx 1.6 .
|
|
|
|
.Sh AUTHORS
|
|
|
|
The
|
|
|
|
.Nm
|
2004-09-25 16:44:25 +04:00
|
|
|
command was written by
|
|
|
|
.An Jason R. Thorpe
|
|
|
|
of Wasabi Systems, Inc.
|