BIO(4) | Device Drivers Manual | BIO(4)

# NAME

`bio` — Block IO ioctl tunnel pseudo-device

# SYNOPSIS

`pseudo-device bio`

`#include <dev/biovar.h>`

# DESCRIPTION

The `bio` driver provides userland applications ioctl(2) access to devices otherwise not found as /dev nodes. The /dev/bio device node operates by delegating ioctl calls to a requested device driver. Only drivers which have registered with the `bio` device can be accessed via this interface.

The following device drivers register with `bio` for volume management:

arcmsr(4)
  Areca Technology Corporation SATA RAID controller
ataraid(4)
  Software BIOS RAID
cac(4)
  Compaq RAID array controller
ciss(4)
  Compaq Smart ARRAY 5/6 SAS/SATA/SCSI RAID controller
mfi(4)
  LSI Logic & Dell MegaRAID SAS RAID controller
mfii(4)
  LSI Logic MegaRAID SAS Fusion RAID controller
mpii(4)
  LSI Logic Fusion-MPT Message Passing Interface II
mpt(4)
  LSI Fusion-MPT RAID controller

The following ioctl calls apply to the `bio` device:

`BIOCLOCATE`
  Locate a named device and give back a cookie to the application for subsequent ioctl calls. The cookie is used to tunnel further ioctls to the right device.
`BIOCINQ`
  Retrieve number of volumes and physical disks for a specific device.
`BIOCDISK`
  Retrieve detailed information for the specified physical disk. Information returned can include status, size, channel, target, lun, vendor name, serial number, and processor device (ses).
`BIOCDISK_NOVOL`
  Is just the same as `BIOCDISK` but doesn't require the disks to be in volume sets, so this applies to any physical disk connected to the controller.

  Note: this ioctl might not be supported on all hardware. It is a NetBSD extension of `bio`. It is supported by arcmsr(4), ciss(4), and mpt(4). It is also supported by cac(4), but handled exactly the same as `BIOCDISK`.

`BIOCVOL`
  Retrieve detailed information for the specified volume. Information returned can include status, size, RAID level, number of disks, device name association (sd?) and vendor name.
`BIOCALARM`
  Control the alarm beeper on the device. Supported states are: disable alarm, enable alarm, silence alarm, status and test alarm.

  Note: These options might not be supported on all hardware. It is supported by arcmsr(4), mfi(4), and mfii(4).

`BIOCBLINK`
  Blink an LED of the specified physical disk. Supported blink states are: blink LED, unblink LED and blink alarm LED.

  Note: This option is only supported if the disk is governed by ses(4) and the hardware supports hardware blinking. It is supported by ciss(4), mfi(4), and mfii(4).

`BIOCSETSTATE`
  Alter the state of specified physical disk. Supported states are: create/remove hot-spare, create/remove pass through disk, start/stop consistency check in a volume, online disk and offline disk, and a manual rebuild kick-off designation.

  Note: These options might not be supported on all hardware. Some of these options are supported by arcmsr(4), mfi(4), and mfii(4).

  Online, offline and hotspare designations are supported by mfi(4) and mfii(4), plus a rebuild designation is supported by mfii(4); all four of these state options are the original states from OpenBSD, the other options, including hotspare unmarking, being NetBSD extensions of `bio`.

  Hotspare, pass through and consistency check options are supported by arcmsr(4).

`BIOCVOLOPS`
  For operations in volume sets. It's able to create and remove a volume set in a supported RAID controller.

  Note: this ioctl might not be supported on all hardware. It is a NetBSD extension of `bio`, and is supported by arcmsr(4).

The bioctl(8) utility can be used to perform the above controls from the userland. Additionally, since `BIOCVOL` volume status is normally duplicated into sysmon_envsys(9) sensors of `ENVSYS_DRIVE` type, it is also available through envsys(4), and can be monitored with envstat(8) and powerd(8).

# FILES

/dev/bio
  ioctl tunnel device
/etc/powerd/scripts/sensor_drive
  powerd script for drive sensors

# SEE ALSO

ioctl(2), envsys(4), bioctl(8), envstat(8), powerd(8), sysmon_envsys(9)

# HISTORY

The `bio` driver first appeared in OpenBSD 3.2 and NetBSD 4.0.

# AUTHORS

The `bio` driver was written by Niklas Hallqvist <niklas@openbsd.org>. The API was written by Marco Peereboom <marco@openbsd.org> and was extended even more for NetBSD by Juan Romero Pardines <xtraeme@netbsd.org>.

May 9, 2019 | NetBSD 11.99