nbdinfo(1) LIBNBD nbdinfo(1) (NAME) nbdinfo - NBD (SYNOPSIS) nbdinfo [--json] NBD "NBD" URI NBD (subprocess) : NBD := nbd://... | nbd+unix:// (or other URI formats) | [ CMD ARGS ... ] nbdinfo --size [--json] NBD nbdinfo --uri [--json] NBD nbdinfo --is read-only|rotational NBD nbdinfo --isnt read-only|rotational NBD nbdinfo --can cache|connect|... NBD nbdinfo --cannot cache|connect|... NBD nbdinfo --map [--totals] [--json] NBD nbdinfo -L|--list [--json] NBD nbdinfo --help nbdinfo --version (DESCRIPTION) nbdinfo NBD . URI NBD (: https://github.com/NetworkBlockDevice/nbd/blob/master/doc/uri.md): $ nbdinfo nbd://localhost protocol: newstyle-fixed without TLS, using structured packets export="": export-size: 1048576 (1M) content: data uri: nbd://localhost:10809/ is_rotational: false is_read_only: false can_cache: true can_df: true can_fast_zero: true can_flush: true can_fua: true can_multi_conn: true can_trim: true can_zero: true block_size_minimum: 1 block_size_preferred: 4096 (4K) block_size_maximum: 33554432 (32M) NBD (Unix domain socket) ( ): $ nbdinfo "nbd+unix:///?socket=/tmp/unixsock" NBD ( "" ): $ nbdinfo -- [ qemu-nbd -r -f qcow2 file.qcow2 ] JSON (JSON output) JSON ( jq(1)) --json : $ nbdinfo --json nbd://localhost | jq . { "protocol": "newstyle-fixed", "TLS": false, "structured": true, "extended": false, "exports": [ { "export-name": "", "content": "DOS/MBR boot sector; partition 1 : ID=0xc, start-CHS (0x3ff,254,63), end-CHS (0x3ff,254,63), startsector 2048, 4148704 sectors", "uri": "nbd://localhost:10809/", "is_rotational": false, "is_read_only": true, "can_cache": true, "can_df": true, "can_fast_zero": false, "can_flush": false, "can_fua": false, "can_multi_conn": true, "can_trim": false, "can_zero": false, "block_size_minimum": 1, "block_size_preferred": 4096, "block_size_maximum": 33554432, "export-size": 2125119488, "export-size-str": "2075312K" } ] } (Size) NBD ( ) --size : $ nbdinfo --size nbd://localhost 1048576 $ nbdinfo --size [ nbdkit null 1M ] 1048576 URI (URI) (canonical URI): $ nbdinfo --uri nbd://localhost nbd://localhost:10809/ (Test for flags) --can --is --has NBD . ( 0) ( 2) . ( ). --cannot --isnt --hasnt () . : if nbdinfo --is read-only nbd://localhost || nbdinfo --cannot trim nbd://localhost then error "the device must support writing and trimming" fi nbdinfo --is read-only URI (read-only) . nbdinfo --can write URI --is read-only . nbdinfo --can read URI NBD ( URI ). nbdinfo --can connect URI URI NBD. (handshake) NBD NBD . nbdinfo --is tls URI URI NBD TLS . nbdinfo --has structured-reply URI (structured replies ). nbdinfo --has extended-headers URI (extended headers ). nbdinfo --is rotational URI (rotational) : . . nbdinfo --can block-status-payload URI . nbdinfo --can cache URI nbdinfo --can df URI nbdinfo --can fast-zero URI nbdinfo --can flush URI nbdinfo --can fua URI nbdinfo --can multi-conn URI nbdinfo --can trim URI nbdinfo --can zero URI NBD. --can --is --has --cannot --isnt --hasnt . (Map) (allocated) (sparse) --map : $ nbdinfo --map nbd://localhost/ 0 1048576 0 data 1048576 1048576 3 hole,zero : (start) (size) (type) (description ). NBD . nbdinfo . JSON --json : $ nbdinfo --map --json nbd://localhost/ [{ "offset": 0, "length": 1048576, "type": 0, "description": "data" }, { "offset": 1048576, "length": 1048576, "type": 3, "description": "hole,zero" }] "base:allocation" : $ nbdinfo --map=qemu:dirty-bitmap:bitmap nbd://localhost/ 0 1048576 1 dirty NBD Metadata querying NBD . (Map totals) --map --totals --map ( ) . nbdcopy(1) . (50.0%) : $ nbdinfo --map --totals nbd://localhost/ 1048576 50.0% 0 data 1048576 50.0% 3 hole,zero : (). --json : $ nbdinfo --map --totals --json nbd://localhost/ [{ "size": 1048576, "percent": 50, "type": 0, "description": "data" }, { "size": 1048576, "percent": 50, "type": 3, "description": "hole,zero" }] --map "base:allocation" . (List all exports) NBD --list (-L) . JSON --json . : $ nbdkit file dir=. --run 'nbdinfo --list "$uri"' protocol: newstyle-fixed without TLS export="Fedora-Workstation-Live-x86_64-29-1.2.iso": export-size: 1931476992 (1842M) uri: nbd://localhost:10809/Fedora-Workstation-Live-x86_64-29-1.2.iso [...] export="debian-10.4.0-amd64-DVD-1.iso": export-size: 3955556352 (3862848K) uri: nbd://localhost:10809/debian-10.4.0-amd64-DVD-1.iso [...] (Subprocess) nbdinfo NBD . NBD systemd qemu-nbd(8) nbdkit(1). nbdinfo . qcow2: nbdinfo -- [ qemu-nbd -r -f qcow2 file.qcow2 ] nbdinfo --map -- [ qemu-nbd -r -f qcow2 file.qcow2 ] "[ ... ]" . "--" nbdinfo . (Alternative tools) "qemu-img info" (: qemu-img(1)) NBD . "qemu-nbd -L" (: qemu-nbd(8)) NBD . nbdsh(1) libnbd(3) . (OPTIONS) --help . --can block-status-payload --can cache --can connect --can df --can fast-zero --can flush --can fua --can multi-conn --can read --can trim --can write --can zero NBD. ( 0) ( 2) . ( ). NBD libnbd : nbd_can_block_status_payload(3), nbd_can_cache(3), nbd_can_df(3), nbd_can_fast_zero(3), nbd_can_flush(3), nbd_can_fua(3), nbd_can_multi_conn(3), nbd_can_trim(3), nbd_can_zero(3), nbd_is_read_only(3). --cannot flag . --color --colour --no-color --no-colour ANSI . . --content --no-content NBD (handshake) . nbdinfo file(1) . --list --content . --no-content . --list --no-content ( ). --list --content . --has extended-headers --has structured-reply NBD. ( 0) ( 2) . ( ). NBD libnbd : nbd_get_extended_headers_negotiated(3), nbd_get_structured_replies_negotiated(3). --hasnt flag . --is read-only --is rotational --is tls NBD TLS . ( 0) ( 2) . ( ). NBD libnbd : nbd_is_read_only(3), nbd_is_rotational(3), nbd_get_tls_negotiated(3). --isnt flag . --json JSON . -L --list NBD. URI . --map --map=MAP ( ) . "base:allocation" . "" . --map --totals --map=MAP --totals --map . " " . --size . --uri URI (canonical) . --json JSON . -V --version . (SEE ALSO) libnbd(3), nbdcopy(1), nbddiscard(1), nbddump(1), nbdfuse(1), nbdsh(1), nbdublk(1), nbdzero(1), file(1), jq(1), qemu-img(1), qemu-nbd(8). (AUTHORS) Richard W.M. Jones Eric Blake (COPYRIGHT) Copyright Red Hat (LICENSE) (LGPL) ( ) . . . : Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA libnbd-1.24.3 2026-07-16 nbdinfo(1)