BIOCTL(8)               OpenBSD System Manager's Manual              BIOCTL(8)

NAME
     bioctl - RAID management interface

SYNOPSIS
     bioctl [-hiqv] [-a alarm-function] [-b channel:target[.lun]]
            [-H channel:target[.lun]] [-R device | channel:target[.lun]]
            [-u channel:target[.lun]] device

     bioctl [-dhiPqv] [-C flag[,flag,...]] [-c raidlevel] [-k keydisk]
            [-l special[,special,...]] [-p passfile]
            [-R device | channel:target[.lun]] [-r rounds] device

DESCRIPTION
     RAID device drivers which support management functionality can register
     their services with the bio(4) driver.  bioctl then can be used to main-
     tain 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 opera-
     tions 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 speci-
     fies either a drive (e.g. sd0) or a softraid(4) device (e.g. softraid0).

     The options for RAID controllers are as follows:

     -a alarm-function
             Control the RAID card's alarm functionality, if supported.
             alarm-function may be one of:

             disable  Disable the alarm on the RAID controller.
             enable   Enable the alarm on the RAID controller.
             get      Retrieve the current alarm state (enabled or disabled).
             silence | quiet
                      Silence the alarm if it is currently beeping.

             The alarm-function may be specified as given above, or by the
             first letter only (e.g. -a e).

     -b channel:target[.lun]
             Instruct the device at channel:target[.lun] to start blinking, if
             there is ses(4) or safte(4) support in the enclosure.

     -H channel:target[.lun]
             If the device at channel:target[.lun] is currently marked
             ``Unused'', promote it to being a ``Hot Spare''.

     -h      Where necessary, produce "human-readable" output.  Use unit suf-
             fixes: Byte, Kilobyte, Megabyte, Gigabyte, Terabyte, Petabyte,
             Exabyte in order to reduce the number of digits to four or less.

     -i      Enumerate the selected RAID devices.  This is the default if no
             other option is given.

     -q      Show vendor, product, revision, and serial number for the given
             disk.

     -R device | channel:target[.lun]
             Manually kick off a rebuild using device or channel:target[.lun]
             on the provided drive name.  This command requires a drive by
             name (e.g. sd1) instead of a controller by name (e.g. softraid0).

     -u channel:target[.lun]
             Instruct the device at channel:target[.lun] to cease blinking, if
             there is ses(4) or safte(4) support in the enclosure.

     -v      Be more verbose in output.

     In addition to the relevant options listed above, the options for
     softraid(4) devices are as follows:

     -C flag[,flag,...]
             Pass flag to bioctl.  May be one of:

             force    Force the operation; for example, force the creation of
                      volumes with unclean data in the metadata areas.
             noauto   Do not automatically assemble this volume at boot time.

     -c raidlevel
             Create a softraid(4) device of level raidlevel.  The device must
             begin with ``softraid'' followed by a number.

             Valid raidlevels are:

                   0       RAID 0: A striping discipline.
                   1       RAID 1: A mirroring discipline.
                   4       RAID 4: A striping discipline with fixed parity
                           chunk.
                   5       RAID 5: A striping discipline with floating parity
                           chunk.
                   C       CRYPTO: An encrypting discipline.

             The RAID 0 and RAID 1 disciplines requires a minimum of two de-
             vices passed to -l, RAID 4 and RAID 5 require at least three de-
             vices, and the CRYPTO discipline requires exactly one.

     -d      Delete volume specified by device.

     -k keydisk
             Use special device keydisk as a key disk for a crypto volume.

     -l special[,special,...]
             Use special device list to create within the softraid(4) frame-
             work.  Requires -c.

     -P      Change the passphrase on the selected crypto volume.

     -p passfile
             Passphrase file used when crypto volumes are brought up.  This
             file must be root owned and have 0600 permissions.  It cannot be
             used during the initial creation of the crypto volume.

     -r rounds
             When creating an encrypted volume, specifies the number of itera-
             tions of the algorithm used to convert a passphrase into a key.
             Higher iteration counts take more time, but offer more resistance
             to key guessing attacks.  The minimum is 1000 rounds and the de-
             fault is 8192.

EXAMPLES
     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 encrypt-
     ing volume:

        # bioctl -c C -l /dev/sd2e softraid0

     bioctl will ask for a passphrase, that will be needed to unlock the en-
     crypted 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

     Deleting a softraid volume requires the exact volume name.  For example:

        # bioctl -d sd2

SEE ALSO
     bio(4), scsi(4), softraid(4)

HISTORY
     The bioctl command first appeared in OpenBSD 3.8.

AUTHORS
     The bioctl interface was written by Marco Peereboom <marco@openbsd.org>.

CAVEATS
     Use of the crypto & RAID 4/5 disciplines are currently considered experi-
     mental.

OpenBSD 4.7                    December 31, 2009                             3
