# Bioctl

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Bioctl
> Markdown URL: https://mediated.wiki/source/Bioctl.md
> Source: https://en.wikipedia.org/wiki/Bioctl
> Source revision: 1329373596
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

{{Short description|Generic RAID volume management}}
{{lowercase}}
{{Infobox software
| name = bioctl
| author = Marco Peereboom (2005)
| developer = The [OpenBSD](/source/OpenBSD) Project
| released = {{Start date and age|2005|08|23|df=yes}}
| discontinued = no
| repo = {{URL|http://bxr.su/o/sbin/bioctl/|/sbin/bioctl}}
| programming language = [C](/source/C_(programming_language))
| operating system = [OpenBSD](/source/OpenBSD) since 3.8 (2005); [NetBSD](/source/NetBSD) since 4.0 (2007)
| genre = [RAID](/source/RAID) management and [system monitor](/source/system_monitor)ing
| licence = [BSD licence](/source/BSD_licence)
| website = {{URL|http://mdoc.su/o/bioctl.8|bioctl(8)}}
}}
The '''bio(4)''' [pseudo-device](/source/pseudo-device) driver and the '''bioctl(8)''' utility to implement a generic [RAID](/source/RAID) volume management interface in [OpenBSD](/source/OpenBSD) and [NetBSD](/source/NetBSD).<ref name=bio.4/><ref name=bioctl/>  The idea behind this software is similar to [ifconfig](/source/ifconfig), where a single utility from the [operating system](/source/operating_system) can be used to control any [RAID controller](/source/RAID_controller) using a generic [interface](/source/Interface_(computing)), instead of having to rely on many [proprietary](/source/Vendor_lock-in) and custom RAID management utilities specific for each given hardware RAID manufacturer.<ref name=onlamp-37/><ref name=theo-misc-38/><ref name=onlamp-38/><ref name=onlamp-40/><ref name=opencon06/>  Features include monitoring of the health status of the arrays, controlling identification through blinking the [LED](/source/LED)s and managing of sound alarms, and specifying [hot spare disk](/source/hot_spare_disk)s.  Additionally, the <code>softraid</code> configuration in OpenBSD is delegated to bioctl as well; whereas the initial creation of volumes and configuration of hardware RAID is left to card [BIOS](/source/BIOS) as non-essential after the operating system has already been booted.<ref name=theo-misc-38/>  Interfacing between the kernel and userland is performed through the <code>[ioctl](/source/ioctl)</code> system call through the '''<code>/dev/bio</code>''' [pseudo-device](/source/pseudo-device).

== Overview ==

The bio/bioctl subsystem is deemed to be an important part in OpenBSD's advocacy for open hardware documentation, and the 3.8 release title and the titular song were dedicated to the topic — ''Hackers of the Lost RAID''.<ref name=onlamp-38/><ref name=o38/><ref name=lyrics-38/>
The development took place during a time of controversy where [Adaptec](/source/Adaptec) refused to release appropriate hardware documentation that was necessary in order for the make the aac(4) driver work reliably, which followed with OpenBSD disabling support for the driver.{{r|lyrics-38}}

In the commentary to the 3.8 release,{{r|lyrics-38}} the developers express the [irony](/source/irony) of hardware [RAID controller](/source/RAID_controller)s' supposed purpose of providing reliability, through [redundancy](/source/Redundancy_(engineering)) and repair, whereas in reality many vendors expect [system administrator](/source/system_administrator)s to install and depend on huge [binary blob](/source/binary_blob)s in order to be assess volume health and service their [disk array](/source/disk_array)s.
Specifically, OpenBSD is making a reference to the [modus operandi](/source/modus_operandi) of [FreeBSD](/source/FreeBSD), where the documentation of the aac(4) driver for Adaptec specifically suggests enabling [Linux compatibility layer](/source/FreeBSD) in order to use the management utilities (where the documentation even fails to explain where exactly these utilities must be obtained from, or which versions would be compatible, evidently because the [proprietary tools](/source/proprietary_software) may have expired).{{r|f-aac|f-aaccli|opencon06-drivers-f}}

Likewise, OpenBSD developers intentionally chose to concentrate on supporting only the most basic features of each controller which are uniform across all the brands and variations; specifically, the fact that initial configuration of each controller must still be made through card [BIOS](/source/BIOS) was never kept secret from any bio/bioctl announcement.{{r|theo-misc-38|onlamp-38}}
This can be contrasted with the approach taken by FreeBSD, for example, where individual utilities exist for several independent RAID drivers, and the interface of each utility is independent of one another; specifically, {{as of|2019|03|lc=y|url=http://bxr.su/f/usr.sbin/}}, FreeBSD includes separate device-specific utilities called <code>mfiutil</code>, <code>mptutil</code>, <code>mpsutil</code>/<code>mprutil</code> and <code>sesutil</code>,{{r|mfiutil|mptutil|mpsutil/mprutil|sesutil}}, each of which provides many options with at least subtle differences in the interface for configuration and management of the controllers, contributes to [code bloat](/source/code_bloat), not to mention any additional drivers for which no such tool even exists as [open-source software](/source/open-source_software) at all.{{r|opencon06-docs-drive}}
In OpenBSD 6.4 (2018), a dozen of drivers register with the bio framework.{{r|bio.4}}

== The <code>drive</code> sensors ==
{{See also|hw.sensors#drive|envsys}}

Monitoring of the state of each logical drive is also duplicated into the [hardware monitoring](/source/hardware_monitoring) frameworks and their corresponding utilities on both systems where bioctl is available — [hw.sensors](/source/hw.sensors) with sensorsd in OpenBSD<ref name=theo-misc-38/> and sysmon [envsys](/source/envsys) with envstat and powerd in [NetBSD](/source/NetBSD).<ref name=sensors-mmath/>  For example, on OpenBSD since 4.2 release, the status of the drive sensors could be automatically monitored simply by starting sensorsd without any specific configuration being required.<ref name=onlamp-42/>  More drivers are being converted to use the bio and sensors frameworks with each release.<ref name=onlamp-45/>

== SES/SAF-TE ==
{{See also|SCSI Enclosure Services|SAF-TE}}

{{anchor|ses|safte|SES|SAF-TE}} In OpenBSD, both [SCSI Enclosure Services](/source/SCSI_Enclosure_Services) (SES)<ref name=ses/> and [SAF-TE](/source/SAF-TE)<ref name=safte/> are supported since OpenBSD 3.8 (2005) as well, both of which feature [LED](/source/LED) blinking through bio and bioctl (by implementing the <code>BIOCBLINK</code> [ioctl](/source/ioctl)), helping [system administrator](/source/system_administrator)s identify devices within the enclosures to service.  Additionally, both the SES and SAF-TE drivers in OpenBSD feature support for a combination of temperature and fan sensors, [PSU](/source/power_supply_unit_(computer)), doorlock and alarm indicators; all of this auxiliary sensor data is exported into the [hw.sensors](/source/hw.sensors) framework in OpenBSD,<ref name=theo-misc-38/> and can be monitored through familiar tools like [sysctl](/source/sysctl), [SNMP](/source/Simple_Network_Management_Protocol) and [sensorsd](/source/sensorsd).

{{As of|2019}}, in [NetBSD](/source/NetBSD), an older SES/SAF-TE driver from [NASA](/source/NASA) from 2000 is still in place, which is not integrated with bio or [envsys](/source/envsys), but has its own [device file](/source/device_file)s with a unique [ioctl](/source/ioctl) interface, featuring its own custom SCSI-specific userland tooling;<ref name="nasa-ses/saf-te"/><ref name=nasa-sesd/> this older implementation was also available in OpenBSD between 2000 and 2005, and was removed 2005 (together with its userland tools) just before the new leaner bio- and hw.sensors-based alternative drivers were introduced; SES and SAF-TE are now kept as two separate drivers in OpenBSD, but don't require any separate custom userland utilities anymore, reducing the [code bloat](/source/code_bloat) and the number of [source lines of code](/source/source_lines_of_code).

== References ==
{{Reflist
|refs=

<ref name=bio.4>{{cite web
|url= http://bxr.su/o/share/man/man4/bio.4
|author1 = Niklas Hallqvist (2002)
|author2 = Marco Peereboom (2006)
|title = bio(4) — block I/O ioctl tunnel pseudo-device
|website= BSD Cross Reference
|publisher= [OpenBSD](/source/OpenBSD)
}}
*{{cite book |section=bio — block I/O ioctl tunnel pseudo-device |title=OpenBSD manual page server |url=http://man.openbsd.org/bio.4}}</ref>

<ref name=bioctl>{{cite web
|url= http://bxr.su/o/sbin/bioctl/bioctl.8
|author= Marco Peereboom
|title = bioctl(8) — RAID management interface
|website= BSD Cross Reference
|publisher= [OpenBSD](/source/OpenBSD)
|date= 2005
}}
*{{cite book |section=bioctl — RAID management interface |title=OpenBSD manual page server |url=http://man.openbsd.org/bioctl.8}}</ref>

<ref name=f-aac>{{cite web
|url= http://bxr.su/f/share/man/man4/aac.4
|title= aac(4) — Adaptec AdvancedRAID Controller driver
|website= BSD Cross Reference |publisher= [FreeBSD](/source/FreeBSD)
|author1= Scott Long |author2= Adaptec, Inc |author2-link= Adaptec |date= 2000
|quote= If the kernel is compiled with the COMPAT_LINUX option, or the aac_linux.ko and linux.ko modules are loaded,...
}}
*{{cite book |section=aac -- Adaptec AdvancedRAID Controller driver |title=FreeBSD Manual Pages |url=https://www.freebsd.org/cgi/man.cgi?query=aac&sektion=4}}</ref>

<ref name=f-aaccli>{{cite web
|url= http://freshbsd.org/commit/freebsd/ports/258698
|title= Remove expired aaccli
|website= FreshBSD
|publisher= [FreeBSD](/source/FreeBSD)
|archive-url= https://web.archive.org/web/20190326080439/http://freshbsd.org/commit/freebsd/ports/258698
|date= 2010-08-03
|archive-date= 2019-03-26
|url-status= bot: unknown
|access-date= 2019-03-26
}}</ref>

<ref name=mfiutil>{{cite web
|url= http://bxr.su/f/usr.sbin/mfiutil/
|title= mfiutil — Utility for managing LSI MegaRAID SAS controllers
|website= BSD Cross Reference |publisher= [FreeBSD](/source/FreeBSD) |date= 2009
}}
*{{cite book |section=mfiutil -- Utility for managing LSI MegaRAID SAS controllers |title=FreeBSD Manual Pages |url=https://www.freebsd.org/cgi/man.cgi?query=mfiutil&sektion=8}}</ref>

<ref name="mpsutil/mprutil">{{cite web
|url= http://bxr.su/f/usr.sbin/mpsutil/
|title= mpsutil, mprutil — Utility for managing LSI Fusion-MPT 2/3 controllers
|website= BSD Cross Reference |publisher= [FreeBSD](/source/FreeBSD) |date= 2015
}}
*{{cite book |section=mpsutil, mprutil -- Utility for managing LSI Fusion-MPT 2/3 controllers |title=FreeBSD Manual Pages |url=https://www.freebsd.org/cgi/man.cgi?query=mpsutil&sektion=8}}</ref>

<ref name=mptutil>{{cite web
|url= http://bxr.su/f/usr.sbin/mptutil/
|title= mptutil — Utility for managing LSI Fusion-MPT controllers
|website= BSD Cross Reference |publisher= [FreeBSD](/source/FreeBSD) |date= 2009
}}
*{{cite book |section=mptutil -- Utility for managing LSI Fusion-MPT controllers |title=FreeBSD Manual Pages |url=https://www.freebsd.org/cgi/man.cgi?query=mptutil&sektion=8}}</ref>

<ref name=sesutil>{{cite web
|url= http://bxr.su/f/usr.sbin/sesutil/
|title= sesutil — Utility for managing SCSI Enclosure Services (SES) device
|website= BSD Cross Reference |publisher= [FreeBSD](/source/FreeBSD) |date= 2015
}}
*{{cite book |section=sesutil -- Utility for managing SCSI Enclosure Services (SES) device |title=FreeBSD Manual Pages |url=https://www.freebsd.org/cgi/man.cgi?query=sesutil&sektion=8}}</ref>

<ref name="nasa-ses/saf-te">{{cite web
|url= http://bxr.su/n/sys/dev/scsipi/ses.c
|author2= National Aeronautics & Space Administration
|author2-link = NASA
|author1= Matthew Jacob
|title = dev/scsipi/ses.c — SCSI Environmental Services Driver
|website= BSD Cross Reference
|publisher= [NetBSD](/source/NetBSD)
|date= 2000
}}</ref>

<ref name=nasa-sesd>{{cite web
|url= http://bxr.su/n/usr.sbin/sesd/
|author1= Matthew Jacob
|title = sesd: sesd, getencstat, setencstat, setobjstat — monitor SCSI Environmental Services Devices
|website= BSD Cross Reference
|publisher= [NetBSD](/source/NetBSD)
|date= 2000
}}</ref>

<ref name=ses>{{cite web
|url= http://bxr.su/o/sys/scsi/ses.c
|author= David Gwynne
|title = /sys/scsi/ses.c — SCSI Enclosure Services
|website= BSD Cross Reference
|publisher= [OpenBSD](/source/OpenBSD)
|date= 2005
}}
*{{cite book |section=ses — SCSI Enclosure Services |title=OpenBSD manual page server |url=http://man.openbsd.org/ses.4}}</ref>

<ref name=safte>{{cite web
|url= http://bxr.su/o/sys/scsi/safte.c
|author= David Gwynne
|title = /sys/scsi/safte.c — SCSI Accessed Fault-Tolerant Enclosure
|website= BSD Cross Reference
|publisher= [OpenBSD](/source/OpenBSD)
|date= 2005
}}
*{{cite book |section=safte — SCSI Accessed Fault-Tolerant Enclosure |title=OpenBSD manual page server |url=http://man.openbsd.org/safte.4}}</ref>

<ref name=theo-misc-38>{{cite mailing list
|url= //marc.info/?l=openbsd-misc&m=112630095818062
|author = Theo de Raadt
|author-link = Theo de Raadt
|title= RAID management support coming in OpenBSD 3.8
|date= 2005-09-09
|mailing-list= misc@
|publisher = [OpenBSD](/source/OpenBSD)
}}</ref>

<ref name=o38>{{cite book
|url= http://www.openbsd.org/38.html
|title= OpenBSD 3.8
|publisher= [OpenBSD](/source/OpenBSD)
|isbn= 0-9731791-6-3
|date= 2005-11-01 |access-date= 2019-03-23
|quote= Hackers of the Lost RAID
}}</ref>

<ref name=lyrics-38>{{cite web
|url= http://www.openbsd.org/lyrics.html#38
|title= 3.8: "Hackers of the Lost RAID"
|work= OpenBSD Release Songs
|publisher= [OpenBSD](/source/OpenBSD)
|date= 2005-11-01 |access-date= 2019-03-23
}}</ref>

<!-- onlamp: -->

<ref name=onlamp-37>{{cite web
|url= http://www.onlamp.com/pub/a/bsd/2005/05/19/openbsd_3_7.html
|title=  OpenBSD 3.7: The Wizard of OS
|author= Federico Biancuzzi
|website= [ONLamp](/source/ONLamp) |publisher= [O'Reilly Media](/source/O'Reilly_Media)
|date= 2005-05-19 |access-date=2019-03-20
|archive-url= https://web.archive.org/web/20050521234307/http://www.onlamp.com/pub/a/bsd/2005/05/19/openbsd_3_7.html
|archive-date= 2005-05-21
}}</ref>

<ref name=onlamp-38>{{cite web
|url= http://www.onlamp.com/lpt/a/6270
|title=  OpenBSD 3.8: Hackers of the Lost RAID
|author= Federico Biancuzzi
|website= [ONLamp](/source/ONLamp) |publisher= [O'Reilly Media](/source/O'Reilly_Media)
|date= 2005-10-20 |access-date=2019-03-20
|archive-url= https://web.archive.org/web/20051227050708/http://www.onlamp.com/lpt/a/6270
|archive-date= 2005-12-27
}}</ref>

<ref name=onlamp-40>{{cite web
|url= http://www.oreillynet.com/lpt/a/6769
|title=  OpenBSD 4.0: Pufferix's Adventures
|author= Federico Biancuzzi
|website= [ONLamp](/source/ONLamp) |publisher= [O'Reilly Media](/source/O'Reilly_Media)
|date= 2006-10-26 |access-date=2019-03-19
|archive-url= https://web.archive.org/web/20070310145538/http://www.oreillynet.com/lpt/a/6769
|archive-date= 2007-03-10
}}</ref>

<ref name=onlamp-42>{{cite web
|url= http://onlamp.com/lpt/a/7155
|title=  Puffy's Marathon: What's New in OpenBSD 4.2
|author= Federico Biancuzzi
|website= [ONLamp](/source/ONLamp) |publisher= [O'Reilly Media](/source/O'Reilly_Media)
|date= 2007-11-01 |access-date=2019-03-03
|archive-url= https://web.archive.org/web/20111013021755/http://onlamp.com/lpt/a/7155
|archive-date= 2011-10-13
}}
*{{cite web |title=Puffy's Marathon: What's New in OpenBSD 4.2 - ONLamp.com |url=http://undeadly.org/cgi?action=article&sid=20071102080000 |website=Undeadly}}</ref>

<ref name=onlamp-45>{{cite web
|url= http://broadcast.oreilly.com/2009/06/openbsd-45.html
|title=  PuffyTron recommends OpenBSD 4.5
|author= Federico Biancuzzi
|publisher= [O'Reilly Media](/source/O'Reilly_Media)
|date= 2009-06-15 |access-date=2019-03-19
|archive-url= https://web.archive.org/web/20090619235238/http://broadcast.oreilly.com/2009/06/openbsd-45.html
|archive-date= 2009-06-19
}}</ref>

<!-- / onlamp -->

<!-- opencon06 -->

<ref name=opencon06>{{Cite conference
|author1= David Gwynne
|author2= Marco Peereboom
|date= 2006-12-03
|url= http://www.openbsd.org/papers/opencon06-bio.pdf
|title= bio and sensors in OpenBSD
|conference-url= https://web.archive.org/web/20070109032258/http://www.opencon.org/program.php
|conference= OpenCON 2006, 2–3 December 2006
|location= Courtyard Venice Airport, Venice/Tessera, Italy
|access-date= 2019-03-04
}}</ref>

<ref name=opencon06-drivers-f>{{Cite conference
|author= Jonathan Gray |date= 2006-12-02
|section-url= http://www.openbsd.org/papers/opencon06-drivers/mgp00026.html
|section= Page 26: Only open for business: FreeBSD
|url= http://www.openbsd.org/papers/opencon06-drivers/index.html
|title= Driver Architecture and Implementation in OpenBSD
|conference-url= https://web.archive.org/web/20070109032258/http://www.opencon.org/program.php
|conference= OpenCON 2006, 2–3 December 2006
|location= Courtyard Venice Airport, Venice/Tessera, Italy
|access-date= 2019-03-27
|quote= drivers designed for binary only Linux RAID management tools
}}</ref>

<ref name=opencon06-docs-drive>{{cite conference
|author= Theo de Raadt |date= 2016-12-03
|section-url= http://www.openbsd.org/papers/opencon06-docs/mgp00010.html
|section= Page 10: The hardware: drive controllers
|url= http://www.openbsd.org/papers/opencon06-docs/
|title= Open Documentation for Hardware
|conference-url= https://web.archive.org/web/20070109032258/http://www.opencon.org/program.php
|conference= OpenCON 2006, 2–3 December 2006
|location= Courtyard Venice Airport, Venice/Tessera, Italy
|access-date= 2019-03-27
|quote= RAID management is almost completely undocumented
|author-link= Theo de Raadt
}}</ref>

<!-- / opencon06 -->

<ref name=sensors-mmath>{{cite thesis
|degree= [MMath](/source/Master_of_Mathematics)
|author= Constantine A. Murenin |date= 2010-05-21
|section= 1.1. Motivation; 4. Sensor Drivers; 7.1. NetBSD envsys / sysmon
|title= OpenBSD Hardware Sensors — Environmental Monitoring and Fan Control.
|location= [University of Waterloo](/source/University_of_Waterloo) |publisher= UWSpace
|url = http://cnst.su/MMathCS |hdl = 10012/5234
|id = Document ID: ab71498b6b1a60ff817b29d56997a418.
}}</ref>

}}

{{OpenBSD |state=expanded}}
{{NetBSD}}
{{RAID}}
{{Portal bar|Free and open-source software}}

Category:2005 software
Category:2007 software
Category:BSD software
Category:Computer data storage
Category:Computer hardware tuning
Category:Computer performance
Category:Free software programmed in C
Category:Free system software
Category:Motherboard
Category:NetBSD
Category:OpenBSD
Category:RAID
Category:SCSI
Category:Storage software
Category:System administration
Category:System monitors
Category:Volume manager
Category:Software using the BSD license

---
Adapted from the Wikipedia article [Bioctl](https://en.wikipedia.org/wiki/Bioctl) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Bioctl?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
