.\" Copyright (c) 2012-2021 The DragonFly Project. All rights reserved. .\" .\" This code is derived from software contributed to The DragonFly Project .\" by Matthew Dillon .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in .\" the documentation and/or other materials provided with the .\" distribution. .\" 3. Neither the name of The DragonFly Project nor the names of its .\" contributors may be used to endorse or promote products derived .\" from this software without specific, prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT .\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS .\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE .\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, .\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED .\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .Dd October 30, 2021 .Dt XDISK 4 .Os .Sh NAME .Nm xdisk .Nd Remote disk block device dmsg service .Sh SYNOPSIS To compile this driver into the kernel, place the following line in your kernel configuration file: .Bd -ragged -offset indent .Cd "device xdisk" .Ed .Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent xdisk_load="YES" .Ed .Pp Note that .Dx does not compile this driver into the kernel by default. .Pp Since the userland hammer2 service daemon must be running, you cannot use xdisk block devices as boot devices. .Sh DESCRIPTION The .Nm driver exports local block devices and imports remote block devices. The devices show up under .Pa /dev/xa* , .Pa /dev/serno , .Pa /dev/by-label , and .Pa /dev/*-by-uuid . It is recommended that all drive references go via .Pa /dev/serno , .Pa /dev/by-label , or .Pa /dev/*-by-uuid . The .Pa /dev/xa* paths can change at a whim depending on the order of operations. .Pp If a device goes away or the connection is lost, the device entry remains until the ref-count drops to 0. Any active I/O will hard-block. Resumption of the connection resumes operations where they left off. No I/O requests are lost. The driver is robust across reconnection, crashes, and reboots, but possibly not across power failures if the target drive loses buffered write data for completed I/Os. .Pp Over a 1Gbe network, synchronous D1 latency still allows for around 30-40 MBytes/sec. Filesystem mounts can usually max-out the line rate (in excess of 100 MBytes/sec) due to filesystem read-ahead and write buffering. .Pp The .Xr hammer2 8 service daemon is used as an intermediary and must be running on all machines in question. .Sh SEE ALSO .Xr ahci 4 , .Xr nvme 4 , .Xr hammer2 8 .Sh HISTORY The .Nm driver has been in the source tree a while but is now automatically built and part of base as of .Dx 6.1 . .Sh AUTHORS .An -nosplit The .Nm driver was written by .An Matthew Dillon Aq Mt dillon@backplane.com