GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
* Sign Up! *

Support
Customer Portal
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
GNBD(8) FreeBSD System Manager's Manual GNBD(8)

gnbdcontrol utility for the network block device GEOM class

To load the GEOM_NBD module at boot time, add the following line to your loader.conf(5):

geom_nbd_load="YES"

Usage of the gnbd utility:


gnbd connect [-c num] [-n name] [-p port] host

gnbd connect [-c num] [-n name] [-p port] [-A cacert] -C cert -K key host

gnbd reconnect [-r seconds] host

gnbd reconnect [-r seconds] [-A cacert] -C cert -K key prov

gnbd scale -c num prov

gnbd scale -c num [-A cacert] -C cert -K key prov

gnbd disconnect prov

gnbd exports [-p port] host

gnbd exports [-p port] [-A cacert] -C cert -K key host

gnbd help

gnbd list [-a] [prov ...]

gnbd status [-ags] [prov ...]

gnbd load [-v]

gnbd unload [-v]

The gnbd utility is used to configure network block device (NBD) GEOM providers.

The following is a list of the most important features:

  • Established connections are handed off to the kernel, allowing reroot onto the network-backed devices.
  • Supports using multiple connections to the NBD server to parallelize commands.
  • Supports optional TLS encryption using ktls(4).
  • Zero copies are performed for writes where possible. Work is needed to support cxgbe(4) TCP-offload module DDP for zero-copy reads.

The first argument to gnbd indicates an action to be performed:

Connect to an NBD server.
connections
Use this many parallel connections. One connection is used if not specified.
name
Connect to the named export. The default export is requested if not specified.
cacert
Verify TLS certificates against the PEM-formatted CA certificate at the given path. The system root CAs are used if not specified.
cert
Make a TLS connection using the PEM-formatted client certificate at the given path.
key
Make a TLS connection using the PEM-formatted client key at the given path.

To make TLS connections, both a certificate and key must be given.

The path of a UNIX-domain socket may be specified in place of a host. UNIX-domain sockets are not expected to perform well or be useful with TLS.

Re-establish failed connections.
seconds
Retry until connections are re-established, waiting this many seconds between successive retries. This is useful for a devd action in response to the GEOM NBD DISCONNECTED event.

When all connections for a device have failed, the provider will persist and can resume normal operation when new connections are established. The number of connections set by connect or scale is restored.

Scale the number of connections for an existing device up or down.
connections
Use this many parallel connections.
cacert
Verify TLS certificates against the PEM-formatted CA certificate at the given path. The system root CAs are used if not specified.
cert
Make a TLS connection using the PEM-formatted client certificate at the given path.
key
Make a TLS connection using the PEM-formatted client key at the given path.

To make TLS connections, both a certificate and key must be given.

Disconnect and remove the given provider.
List exports of an NBD server.
See geom(8).
See geom(8).
See geom(8).
See geom(8).

All TLS certificates and keys must be in PEM format. TLS certificates may be a certificate chain to include intermediary certificates in the chain of trust.

The following sysctl(8) tunables can be used to control the behavior of the NBD GEOM class. The default value is shown next to each variable.

kern.geom.nbd.debug: 0
Debug level of the NBD GEOM class. This can be set to a number between 0 and 3 inclusive. If set to 0, minimal debug information is printed. If set to 3, the maximum amount of debug information is printed.
kern.geom.nbd.maxpayload: 33554432 (32 MiB)
Upper limit on the size in bytes of a single transfer over the network.
kern.geom.nbd.sendspace: 1572864 (1536 kiB)
Size of socket send buffer reservation per connection.

Note: connections may also be limited by standard socket buffer limits.

kern.geom.nbd.recvspace: 1572864 (1536 kiB)
Size of socket receive buffer reservation per connection.

Note: connections may also be limited by standard socket buffer limits.

kern.geom.nbd.identfmt: 0
Format of the GEOM::ident attribute.

Setting to 0 uses the format "host:port/name". Setting to 1 uses "name" if the export has a name, falling back to "host:port/name" when the name is empty (default export). Setting to 2 always uses "name", even if the name is empty.

Formats 1 and 2 can be useful when the export names are serial numbers.

Exit status is 0 on success, and 1 if the command fails.

Connect to an NBD server with 4 connections:

# gnbd connect -c 4 servername
nbd0

Connect to an NBD server using TLS with an internal CA and 2 connections:

# gnbd connect -c 2 -A cacert.pem -C cert.pem -K key.pem servername
nbd1

Scale the second provider up to 8 connections:

# gnbd scale -c 8 -A cacert.pem -C cert.pem -K key.pem nbd1

Disconnect the previous examples:

# gnbd disconnect nbd0
# gnbd disconnect nbd1

Ryan Moeller

June 6, 2025 FreeBSD 15.1-RELEASE-p1

Search for    or go to Top of page |  Section 8 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.