Skip to content
EntityQ1684595· pop 7· linked from 18 articles

网络块设备

Sign in to save

Also known as NBD

network storage protocol

Source code

The Network Block Device (NBD) is a protocol, originally implemented for Linux but that now has a number of implementations that lets a computer access a remote storage device (like a hard drive or partition) as if it were a local, physical disk, using a simple client-server model over a TCP/IP network. This allows remote booting, swapping, or filesystem access without complex network file systems like NFS. It works by exporting a block device from a server and presenting it as a local block device on a client machine, allowing standard block-level operations (read/write) over the network. To install the package, download the source and do the normal configure / make / make install dance. You'll need to install it on both the client and the server. NBD is quite easy to use. First, on the client, you need to load the module and, if you're not using udev, to create the device nodes: (if you need more than one NBD device, repeat the above command for nbd1, nbd2, ...) Next, write a configuration file for the server. An example looks like this: Note that the filename must be an absolute path; i.e., something like /path/to/file , not ../file . See the nbd-server manpage for details on any available options. nbd-client must be ran as root; the same is not true for nbd-server (but do make sure that /var/run is writeable by the server that nbd-server runs as; otherwise, you won't get a PID file, though the server will keep running). There are packages (or similar) available for most current operating systems; see the "Packaging status" badge below for details. Besides this project, the NBD protocol has been implemented by various other people. A (probably incomplete) list follows: nbdkit is a multithreaded NBD server with a plugin architecture. libnbd is a library to aid in writing NBD clients qemu contains an embedded NBD server, an embedded NBD client, and a standalone NBD server ( qemu-nbd ). They maintain a status document of their NBD implementation. A GEOM gate-based client implementation for FreeBSD exists. It has not seen any updates since 2018, and only implements the client side (any server should run on FreeBSD unmodified, however). A Windows client implementation exists as part of the RBD implementation of Ceph for Windows. lwNBD is a NBD server library, targetting bare metal or OS embedded system. It has a plugin architecture. xnbd: This was an NBD implementation with a few extra protocol messages that allowed for live migration. Its code repository has disappeared. enbd: This was an NBD implementation with a few extra protocol messages that allowed extra ioctl calls to be passed on (e.g., the "eject" message for a CD-ROM device that was being exported through NBD). It appears to no longer be maintained. Hurd translator: There was a proof-of-concept implementation of the NBD protocol once as a translator for The Hurd. We do not know what its current status is. Christoph Lohmann once wrote a client implementation for Plan 9. The link he provided us is now stale; we do not know what its current status is.

Excerpt from the source-code README · 6,688 chars · not written by Vinony

Wikidata facts

Instance of
software
Subclass of
device file
Official website
nbd.sourceforge.io
Image
NetworkBlockDevice DeviceList HandshakeProtocolHexdump.png
Show 4 more facts
source code repository URL
git.code.sf.net/p/nbd/code
software version identifier
3.27.1
Sources (4)

via Wikidata · CC0

Article · 中文

在一些操作系统上,网络块设备(Network Block Device, NBD)是一种,其内容由远程计算机提供。网络块设备通常用于访问非物理安装于本地计算机上,而在远程的存储设备。例如,本地计算机可访问连接于另一台计算机上的硬盘。 技术上讲,网络块设备由三部分组成,服务器、客户端及连接之间的网络。在设备节点工作的客户端上,内核驱动/模块控制该设备。每当程序试图访问该设备时,内核驱动将转发请求(如果内核中没有完全实现客户端部分,可在使用者空間程序的帮助下完成)到实际存储数据的服务器。在服务器上,来自客户端的请求由用户空间程序进行处理。 服务器端通常为运行在通用计算机上的用户空间程序。服务器的所有功能都可由用户空间程序处理,因为服务器只需通过正常的套接字与客户端的通信,使用常规的文件系统接口访问存储设备。 网络块设备客户端模块适用于一些类Unix系统,包括Linux和。由于服务器是一个用户空间程序,理论上任何类Unix平台都能运行。例如,NBD的服务器部分已经移植到了Solaris上。

Abstract from DBpedia / Wikipedia · CC BY-SA

Available in 7 languages

via Wikidata sitelinks · CC0