xref: /openbsd/sbin/bioctl/bioctl.8 (revision 7b36286a)
1.\"	$OpenBSD: bioctl.8,v 1.61 2008/08/22 06:41:36 jmc Exp $
2.\"
3.\" Copyright (c) 2004, 2005 Marco Peereboom
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright
9.\"    notice, this list of conditions and the following disclaimer.
10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\"    notice, this list of conditions and the following disclaimer in the
12.\"    documentation and/or other materials provided with the distribution.
13.\"
14.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
15.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
18.\" ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24.\" SUCH DAMAGE.
25.\"
26.Dd $Mdocdate: August 22 2008 $
27.Dt BIOCTL 8
28.Os
29.Sh NAME
30.Nm bioctl
31.Nd RAID management interface
32.Sh SYNOPSIS
33.Nm bioctl
34.Bk -words
35.Op Fl dhiqv
36.Op Fl a Ar alarm-function
37.Op Fl b Ar channel:target[.lun]
38.Op Fl C Ar flag[,flag,...]
39.Op Fl c Ar raidlevel
40.Op Fl H Ar channel:target[.lun]
41.Op Fl l Ar special[,special,...]
42.Op Fl R Ar device\*(Bachannel:target[.lun]
43.Op Fl r Ar rounds
44.Op Fl u Ar channel:target[.lun]
45.Ar device
46.Ek
47.Sh DESCRIPTION
48RAID device drivers which support management functionality can
49register their services with the
50.Xr bio 4
51driver.
52.Nm bioctl
53then can be used to maintain RAID volumes.
54.Pp
55The options are as follows:
56.Bl -tag -width Ds
57.It Fl a Ar alarm-function
58Control the RAID card's alarm functionality, if supported.
59.Ar alarm-function
60may be one of:
61.Pp
62.Bl -tag -width disable -compact
63.It Ar disable
64Disable the alarm on the RAID controller.
65.It Ar enable
66Enable the alarm on the RAID controller.
67.It Ar get
68Retrieve the current alarm state (enabled or disabled).
69.It Ar silence | Ar quiet
70Silence the alarm if it is currently beeping.
71.El
72.Pp
73The
74.Ar alarm-function
75may be specified as given above,
76or by the first letter only
77(e.g. -a e).
78.It Fl b Ar channel:target[.lun]
79Instruct the device at
80.Ar channel:target[.lun]
81to start blinking, if there is
82.Xr ses 4
83or
84.Xr safte 4
85support in the enclosure.
86.It Fl C Ar flag[,flag,...]
87Pass flags when doing operations with
88.Nm .
89May be one of:
90.Pp
91.Bl -tag -width disable -compact
92.It Ar force
93Force the operation, e.g. to force creation of volumes
94with unclean data in the metatdata areas.
95.It Ar noauto
96Ignore this RAID volume upon reboot.
97.El
98.It Fl c Ar raidlevel
99Create a
100.Xr softraid 4
101device of level
102.Ar raidlevel .
103The device must begin with
104.Dq softraid
105followed by a number.
106.Pp
107Valid raidlevels are:
108.Pp
109.Bl -tag -width Ds -offset indent -compact
110.It 0
111RAID 0:
112A striping discipline.
113.It 1
114RAID 1:
115A mirroring discipline.
116.It C
117CRYPTO:
118An encrypting discipline.
119.El
120.It Fl d
121Delete volume specified by device.
122.It Fl H Ar channel:target[.lun]
123If the device at
124.Ar channel:target[.lun]
125is currently marked
126.Dq Unused ,
127promote it to being a
128.Dq Hot Spare .
129.It Fl h
130Where necessary, produce "human-readable" output.
131Use unit suffixes: Byte, Kilobyte, Megabyte,
132Gigabyte, Terabyte, Petabyte, Exabyte in order to reduce the number of
133digits to four or less.
134.It Fl i
135Enumerate the selected RAID devices.
136.It Fl l Ar special[,special,...]
137Use
138.Ar special
139device list to create within the
140.Xr softraid 4
141framework.
142Requires
143.Fl c .
144.It Fl q
145Show vendor, product, revision, and serial number for the given disk.
146.It Fl R Ar device\*(Bachannel:target[.lun]
147Manually kick off a rebuild using
148.Ar device
149or
150.Ar channel:target[.lun]
151on the provided drive name.
152This command requires a drive by name (e.g. sd1) instead of a controller
153by name (e.g. softraid0).
154.It Fl r Ar rounds
155When creating an encrypted volume, specifies the number of iterations of
156the algorithm used to convert a passphrase into a key.
157Higher iteration counts take more time, but offer more resistance to key
158guessing attacks.
159The minimum is 1000 rounds and the default is 8192.
160.It Fl u Ar channel:target[.lun]
161Instruct the device at
162.Ar channel:target[.lun]
163to cease blinking, if there is
164.Xr ses 4
165or
166.Xr safte 4
167support in the enclosure.
168.It Fl v
169Be more verbose in output.
170.It Ar device
171Select a drive by name (e.g. sd0) or a RAID controller by name (e.g. ami0).
172For operations which will be performed against
173.Xr ses 4
174or
175.Xr safte 4
176enclosures, it is also possible to directly specify the enclosure name
177(e.g. safte0).
178.El
179.Sh EXAMPLES
180The following command, executed from the command line, would configure
181the device softraid0 with 4 special devices
182(/dev/sd2e, /dev/sd3e, /dev/sd4e, /dev/sd5e) and
183a raid level of 1:
184.Bd -literal -offset 3n
185# bioctl -c 1 -l /dev/sd2e,/dev/sd3e,/dev/sd4e,/dev/sd5e softraid0
186.Ed
187.Pp
188The following command, executed from the command line, would configure the
189device softraid0 with one special device (/dev/sd2e) and an encrypting
190volume:
191.Bd -literal -offset 3n
192# bioctl -c C -l /dev/sd2e softraid0
193.Ed
194.Pp
195.Nm
196will ask for a passphrase, that will be needed to unlock the encrypted
197disk.
198After creating a new encrypted disk, it should be zeroed with the
199following command (assuming the new disk is sd3):
200.Bd -literal -offset 3n
201# dd if=/dev/zero of=/dev/rsd3c
202.Ed
203.Sh SEE ALSO
204.Xr ami 4 ,
205.Xr arc 4 ,
206.Xr bio 4 ,
207.Xr ciss 4 ,
208.Xr mfi 4 ,
209.Xr safte 4 ,
210.Xr scsi 4 ,
211.Xr ses 4 ,
212.Xr softraid 4
213.Sh HISTORY
214The
215.Nm
216command first appeared in
217.Ox 3.8 .
218.Sh AUTHORS
219The
220.Nm
221interface was written by
222.An Marco Peereboom Aq marco@openbsd.org .
223.Sh CAVEATS
224Use of the crypto discipline is currently considered experimental.
225