BIOCTL(8) | System Manager's Manual | BIOCTL(8) |
bioctl
— RAID
management interface
bioctl |
[-hiqv ] [-a
alarm-function] [-b
channel:target[.lun]]
[-H
channel:target[.lun]]
[-R device |
channel:target[.lun]]
[-t patrol-function]
[-u
channel:target[.lun]]
device |
bioctl |
[-dhiPqsv ] [-C
flag[,flag[,...]]]
[-c raidlevel]
[-k keydisk]
[-l
special[,special[,...]]]
[-O device |
channel:target[.lun]]
[-p passfile]
[-R device |
channel:target[.lun]]
[-r rounds]
device |
RAID device drivers which support management functionality can
register their services with the
bio(4) driver.
bioctl
then can be used to maintain RAID
volumes.
In the first synopsis, RAID controllers are managed. device specifies either a drive (e.g. sd0) or a RAID controller (e.g. ami0). For operations which will be performed against ses(4) or safte(4) enclosures, it is also possible to directly specify the enclosure name (e.g. safte0).
In the second synopsis, softraid(4) devices are managed. device specifies either a drive (e.g. sd0) or a softraid(4) device (e.g. softraid0).
The options for RAID controllers are as follows:
-a
alarm-functiondisable
enable
get
silence
|
quiet
The alarm-function may be specified as given above, or by the first letter only (e.g. -a e).
-b
channel:target[.lun]-H
channel:target[.lun]-h
-i
-q
-R
device |
channel:target[.lun]-t
patrol-functionstop
start
get
disable
manual
auto
[.interval[.start]]-u
channel:target[.lun]-v
In addition to the relevant options listed above, the options for softraid(4) devices are as follows:
-C
flag[,flag[,...]]bioctl
. May be
one of:
-c
raidlevelValid raidlevels are:
The RAID 0, RAID 1 and CONCAT disciplines require a minimum of
two devices to be provided via -l
. RAID 5
requires at least three devices and the CRYPTO discipline requires
exactly one.
-d
-k
keydisk-l
special[,special[,...]]-c
.-O
device |
channel:target[.lun]-P
-p
passfile-r
rounds-s
The following command, executed from the command line, would configure the device softraid0 with 4 special devices (/dev/sd2e, /dev/sd3e, /dev/sd4e, /dev/sd5e) and a RAID level of 1:
# bioctl -c 1 -l /dev/sd2e,/dev/sd3e,/dev/sd4e,/dev/sd5e softraid0
The following command, executed from the command line, would configure the device softraid0 with one special device (/dev/sd2e) and an encrypting volume:
# bioctl -c C -l /dev/sd2e softraid0
bioctl
will ask for a passphrase, which
will be needed to unlock the encrypted disk. After creating a newly
encrypted disk, the first megabyte of it should be zeroed, so tools like
fdisk(8) or
disklabel(8) don't get
confused by the random data that appears on the new disk. This can be done
with the following command (assuming the new disk is sd3):
# dd if=/dev/zero of=/dev/rsd3c bs=1m count=1
Detaching a softraid volume requires the exact volume name. For example:
# bioctl -d sd2
The following command starts a rebuild of the degraded softraid volume sd0 using a new chunk on wd0d:
# bioctl -R /dev/wd0d sd0
The bioctl
command first appeared in
OpenBSD 3.8.
The bioctl
interface was written by
Marco Peereboom
<marco@openbsd.org>.
November 27, 2016 | OpenBSD-6.1 |