unbound-control

package: unbound-control

title: unbound-control(8)

text:
# unbound-control(8)

## NAME
unbound-control - Unbound 1.25.1 remote server control utility.

## SYNOPSIS
unbound-control [-hq] [-c cfgfile] [-s server] command

## DESCRIPTION
unbound-control performs remote administration on the unbound(8) DNS server. It reads the configuration file, contacts the Unbound server over TLS sends the command and displays the result.

The available options are:

-h

Show the version and commandline option help.

-c <cfgfile>

The config file to read with settings. If not given the default config file /var/lib/unbound/unbound.conf is used.

-s <server[@port]>

IPv4 or IPv6 address of the server to contact. If not given, the address is read from the config file.

-q

Quiet, if the option is given it does not print anything if it works ok.

## COMMANDS
There are several commands that the server understands.

start

Start the server. Simply execs unbound(8). The unbound executable is searched for in the PATH set in the environment. It is started with the config file specified using -c or the default config file.

stop

Stop the server. The server daemon exits.

reload

Reload the server. This flushes the cache and reads the config file fresh.

reload_keep_cache

Reload the server but try to keep the RRset and message cache if (re)configuration allows for it. That means the caches sizes and the number of threads must not change between reloads.

fast_reload [+dpv]

Reload the server, but keep downtime to a minimum, so that user queries keep seeing service. This needs the code compiled with threads. The config is loaded in a thread, and prepared, then it briefly pauses the existing server and updates config options. The intent is that the pause does not impact the service of user queries. The cache is kept. Also user queries worked on are kept and continue, but with the new config options. NOTE:

This command is experimental at this time.

The amount of temporal memory needed during a fast_reload is twice the amount needed for configuration. This is because Unbound temporarily needs to store both current configuration values and new ones while trying to fast_reload. Zones loaded from disk (authority zones and RPZ zones) are included in such memory needs.

Options that can be changed are for forwards, stubs, views, authority zones, RPZ zones and local zones.

Also access-control and similar options, interface-action and similar options and tcp-connection-limit. It can reload some define-tag changes, more on that below. Further options include insecure-lan-zones, domain-insecure, trust-anchor-file, trust-anchor, trusted-keys-file, auto-trust-anchor-file, edns-client-string, ipset, log-identity, infra-cache-numhosts, msg-cache-size, rrset-cache-size, key-cache-size, ratelimit-size, neg-cache-size, num-queries-per-thread, jostle-timeout, use-caps-for-id, unwanted-reply-threshold, tls-use-sni, outgoing-tcp-mss, ip-dscp, max-reuse-tcp-queries, tcp-reuse-timeout, tcp-auth-query-timeout, delay-close. iter-scrub-promiscuous. tls-service-key. tls-service-pem.

It does not work with interface and outgoing-interface changes, also not with remote control, outgoing-port-permit, outgoing-port-avoid, msg-buffer-size, any *-slabs options and statistics-interval changes.

For dnstap these options can be changed: dnstap-log-resolver-query-messages, dnstap-log-resolver-response-messages, dnstap-log-client-query-messages, dnstap-log-client-response-messages, dnstap-log-forwarder-query-messages and dnstap-log-forwarder-response-messages.

It does not work with these options: dnstap-enable, dnstap-bidirectional, dnstap-socket-path, dnstap-ip, dnstap-tls, dnstap-tls-server-name, dnstap-tls-cert-bundle, dnstap-tls-client-key-file and dnstap-tls-client-cert-file.

The options dnstap-send-identity, dnstap-send-version, dnstap-identity, and dnstap-version can be loaded when +p is not used.

The +v option makes the output verbose which includes the time it took to do the reload. With +vv it is more verbose which includes the amount of memory that was allocated temporarily to perform the reload; this amount of memory can be big if the config has large contents. In the timing output the 'reload' time is the time during which the server was paused.

The +p option makes the reload not pause threads, they keep running. Locks are acquired, but items are updated in sequence, so it is possible for threads to see an inconsistent state with some options from the old and some options from the new config, such as cache TTL parameters from the old config and forwards from the new config. The stubs and forwards are updated at the same time, so that they are viewed consistently, either old or new values together. The option makes the reload time take eg. 3 microseconds instead of 0.3 milliseconds during which the worker threads are interrupted. So, the interruption is much shorter, at the expense of some inconsistency. After the reload itself, every worker thread is briefly contacted to make them release resources, this makes the delete timing a little longer, and takes up time from the remote control servicing worker thread.

With the nopause option (+p), the reload does not work to reload some options, that fast reload works on without the nopause option: val-bogus-ttl, val-override-date, val-sig-skew-min, val-sig-skew-max, val-max-restart, val-nsec3-keysize-iterations, target-fetch-policy, outbound-msg-retry, max-sent-count, max-query-restarts, do-not-query-address, do-not-query-localhost, private-address, private-domain, caps-exempt, nat64-prefix, do-nat64, infra-host-ttl, infra-keep-probing, ratelimit, ip-ratelimit, ip-ratelimit-cookie, wait-limit-netblock, wait-limit-cookie-netblock, ratelimit-below-domain, ratelimit-for-domain.

The +d option makes the reload drop queries that the worker threads are working on. This is like flush_requestlist. Without it the queries are kept so that users keep getting answers for those queries that are currently processed. The drop makes it so that queries during the life time of the query processing see only old, or only new config options.

When there are changes to the config tags, from the define-tag option, then the +d option is implicitly turned on with a warning printout, and queries are dropped. This is to stop references to the old tag information, by the old queries. If the number of tags is increased in the newly loaded config, by adding tags at the end, then the implicit +d option is not needed.

For response ip, that is actions associated with IP addresses, and perhaps intersected with access control tag and action information, those settings are stored with a query when it comes in based on its source IP address. The old information is kept with the query until the queries are done. This is gone when those queries are resolved and finished, or it is possible to flush the requestlist with +d.

verbosity number

Change verbosity value for logging. Same values as the verbosity: keyword in unbound.conf(5). This new setting lasts until the server is issued a reload (taken from config file again), or the next verbosity control command.

log_reopen

Reopen the logfile, close and open it. Useful for logrotation to make the daemon release the file it is logging to. If you are using syslog it will attempt to close and open the syslog (which may not work if chrooted).

stats

Print statistics. Resets the internal counters to zero, this can be controlled using the statistics-cumulative: config statement. Statistics are printed with one [name]: [value] per line.

stats_noreset

Peek at statistics. Prints them like the stats command does, but does not reset the internal counters to zero.

status

Display server status. Exit code 3 if not running (the connection to the port is refused), 1 on error, 0 if running.

local_zone name type

Add new local zone with name and type. Like local-zone config statement. If the zone already exists, the type is changed to the given argument.

local_zone_remove name

Remove the local zone with the given name. Removes all local data inside it. If the zone does not exist, the command succeeds.

local_data RR data...

Add new local data, the given resource record. Like local-data: keyword, except for when no covering zone exists. In that case this remote control command creates a transparent zone with the same name as this record.

local_data_remove name

Remove all RR data from local name. If the name already has no items, nothing happens. Often results in NXDOMAIN for the name (in a static zone), but if the name has become an empty nonterminal (there is still data in domain names below the removed name), NOERROR nodata answers are the result for that name.

local_zones

Add local zones read from stdin of unbound-control. Input is read per line, with name space type on a line. For bulk additions.

local_zones_remove

Remove local zones read from stdin of unbound-control. Input is one name per line. For bulk removals.

local_datas

Add local data RRs read from stdin of unbound-control. Input is one RR per line. For bulk additions.

local_datas_remove

Remove local data RRs read from stdin of unbound-control. Input is one name per line. For bulk removals.

dump_cache

The contents of the cache is printed in a text format to stdout. You can redirect it to a file to store the cache in a file. Not supported in remote Unbounds in multi-process operation.

load_cache

The contents of the cache is loaded from stdin. Uses the same format as dump_cache uses. Loading the cache with old, or wrong data can result in old or wrong data returned to clients. Loading data into the cache in this way is supported in order to aid with debugging. Not supported in remote Unbounds in multi-process operation.

cache_lookup [+t] names

Print to stdout the RRsets and messages that are in the cache. For every name listed the content at or under the name is printed. Several names separated by spaces can be given, each is printed. When subnetcache is enabled, also matching entries from the subnet cache are printed. The +t option allows tld and root names. With it names like 'com' and '.' can be used, but it takes a lot of effort to look up in the cache.

lookup name

Print to stdout the name servers that would be used to look up the name specified.

flush [+c] name

Remove the name from the cache. Removes the types A, AAAA, NS, SOA, CNAME, DNAME, MX, PTR, SRV, NAPTR, SVCB and HTTPS. Because that is fast to do. Other record types can be removed using flush_type or flush_zone. The +c option removes the items also from the cachedb cache. If cachedb is in use.

flush_type [+c] name type

Remove the name, type information from the cache. The +c option removes the items also from the cachedb cache. If cachedb is in use.

flush_zone [+c] name

Remove all information at or below the name from the cache. The rrsets and key entries are removed so that new lookups will be performed. This needs to walk and inspect the entire cache, and is a slow operation. The entries are set to expired in the implementation of this command (so, with serve-expired enabled, it'll serve that information but schedule a prefetch for new information). The +c option removes the items also from the cachedb cache. If cachedb is in use.

flush_bogus [+c]

Remove all bogus data from the cache. The +c option removes the items also from the cachedb cache. If cachedb is in use.

flush_negative [+c]

Remove all negative data from the cache. This is nxdomain answers, nodata answers and servfail answers. Also removes bad key entries (which could be due to failed lookups) from the dnssec key cache, and iterator last-resort lookup failures from the rrset cache. The +c option removes the items also from the cachedb cache. If cachedb is in use.

flush_stats

Reset statistics to zero.

flush_requestlist

Drop the queries that are worked on. Stops working on the queries that the server is working on now. The cache is unaffected. No reply is sent for those queries, probably making those users request again later. Useful to make the server restart working on queries with new settings, such as a higher verbosity level.

dump_requestlist

Show what is worked on. Prints all queries that the server is currently working on. Prints the time that users have been waiting. For internal requests, no time is printed. And then prints out the module status. This prints the queries from the first thread, and not queries that are being serviced from other threads.

flush_infra all|IP

If all then entire infra cache is emptied. If a specific IP address, the entry for that address is removed from the cache. It contains EDNS, ping and lameness data.

dump_infra

Show the contents of the infra cache.

set_option opt: val

Set the option to the given value without a reload. The cache is therefore not flushed. The option must end with a ':' and whitespace must be between the option and the value. Some values may not have an effect if set this way, the new values are not written to the config file, not all options are supported. This is different from the set_option call in libunbound, where all values work because Unbound has not been initialized. The values that work are: statistics-interval, statistics-cumulative, do-not-query-localhost, harden-short-bufsize, harden-large-queries, harden-glue, harden-dnssec-stripped, harden-below-nxdomain, harden-referral-path, prefetch, prefetch-key, log-queries, hide-identity, hide-version, identity, version, val-log-level, val-log-squelch, ignore-cd-flag, add-holddown, del-holddown, keep-missing, tcp-upstream, ssl-upstream, max-udp-size, ratelimit, ip-ratelimit, cache-max-ttl, cache-min-ttl, cache-max-negative-ttl.

get_option opt

Get the value of the option. Give the option name without a trailing ':'. The value is printed. If the value is "", nothing is printed and the connection closes. On error 'error ...' is printed (it gives a syntax error on unknown option). For some options a list of values, one on each line, is printed. The options are shown from the config file as modified with set_option. For some options an override may have been taken that does not show up with this command, not results from e.g. the verbosity and forward control commands. Not all options work, see list_stubs, list_forwards, list_local_zones and list_local_data for those.

list_stubs

List the stub zones in use. These are printed one by one to the output. This includes the root hints in use.

list_forwards

List the forward zones in use. These are printed zone by zone to the output.

list_insecure

List the zones with domain-insecure.

list_local_zones

List the local zones in use. These are printed one per line with zone type.

list_local_data

List the local data RRs in use. The resource records are printed.

insecure_add zone

Add a domain-insecure for the given zone, like the statement in unbound.conf. Adds to the running Unbound without affecting the cache contents (which may still be bogus, use flush_zone to remove it), does not affect the config file.

insecure_remove zone

Removes domain-insecure for the given zone.

forward_add [+it] zone addr ...

Add a new forward zone to running Unbound. With +i option also adds a domain-insecure for the zone (so it can resolve insecurely if you have a DNSSEC root trust anchor configured for other names). The addr can be IP4, IP6 or nameserver names, like forward-zone config in unbound.conf. The +t option sets it to use TLS upstream, like forward-tls-upstream: yes.

forward_remove [+i] zone

Remove a forward zone from running Unbound. The +i also removes a domain-insecure for the zone.

stub_add [+ipt] zone addr ...

Add a new stub zone to running Unbound. With +i option also adds a domain-insecure for the zone. With +p the stub zone is set to prime, without it it is set to notprime. The addr can be IP4, IP6 or nameserver names, like the stub-zone: config in unbound.conf. The +t option sets it to use TLS upstream, like stub-tls-upstream: yes.

stub_remove [+i] zone

Remove a stub zone from running Unbound. The +i also removes a domain-insecure for the zone.

forward [off | addr ... ]

Setup forwarding mode. Configures if the server should ask other upstream nameservers, should go to the internet root nameservers itself, or show the current config. You could pass the nameservers after a DHCP update. Without arguments the current list of addresses used to forward all queries to is printed. On startup this is from the forward-zone "." configuration. Afterwards it shows the status. It prints off when no forwarding is used.

If off is passed, forwarding is disabled and the root nameservers are used. This can be used to avoid to avoid buggy or non-DNSSEC supporting nameservers returned from DHCP. But may not work in hotels or hotspots.

If one or more IPv4 or IPv6 addresses are given, those are then used to forward queries to. The addresses must be separated with spaces. With '@port' the port number can be set explicitly (default port is 53 (DNS)).

By default the forwarder information from the config file for the root "." is used. The config file is not changed, so after a reload these changes are gone. Other forward zones from the config file are not affected by this command.

ratelimit_list [+a]

List the domains that are ratelimited. Printed one per line with current estimated qps and qps limit from config. With +a it prints all domains, not just the ratelimited domains, with their estimated qps. The ratelimited domains return an error for uncached (new) queries, but cached queries work as normal.

ip_ratelimit_list [+a]

List the ip addresses that are ratelimited. Printed one per line with current estimated qps and qps limit from config. With +a it prints all ips, not just the ratelimited ips, with their estimated qps. The ratelimited ips are dropped before checking the cache.

list_auth_zones

List the auth zones that are configured. Printed one per line with a status, indicating if the zone is expired and current serial number. Configured RPZ zones are included.

auth_zone_reload zone

Reload the auth zone (or RPZ zone) from zonefile. The zonefile is read in overwriting the current contents of the zone in memory. This changes the auth zone contents itself, not the cache contents. Such cache contents exists if you set Unbound to validate with for-upstream: yes and that can be cleared with flush_zone zone.

auth_zone_transfer zone

Transfer the auth zone (or RPZ zone) from master. The auth zone probe sequence is started, where the masters are probed to see if they have an updated zone (with the SOA serial check). And then the zone is transferred for a newer zone version.

rpz_enable zone

Enable the RPZ zone if it had previously been disabled.

rpz_disable zone

Disable the RPZ zone.

view_list_local_zones view

list_local_zones for given view.

view_local_zone view name type

local_zone for given view.

view_local_zone_remove view name

local_zone_remove for given view.

view_list_local_data view

list_local_data for given view.

view_local_data view RR data...

local_data for given view.

view_local_data_remove view name

local_data_remove for given view.

view_local_datas_remove view

Remove a list of local_data for given view from stdin. Like local_datas_remove.

view_local_datas view

Add a list of local_data for given view from stdin. Like local_datas.

add_cookie_secret secret

Add or replace a cookie secret persistently. secret needs to be an 128 bit hex string. Cookie secrets can be either active or staging. Active cookie secrets are used to create DNS Cookies, but verification of a DNS Cookie succeeds with any of the active or staging cookie secrets. The state of the current cookie secrets can be printed with the print_cookie_secrets command.

When there are no cookie secrets configured yet, the secret is added as active. If there is already an active cookie secret, the secret is added as staging or replacing an existing staging secret.

To "roll" a cookie secret used in an anycast set. The new secret has to be added as staging secret to all nodes in the anycast set. When all nodes can verify DNS Cookies with the new secret, the new secret can be activated with the activate_cookie_secret command. After all nodes have the new secret active for at least one hour, the previous secret can be dropped with the drop_cookie_secret command.

Persistence is accomplished by writing to a file which is configured with the cookie-secret-file option in the server section of the config file. This is disabled by default, "".

drop_cookie_secret

Drop the staging cookie secret.

activate_cookie_secret

Make the current staging cookie secret active, and the current active cookie secret staging.

print_cookie_secrets

Show the current configured cookie secrets with their status.

## EXIT CODE
The unbound-control program exits with status code 1 on error, 0 on success.

## SET UP
The setup requires a self-signed certificate and private keys for both the server and client. The script unbound-control-setup generates these in the default run directory, or with -d in another directory. If you change the access control permissions on the key files you can decide who can use unbound-control, by default owner and group but not all users. Run the script under the same username as you have configured in unbound.conf or as root, so that the daemon is permitted to read the files, for example with:

```
sudo -u unbound unbound-control-setup
```

If you have not configured a username in unbound.conf, the keys need read permission for the user credentials under which the daemon is started. The script preserves private keys present in the directory. After running the script as root, turn on control-enable in unbound.conf.

## STATISTIC COUNTERS
The stats and stats_noreset commands show a number of statistic counters:

threadX.num.queries

number of queries received by thread

threadX.num.queries_ip_ratelimited

number of queries rate limited by thread

threadX.num.queries_cookie_valid

number of queries with a valid DNS Cookie by thread

threadX.num.queries_cookie_client

number of queries with a client part only DNS Cookie by thread

threadX.num.queries_cookie_invalid

number of queries with an invalid DNS Cookie by thread

threadX.num.queries_discard_timeout

number of queries removed due to discard-timeout by thread

threadX.num.queries_replyaddr_limit

number of queries removed due to replyaddr limits by thread

threadX.num.queries_wait_limit

number of queries removed due to wait-limit by thread

threadX.num.cachehits

number of queries that were successfully answered using a cache lookup

threadX.num.cachemiss

number of queries that needed recursive processing

threadX.num.dnscrypt.crypted

number of queries that were encrypted and successfully decapsulated by dnscrypt.

threadX.num.dnscrypt.cert

number of queries that were requesting dnscrypt certificates.

threadX.num.dnscrypt.cleartext

number of queries received on dnscrypt port that were cleartext and not a request for certificates.

threadX.num.dnscrypt.malformed

number of request that were neither cleartext, not valid dnscrypt messages.

threadX.num.dns_error_reports

number of DNS Error Reports generated by thread

threadX.num.prefetch

number of cache prefetches performed. This number is included in cachehits, as the original query had the unprefetched answer from cache, and resulted in recursive processing, taking a slot in the requestlist. Not part of the recursivereplies (or the histogram thereof) or cachemiss, as a cache response was sent.

threadX.num.expired

number of replies that served an expired cache entry.

threadX.num.queries_timed_out

number of queries that are dropped because they waited in the UDP socket buffer for too long.

threadX.query.queue_time_us.max

The maximum wait time for packets in the socket buffer, in microseconds. This is only reported when sock-queue-timeout is enabled.

threadX.num.recursivereplies

The number of replies sent to queries that needed recursive processing. Could be smaller than threadX.num.cachemiss if due to timeouts no replies were sent for some queries.

threadX.requestlist.avg

The average number of requests in the internal recursive processing request list on insert of a new incoming recursive processing query.

threadX.requestlist.max

Maximum size attained by the internal recursive processing request list.

threadX.requestlist.overwritten

Number of requests in the request list that were overwritten by newer entries. This happens if there is a flood of queries that recursive processing and the server has a hard time. The counter is increased when during the flood the jostle-timeout allows a query to be removed in favor of a new incoming query. The older query is then dropped to make space.

threadX.requestlist.exceeded

Queries that were dropped because the request list was full. This happens if a flood of queries need recursive processing, and the server can not keep up. The counter is increased when during the flood there is no space to be made with the jostle out of an older query, and the new query is dropped. Since no older queries are removed, see jostle-timeout setting, there is no space for the new query.

threadX.requestlist.current.all

Current size of the request list, includes internally generated queries (such as priming queries and glue lookups).

threadX.requestlist.current.user

Current size of the request list, only the requests from client queries.

threadX.requestlist.current.replies

Current count of the number of reply entries waiting on request list entries. Because a request list entry can send results to multiple reply addresses, this number may be larger than the size of the request list.

threadX.recursion.time.avg

Average time it took to answer queries that needed recursive processing. Note that queries that were answered from the cache are not in this average.

threadX.recursion.time.median

The median of the time it took to answer queries that needed recursive processing. The median means that 50% of the user queries were answered in less than this time. Because of big outliers (usually queries to non responsive servers), the average can be bigger than the median. This median has been calculated by interpolation from a histogram.

threadX.tcpusage

The currently held tcp buffers for incoming connections. A spot value on the time of the request. This helps you spot if the incoming-num-tcp buffers are full.

total.num.queries

summed over threads.

total.num.queries_ip_ratelimited

summed over threads.

total.num.queries_cookie_valid

summed over threads.

total.num.queries_cookie_client

summed over threads.

total.num.queries_cookie_invalid

summed over threads.

total.num.queries_discard_timeout

summed over threads.

total.num.queries_replyaddr_limit

summed over threads.

total.num.queries_wait_limit

summed over threads.

total.num.cachehits

summed over threads.

total.num.cachemiss

summed over threads.

total.num.dnscrypt.crypted

summed over threads.

total.num.dnscrypt.cert

summed over threads.

total.num.dnscrypt.cleartext

summed over threads.

total.num.dnscrypt.malformed

summed over threads.

total.num.dns_error_reports

summed over threads.

total.num.prefetch

summed over threads.

total.num.expired

summed over threads.

total.num.queries_timed_out

summed over threads.

total.query.queue_time_us.max

the maximum of the thread values.

total.num.recursivereplies

summed over threads.

total.requestlist.avg

averaged over threads.

total.requestlist.max

the maximum of the thread requestlist.max values.

total.requestlist.overwritten

summed over threads.

total.requestlist.exceeded

summed over threads.

total.requestlist.current.all

summed over threads.

total.requestlist.current.user

summed over threads.

total.requestlist.current.replies

summed over threads.

total.recursion.time.median

averaged over threads.

total.tcpusage

summed over threads.

time.now

current time in seconds since 1970.

time.up

uptime since server boot in seconds.

time.elapsed

time since last statistics printout, in seconds.

## EXTENDED STATISTICS
mem.cache.rrset

Memory in bytes in use by the RRset cache.

mem.cache.message

Memory in bytes in use by the message cache.

mem.cache.dnscrypt_shared_secret

Memory in bytes in use by the dnscrypt shared secrets cache.

mem.cache.dnscrypt_nonce

Memory in bytes in use by the dnscrypt nonce cache.

mem.mod.iterator

Memory in bytes in use by the iterator module.

mem.mod.validator

Memory in bytes in use by the validator module. Includes the key cache and negative cache.

mem.streamwait

Memory in bytes in used by the TCP and TLS stream wait buffers. These are answers waiting to be written back to the clients.

mem.http.query_buffer

Memory in bytes used by the HTTP/2 query buffers. Containing (partial) DNS queries waiting for request stream completion.

mem.http.response_buffer

Memory in bytes used by the HTTP/2 response buffers. Containing DNS responses waiting to be written back to the clients.

mem.quic

Memory in bytes used by QUIC. Containing connection information, stream information, queries read and responses written back to the clients.

histogram.<sec>.<usec>.to.<sec>.<usec>

Shows a histogram, summed over all threads. Every element counts the recursive queries whose reply time fit between the lower and upper bound. Times larger or equal to the lowerbound, and smaller than the upper bound. There are 40 buckets, with bucket sizes doubling.

num.query.type.A

The total number of queries over all threads with query type A. Printed for the other query types as well, but only for the types for which queries were received, thus =0 entries are omitted for brevity.

num.query.type.other

Number of queries with query types 256-65535.

num.query.class.IN

The total number of queries over all threads with query class IN (internet). Also printed for other classes (such as CH (CHAOS) sometimes used for debugging), or NONE, ANY, used by dynamic update. num.query.class.other is printed for classes 256-65535.

num.query.opcode.QUERY

The total number of queries over all threads with query opcode QUERY. Also printed for other opcodes, UPDATE, ...

num.query.tcp

Number of queries that were made using TCP towards the Unbound server.

num.query.tcpout

Number of queries that the Unbound server made using TCP outgoing towards other servers.

num.query.udpout

Number of queries that the Unbound server made using UDP outgoing towards other servers.

num.query.tls

Number of queries that were made using TLS towards the Unbound server. These are also counted in num.query.tcp, because TLS uses TCP.

num.query.tls.resume

Number of TLS session resumptions, these are queries over TLS towards the Unbound server where the client negotiated a TLS session resumption key.

num.query.https

Number of queries that were made using HTTPS towards the Unbound server. These are also counted in num.query.tcp and num.query.tls, because HTTPS uses TLS and TCP.

num.query.quic

Number of queries that were made using QUIC towards the Unbound server. These are also counted in num.query.tls, because TLS is used for these queries.

num.query.ipv6

Number of queries that were made using IPv6 towards the Unbound server.

num.query.flags.RD

The number of queries that had the RD flag set in the header. Also printed for flags QR, AA, TC, RA, Z, AD, CD. Note that queries with flags QR, AA or TC may have been rejected because of that.

num.query.edns.present

number of queries that had an EDNS OPT record present.

num.query.edns.DO

number of queries that had an EDNS OPT record with the DO (DNSSEC OK) bit set. These queries are also included in the num.query.edns.present number.

num.query.ratelimited

The number of queries that are turned away from being send to nameserver due to ratelimiting.

num.query.dnscrypt.shared_secret.cachemiss

The number of dnscrypt queries that did not find a shared secret in the cache. This can be use to compute the shared secret hitrate.

num.query.dnscrypt.replay

The number of dnscrypt queries that found a nonce hit in the nonce cache and hence are considered a query replay.

num.answer.rcode.NXDOMAIN

The number of answers to queries, from cache or from recursion, that had the return code NXDOMAIN. Also printed for the other return codes.

num.answer.rcode.nodata

The number of answers to queries that had the pseudo return code nodata. This means the actual return code was NOERROR, but additionally, no data was carried in the answer (making what is called a NOERROR/NODATA answer). These queries are also included in the num.answer.rcode.NOERROR number. Common for AAAA lookups when an A record exists, and no AAAA.

num.answer.secure

Number of answers that were secure. The answer validated correctly. The AD bit might have been set in some of these answers, where the client signalled (with DO or AD bit in the query) that they were ready to accept the AD bit in the answer.

num.answer.bogus

Number of answers that were bogus. These answers resulted in SERVFAIL to the client because the answer failed validation.

num.rrset.bogus

The number of rrsets marked bogus by the validator. Increased for every RRset inspection that fails.

num.valops

The number of validation operations performed by the validator. Increased for every RRSIG verification operation regardless of the validation result. The RRSIG and key combination needs to first pass some sanity checks before Unbound even performs the verification, e.g., length/protocol checks.

unwanted.queries

Number of queries that were refused or dropped because they failed the access control settings.

unwanted.replies

Replies that were unwanted or unsolicited. Could have been random traffic, delayed duplicates, very late answers, or could be spoofing attempts. Some low level of late answers and delayed duplicates are to be expected with the UDP protocol. Very high values could indicate a threat (spoofing).

msg.cache.count

The number of items (DNS replies) in the message cache.

rrset.cache.count

The number of RRsets in the rrset cache. This includes rrsets used by the messages in the message cache, but also delegation information.

infra.cache.count

The number of items in the infra cache. These are IP addresses with their timing and protocol support information.

key.cache.count

The number of items in the key cache. These are DNSSEC keys, one item per delegation point, and their validation status.

msg.cache.max_collisions

The maximum number of hash table collisions in the msg cache. This is the number of hashes that are identical when a new element is inserted in the hash table. If the value is very large, like hundreds, something is wrong with the performance of the hash table, hash values are incorrect or malicious.

rrset.cache.max_collisions

The maximum number of hash table collisions in the rrset cache. This is the number of hashes that are identical when a new element is inserted in the hash table. If the value is very large, like hundreds, something is wrong with the performance of the hash table, hash values are incorrect or malicious.

dnscrypt_shared_secret.cache.count

The number of items in the shared secret cache. These are precomputed shared secrets for a given client public key/server secret key pair. Shared secrets are CPU intensive and this cache allows Unbound to avoid recomputing the shared secret when multiple dnscrypt queries are sent from the same client.

dnscrypt_nonce.cache.count

The number of items in the client nonce cache. This cache is used to prevent dnscrypt queries replay. The client nonce must be unique for each client public key/server secret key pair. This cache should be able to host QPS * replay window interval keys to prevent replay of a query during replay window seconds.

num.query.authzone.up

The number of queries answered from auth-zone data, upstream queries. These queries would otherwise have been sent (with fallback enabled) to the internet, but are now answered from the auth zone.

num.query.authzone.down

The number of queries for downstream answered from auth-zone data. These queries are from downstream clients, and have had an answer from the data in the auth zone.

num.query.aggressive.NOERROR

The number of queries answered using cached NSEC records with NODATA RCODE. These queries would otherwise have been sent to the internet, but are now answered using cached data.

num.query.aggressive.NXDOMAIN

The number of queries answered using cached NSEC records with NXDOMAIN RCODE. These queries would otherwise have been sent to the internet, but are now answered using cached data.

num.query.subnet

Number of queries that got an answer that contained EDNS client subnet data.

num.query.subnet_cache

Number of queries answered from the edns client subnet cache. These are counted as cachemiss by the main counters, but hit the client subnet specific cache after getting processed by the edns client subnet module.

num.query.cachedb

Number of queries answered from the external cache of cachedb. These are counted as cachemiss by the main counters, but hit the cachedb external cache after getting processed by the cachedb module.

num.rpz.action.<rpz_action>

Number of queries answered using configured RPZ policy, per RPZ action type. Possible actions are: nxdomain, nodata, passthru, drop, tcp-only, local-data, disabled, and cname-override.

## FILES
/var/lib/unbound/unbound.conf

Unbound configuration file.

/var/lib/unbound

directory with private keys (unbound_server.key and unbound_control.key) and self-signed certificates (unbound_server.pem and unbound_control.pem).

## SEE ALSO
unbound.conf(5), unbound(8).

## AUTHOR
Unbound developers are mentioned in the CREDITS file in the distribution.

## COPYRIGHT
1999-2026, NLnet Labs


uni

package: uniconf-tools

title: uni(8)

text:
# uni(8)

## NAME
uni - a program to interface with the UniConf configuration system

## SYNOPSIS
uni get KEY [DEFAULT]

uni set KEY [VALUE]

uni xset KEY [VALUE]

uni keys KEY

uni hkeys KEY

uni xkeys KEY

uni dump KEY

uni hdump KEY

uni xdump KEY

## DESCRIPTION
UniConf is the One True Configuration system that includes all the others because it has plugin backends and frontends. Or, less grandiosely, it's a lightweight, distributed, cacheable tree of strings.

uni is used to interface directly with the UniConf system. It's primary use is for diagnostic purposes, but it can be used to add UniConf support to shell scripts.

## ENVIRONMENT VARIABLE
UNICONF

Before using uni, you must tell it which UniConf moinker you wish to query by setting this environment variable.

Monikers are used to contact UniConf back-ends, be they a uniconfd server, or a local file. For example, they could be:

• a filename (ini:/var/lib/app/config.ini),

• or a network address, (tcp:open.nit.ca:4111).

## COMMANDS
get

Retreive the VALUE associated with the provided KEY within the UniConf database. If a DEFAULT is provided, this will be returned if the KEY has no associated VALUE.

set

Assign the provided VALUE the the provided KEY. UniConf provides no guarentee that the entry committed throughout the database. The next “get” command for this KEY may not return the most recently “set” value due to caching, or the existance of a read-only generator.

xset

Assign, to the provided KEY, the contents of the standard-input stream. Use this command to pipe information into the UniConf database.

keys

List all the sub-keys contained within the provided KEY.

hkeys

List all the sub-keys, recursively, contained within the provided KEY. Since any KEY may contain sub-keys, UniConf provides no guarentee that there are no circular references.

xkeys

List all the sub-keys contained within the provided KEY, which can contain wildcards. See the WILDCARDS section.

dump

List all the sub-keys and their values, contained within the provided KEY.

hdump

List all the sub-keys and their values, recursively, contained within the provided KEY.

xdump

List all the sub-keys and their values, contained within the provided KEY, which can contain wildcards.

## WILDCARDS
A KEY looks just like a normal slash-delimited path. The root of the UniConf tree has a KEY named “/”. Sub-keys can be accessed by names such as “/software/myapp/version”.

With wildcards, you can access more than one key at a time.

*

To access a sub-key within any one level of keys, use the asterix like so: “/software/*/version”. This retrieves all keys of “version” that are one level beneath “/software”.

...

To access a sub-key anywhere beneath a key, use the ellipsis like so: “/.../version”. This retrieves all keys of “version” that are zero or more levels beneath the root (i.e. any appearance of “version” within the database.

## SEE ALSO
uniconfd(8)

## AUTHORS
This software was written by the hackers at Net Integration Technologies. Contact us at <wvstreams-dev@lists.nit.ca>

branch: sisyphus


uniconfd

package: uniconfd

title: uniconfd(8)

text:
# uniconfd(8)

## NAME
uniconfd - a daemon program for the UniConf configuration system

## SYNOPSIS
uniconfd [ OPTIONS ] MOUNT ...

## DESCRIPTION
UniConf is the One True Configuration system that includes all the others because it has plugin backends and frontends. Or, less grandiosely, it's a lightweight, distributed, cacheable tree of strings.

It supports:

- retrieving, storing, and enumerating key/value pairs (where both keys and values are strings).

- multiple backends where the actual key/value pairs are stored.

- multiple frontends for tying it to other configuration architectures.

It operates locally, and across a network, allowing you to tie multiple different applications together for distributed computing. Also, it provides notifications in the form of callbacks, so your application can be notified if a configuration key has changed.

uniconfd is necessary when you have more than one application, or multiple instances of an application, sharing one configuration. UniConf-enabled applications contact uniconfd which provides notifications when any of their watched keys change.

You tell uniconfd which UniConf MOUNT you want it to manage. See the MOUNTS section for more information.

## OPTIONS
-f

Run in the foreground. Do not fork into a separate daemon process.

-d, -dd

Print debugging messages to the console. The second d increases the verbosity of the messages.

-V

Print the version number and exit.

-a

Require authentication on incoming connections.

-A

Check all accesses against a perms moniker.

-p port

Listen on a given TCP port. The default is 4111. If port is 0, then listening on TCP is disabled.

-s port

Listen on a given TCP port wrapped in SSL. The default is 4112. If port is 0, then listening on SSL-over-TCP is disabled.

-u filename

Listen on a given Unix socket filename. This is disabled by default.

## MOUNTS
Mounts are UniConf path monikers which are in the form:

/SUBTREE=GENERATORS:PATH

SUBTREE

This is the tree to manage. All trees are descended from the root tree, indicated by a bare slash (/).

GENERATORS

These are the generators used to read and write key/value pairs. You can chain them with colons. For example, the generator chain: cache:retry:ini will cache the configuration for speed, retry persistently if the data source disappears, and store the data in an INI-formatted file.

PATH

This is the location where the data is stored. It is dependent on which GENERATORS were specified. For instance, it could be: • a filename (ini:/var/lib/app/config.ini),

• a network address, (tcp:open.nit.ca:4111),

• or even an empty string (tmp:).

Examples:

/=tmp:

/ca/nit=ssl:open.nit.ca

/ca/nit/uniconfd=ini:/var/lib/uniconfd/uniconfd.ini

/apps=cache:retry:unix:/var/lib/apps/socket

## FILES
/etc/uniconfd.conf

/var/lib/uniconf/uniconfd.ini

/var/lib/uniconf/uniconf.ini

## AUTHORS
This software was written by the hackers at Net Integration Technologies. Contact us at <wvstreams-dev@lists.nit.ca>


unionfs

package: unionfs

title: unionfs(8)

summary: A userspace unionfs implementation

text:
# unionfs(8)

## NAME
unionfs-fuse - A userspace unionfs implementation

## SYNOPSIS
unionfs [-o option1 -o option2 ... -o optionN ]

top_branch:lower_branch:...:lowest_branch

mount_point

## DESCRIPTION
unionfs overlays several directories into one single mount point.

It first tries to access the file on the top branch and if the file does not exist there, it continues on lower level branches. If the user tries to modify a file on a lower level read-only branch while copy-on-write (cow) mode is enabled, the file will be copied to a higher level read-write branch.

## OPTIONS
Below is a summary of unionfs options

-o chroot=path

Path to chroot into. By using this option, unionfs may be used for live CDs or live USB sticks, etc. So it can serve "/" as filesystem. If you do not specify this option and try to use it for "/", it will deadlock on calling 'pivot_root'. If you set this option, you also need to specify the branches relatively to the given chroot directory. See examples/S01a-unionfs-live-cd.sh for an example.

-o cow

Enable copy-on-write

-o hide_meta_files

In our unionfs root path we have a .unionfs directory that includes metadata, such as hidden (deleted) files. This option makes this directory invisible from readdir(), so for example ls -la /union_root will not show it. However, this directory is still there and cd .unionfs or ls -l .unionfs still work. Also, libfuse will create .fuse_hidden* files, if a file is open, but will be deleted. Those fuse meta files will be invisible as well. This option is especially useful for package builders.

-d

Enable debugging for unionfs and libfuse. Useful for developers if the code does not behave as expected. Debug information will be written to stderr and a debug file (./unionfs_debug.log by default).

-o debug_file=file

Write unionfs debug information into that file.

-o max_files=number

Maximum number of open files. Most systems have a default limit of 1024 open files per process. For example if unionfs serves "/", applications like KDE or GNOME might have many open files, making the unionfs process reach this limit and unable to open further files. Suggested value for "/" is >16000 or even >32000 files.

-o noinitgroups

Since version 0.23 without any effect, just left over for compatibility. Might be removed in future versions.

-o relaxed_permissions

Usually we automatically add the libfuse option -o default_permissions so that libfuse takes over permission checks. However, if running not as root (so as UID != 0 and GID != 0), permissions on the underlying filesystem are already sufficient. In order to prevent severe security issues, this option is not allowed if running as root.

-o statfs_omit_ro

By default, blocks of all branches are counted in statfs() calls (e.g. by 'df'). With this option, read-only branches will be omitted from the summary of blocks. This may sound weird, but it actually fixes "wrong" percentage of free space.

## Options to libfuse
There are several further options available, which don't directly apply to unionfs, but to libfuse. Please run unionfs --help to see these. We already set -o default_permissions option on our own.

## EXAMPLES

```
 unionfs -o cow,max_files=32768 \
              -o allow_other,suid,dev,nonempty \
              /u/host/etc=RW:/u/group/etc=RO:/u/common/etc=RO \
              /u/union/etc
```

## Meta data
Like other filesystems unionfs also needs to store meta data. Well, presently only information about deleted files and directories need to be stored, but in future releases more information might be required, e.g. inode-numbers for persistent inode information. Meta data information are saved and looked for in the .unionfs/ directories of each branch-root. So in the example above, these are /u/host/etc/.unionfs, /u/group/etc/.unionfs and /u/common/etc/.unionfs. Within these directories a complete directory structure may be found. Example: If the admin decides to delete the file /etc/test/testfile, which only exists in /u/unionfs/etc/test/testfile, unionfs can't delete this file, since it is on a read-only branch. So instead the whiteout file /u/host/etc/.unionfs/test/testfile_HIDDEN~ will be created. So on accessing the union filesystem, test/testfile will not be visible. Please also note that whiteout files/directories will only hide the files in lower level branches. So for example whiteouts in the group directory (/u/group/etc/.unionfs of the example above) will only hide file of the common branch (/u/common/etc), but not these of the group and host branches. Especially for diskless-booted environments it is rather useful for the admin to create whiteout files him/her-self. For example one should blacklist network re-initializations, /etc/mtab, /etc/nologin of the server and several cron-scripts. This can be easily achieved by creating whiteout files for these scripts in the group meta directory.

## KNOWN ISSUES

```
1) Another issue is that presently there is no support for read-only branches
when copy-on-write is disabled, thus, -ocow is NOT specified! Support for
that might be added in later releases.
```

## AUTHORS
unionfs-fuse Original implementation by Radek Podgorny <radek@podgorny.cz>

## COPYRIGHT
Radek Podgorny <radek@podgorny.cz>, Bernd Schubert <bernd-schubert@gmx.de>

## THANKS
Many thanks to the author of the FUSE filesystem Miklos Szeredi.


unitd

package: unit

title: unitd(8)

summary: runs the NGINX Unit daemon

text:
# unitd(8)

## Name
unitd — runs the NGINX Unit daemon

## Synopsis
unitd [--no-daemon] [--control socket] [--control-mode mode] [--control-user user] [--control-group group] [--group name] [--user name] [--log file] [--modulesdir directory] [--pid file] [--statedir directory] unitd [-h | --help | --version]

## Description
NGINX Unit is a polyglot app server, a reverse proxy, and a static file server for UNIX-like systems. It was built by nginx(8) team members from scratch to be highly efficient and fully configurable at runtime.

## Options
-h, --help

Displays a summary of Unit's command-line options and their compile-time defaults.

--version

Displays Unit's version and the ./configure settings it was built with.

--no-daemon

Runs Unit in non-daemon mode.

--control socket

Overrides the control API's socket address in IPv4, IPv6, or UNIX-domain format.

--control-mode mode

Sets the permission of the UNIX-domain control socket.

--control-user user

Sets the owner of the UNIX-domain control socket.

--control-group group

Sets the group of the UNIX-domain control socket.

--group name, --user name

Override group name and user name used to run Unit's non-privileged processes.

--log file

Overrides the pathname for Unit's log.

--modulesdir directory

Overrides the directory path for Unit's language modules (*.unit.so) files.

--pid file

Overrides the pathname for the PID file of Unit's main process.

--statedir directory

Overrides the directory path for Unit's state storage.

## Exit status
Exit status is 0 on success, or 1 if the daemon encounters an error.

## Files
/run/unit/unit.pid

The PID file of Unit's main process.

/var/log/unit/unit.log

A general-purpose log for diagnostics and troubleshooting.

## Sockets
unix:/run/unit/control.sock

The socket address of Unit's control API.

## Copyright

```
(C) 2017-2025 NGINX, Inc.
(C) 2017-2025 Andrei Zeliankou
(C) 2018-2025 Konstantin Pavlov
(C) 2021-2025 Zhidao Hong
(C) 2022-2025 Andrew Clayton
(C) 2022-2025 Liam Crilly
(C) 2023-2025 Dan Callahan
(C) 2023-2025 Igor Ippolitov
(C) 2024-2025 Ava Hahn
(C) 2023-2024 Danielle De Leo
(C) 2023-2024 Dylan Arbour
(C) 2023-2024 Gabor Javorszky
(C) 2023-2024 Taryn Musgrave
(C) 2021-2023 Alejandro Colomar
(C) 2017-2022 Valentin V. Bartenev
(C) 2017-2022 Max Romanov
(C) 2021-2022 Oisín Canty
(C) 2017-2021 Igor Sysoev
(C) 2017-2021 Andrei Belov
(C) 2019-2021 Tiago Natel de Moura
(C) 2019-2020 Axel Duch
(C) 2018-2019 Alexander Borisov
```

SPDX-License-Identifier: Apache-2.0

## See also
Website

User mailing list

GitHub


update-kernel

package: update-kernel

title: update-kernel(8)

summary: Linux kernel update tool

text:
# update-kernel(8)

## NAME
update-kernel - Linux kernel update tool

## SYNOPSIS
update-kernel [options]

## DESCRIPTION
update-kernel - script to conveniently update kernel and modules.

It works by installing a new package set along with the existing kernel. The old kernel is kept so that you don´t end up without a kernel guaranteed to boot (your good old one); by default, it will look for the most recent package of the same flavour (e.g. "std-def") and try to install all the same modules as already installed for that.

## OPTIONS
-l, --list

list available kernels

-a, --all

install all kernel modules

-i, --interactive

interactive modules install

-H, --headers

add kernel headers to install

-A modulename

include (add) external module (by a short name)

-D modulename

exclude (del) external module from install

-f, -y, --force

force kernel upgrade (without confirmation dialog)

-t, --type

install kernel with specified flavour (un-def, std-def, etc), special name 'latest' selects newest flavour

-r, --release

desired kernel release for the current or selected above flavour (allowed formats by example:

old format: alt1, 5.7.19-alt1

classic kernel release: 5.7.19-std-def-alt1

package name: [kernel-image-]std-def-5.7.19-alt1)

-n, --dry-run

perform a simulation of events that would occur but do not actually change the system

-d, --download-only

download packages but don't install

-h, --help

show this text and exit

Run remove-old-kernels to uninstall unused kernels.

## EXAMPLES
Download and install the latest un-def kernel:

update-kernel -t un-def

Download and install a specific kernel version (Note: it should exist in

the repository): update-kernel -r 5.15.70-un-def-alt1

## EXIT STATUS
update-kernel returns a zero exit status if it succeeds. Non-zero is returned in case of failure.

## AUTHOR
Man page by Anton Shevtsov (shevtsov.anton (at) gmail.com)

## SEE ALSO
apt-get(8)


upowerd

package: upower

title: upowerd(8)

summary: UPower Daemon

text:
# upowerd(8)

## NAME
upowerd - UPower Daemon

## SYNOPSIS
upowerd [--help]

## DESCRIPTION
upowerd provides the org.freedesktop.UPower service on the system message bus. Users or administrators should never need to start this daemon as it will be automatically started by dbus-daemon(1) whenever an application calls into the org.freedesktop.UPower service.

## OPTIONS
--help

Show help options.

## AUTHOR
Written by David Zeuthen <davidz@redhat.com> with a lot of help from many others.

## BUGS
Please send bug reports to either the distribution or the DeviceKit mailing list, see http://lists.freedesktop.org/mailman/listinfo/devkit-devel on how to subscribe.

## SEE ALSO
UPower(7), upower(1), dbus-daemon(1),


usbguard-daemon

package: usbguard

title: usbguard-daemon(8)

summary: USBGuard daemon

text:
# usbguard-daemon(8)

## NAME
usbguard-daemon - USBGuard daemon

## SYNOPSIS
usbguard-daemon [OPTIONS]

## DESCRIPTION
The usbguard-daemon is the main component of the USBGuard software framework. It runs as a service in the background and enforces the USB device authorization policy for all USB devices. The policy is defined by a set of rules using a rule language described in usbguard-rules.conf(5). The policy and the authorization state of USB devices can be modified during runtime using the usbguard(1) tool.

## OPTIONS
-d

Enable debugging messages in the log.

-f

Enable classical daemon behavior (fork at start, sysV compliant).

-s

Log to syslog.

-k

Log to console. (default)

-K

Disable Logging to console.

-l path

Log to a file at path.

-p path

Write PID to a file at path (default: /var/run/usbguard.pid).

-c path

Load configuration from a file at path (default: /etc/usbguard/usbguard-daemon.conf).

-P

Disable permissions check on conf and policy files (default: /etc/usbguard/usbguard-daemon.conf).

-C

Drop capabilities to limit privileges of the process.

-W

Use a seccomp allowlist to limit available syscalls to the process.

-h

Show the help/usage screen.

## SECURITY CONSIDERATIONS
The daemon provides the USBGuard public IPC interface. Depending on your distribution defaults, the access to this interface is limited to a certain group or a specific user only. Please refer to the usbguard-daemon.conf(5) man page for more information on how to configure the ACL correctly. Do not leave the ACL unconfigured as that will expose the IPC interface to all local users. That will allow them to manipulate the authorization state of USB devices and modify the USBGuard policy.

## SEE ALSO
usbguard-daemon.conf(5), usbguard-rules.conf(5), usbguard(1)

## BUGS
If you find a bug in this software or if you’d like to request a feature to be implemented, please file a ticket at https://github.com/USBGuard/usbguard/issues/new.

## AUTHOR
USBGuard was originally written by Daniel Kopeček. Many people have contributed to it.

## RESOURCES
Main web site: https://usbguard.github.io/

## COPYING
License GPLv2+: GNU GPL version 2 or later http://gnu.org/licenses/gpl.html. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.


usbguard-dbus

package: usbguard-dbus

title: usbguard-dbus(8)

summary: USBGuard D\-Bus interface service

text:
# usbguard-dbus(8)

## NAME
usbguard-dbus - USBGuard D-Bus interface service

## SYNOPSIS
usbguard-dbus [OPTIONS]

## DESCRIPTION
The usbguard-dbus component exposes a D-Bus interface to a running instance of usbguard-daemon(8).

## OPTIONS
-s, --system

Listen on the system bus.

-S, --session

Listen on the session bus.

-h, --help

Show the help/usage screen.

## SEE ALSO
usbguard(1)

## BUGS
If you find a bug in this software or if you’d like to request a feature to be implemented, please file a ticket at https://github.com/USBGuard/usbguard/issues/new.

## AUTHOR
USBGuard was originally written by Daniel Kopeček. Many people have contributed to it.

## RESOURCES
Main web site: https://usbguard.github.io/

## COPYING
License GPLv2+: GNU GPL version 2 or later http://gnu.org/licenses/gpl.html. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.


usbip

package: usbip

title: usbip(8)

summary: manage USB/IP devices

text:
# usbip(8)

## NAME
usbip - manage USB/IP devices

## SYNOPSIS
usbip [options] <command> <args>

## DESCRIPTION
On a USB/IP server, devices can be listed, bound, and unbound using this program. On a USB/IP client, devices exported by USB/IP servers can be listed, attached and detached.

## OPTIONS
--debug

Print debugging information.

--log

Log to syslog.

--tcp-port PORT

Connect to PORT on remote host (used for attach and list --remote).

## COMMANDS
version

Show version and exit.

help [command]

Print the program help message, or help on a specific command, and then exit.

attach --remote=<host> --busid=<bus_id>

Attach a remote USB device.

detach --port=<port>

Detach an imported USB device.

bind --busid=<busid>

Make a device exportable.

unbind --busid=<busid>

Stop exporting a device so it can be used by a local driver.

list --remote=<host>

List USB devices exported by a remote host.

list --local

List local USB devices.

## EXAMPLES

client:# usbip list --remote=server

- List devices exported by remote server.

client:# modprobe vhci-hcd

client:# usbip attach --remote=server --busid=1-2

- Connect the remote USB device.

client:# usbip detach --port=0

- Detach the usb device.

## SEE ALSO
usbipd(8)


usbipd

package: usbip-server

title: usbipd(8)

summary: USB/IP server daemon

text:
# usbipd(8)

## NAME
usbipd - USB/IP server daemon

## SYNOPSIS
usbipd [options]

## DESCRIPTION
usbipd provides USB/IP clients access to exported USB devices.

Devices have to explicitly be exported using usbip bind before usbipd makes them available to other hosts.

The daemon accepts connections from USB/IP clients on TCP port 3240 by default.

## OPTIONS
-4, --ipv4

Bind to IPv4. Default is both.

-6, --ipv6

Bind to IPv6. Default is both.

-D, --daemon

Run as a daemon process.

-d, --debug

Print debugging information.

-PFILE, --pid FILE

Write process id to FILE.

If no FILE specified, use /var/run/usbipd.pid

-tPORT, --tcp-port PORT

Listen on TCP/IP port PORT.

-h, --help

Print the program help message and exit.

-v, --version

Show version.

## LIMITATIONS
usbipd offers no authentication or authorization for USB/IP. Any USB/IP client can connect and use exported devices.

## EXAMPLES

server:# modprobe usbip-host

server:# usbipd -D

- Start usbip daemon.

server:# usbip list --local

- List driver assignments for usb devices.

server:# usbip bind --busid=1-2

- Bind usbip-host.ko to the device of busid 1-2.

- A usb device 1-2 is now exportable to other hosts!

- Use 'usbip unbind --busid=1-2' when you want to shutdown exporting and use the device locally.

## SEE ALSO
usbip(8)


usbmon

package: usbmon

title: usbmon(8)

summary: monitor USB traffic

text:
# usbmon(8)

## NAME
usbmon - monitor USB traffic

## SYNOPSIS
usbmon [ -i bus_num ] [ -s length ] [ -f0 | -fu | -fh ] [ -a0 | -a1 ]

## DESCRIPTION
usbmon allows to capture USB traffic for analysis in the manner similar to tcpdump (8).

To make use of this program, you need to have a Linux kernel which supports the binary "usbmon" interface (e.g., Linux kernel 2.6.20 or newer).

## OPTIONS
-i

Listen on bus_num. If unspecified, usbmon attempts to listen on the pseudo-bus number zero, which is supposed to capture all packets on all buses. The default is a convenient mode because the user does not have to figure out the bus number where a specific device is attached. Also, listening on pseudo-bus zero allows to capture events which happen when a bus is initialized. However, it may be necessary to specify a specific bus number to tap. Kernels before 2.6.22 do not implement the pseudo-bus zero at all. Performance of USB stack and the usbmon is greater when a specific bus is monitored. In such case, the desired bus number may be determined by examining the output of lsusb(8).

-s

Set the maximum length of USB data to print. The default is to print 32 bytes just like the kernel's text interface would. The capture size is automatically adjusted to match unless set explicitly.

-f

Select the output format as one of: '0' for legacy format, 'u' for so-called "1u" format, 'h' for "human-readable" format. The human-readable format is the default. Also, it changes over time, so programs should parse the "1u" format. Selecting the 1u format forces usbmon to use the API which may not be available in the kernel before version 2.6.22.

The human-readable format is not intended for a programmatic parsing, and so changes from release to release.

-a

Force the binary API version to use: '0' for the legacy API in kernel 2.6.20 and up, '1' for the newer API in kernels after 2.6.22. Selection of output format may force the API to the minimum required to support the format. In general, this option is only used when testing the kernel component of usbmon.

## OUTPUT FORMAT
The output of usbmon contains one text line per an event. The event corresponds to I/O operations on the boundary of Host Controller Driver (HCD). This includes events of the following types: Submission, Callback, Error. Every line consists of whitespace separated words. The number or position of words may depend on the event type, but there is a set of words, common for all types.

Most commonly used format is the human-readable format. Its words, from left to right, are:

- URB Tag. A single URB generates several monitoring events during its life cycle. The tag allows to corellate events with the URB. Tag is usually derived from a kernel mode address. Human-readable format shortens the tag to make the output more readable, so it's not the complete address.

- Timestamp. It consistes of the number of seconds, period, and the fraction in microseconds.

- Event Type. This type refers to the format of the event, not URB type. Available types are: S - submission, C - callback, E - submission error.

- "Pipe word" (the name is historical and has nothing to do with pipes). This is a composite word. It consists of four fields, separated by colons: URB type and direction, Bus number, Device address, Endpoint number. Type and direction are encoded with two bytes in the following manner:

Ci Co Control input and output

Zi Zo Isochronous input and output

Ii Io Interrupt input and output

Bi Bo Bulk input and output

The address information fields may contain leading zeros. If the bus is specified with -i, the Bus number field is redundant, but is kept for the ease of parsing.

- Status word. This word may have several fields, depending on the transfer type. Most transfers only have the status field. Interrupt and Isochronous transfers add an interval. For Isochronous, start frame and error count may be present. For callback and error events, the status field contains an integer number, which represents a "status" field of the URB. For a submission event, status makes no sense, so the field contains a single dash.

Control submissions are an exception, because they may have a setup packet. In such case, the event contains a letter in place of the status word. The letter is called "setup tag".

- Setup packet, if present, consists of 5 words: one of each for bmRequestType, bRequest, wValue, wIndex, wLength, as specified by the USB Specification 2.0. These words are safe to decode if Setup Tag was 's'. Otherwise, the setup packet was present, but not captured, and the fields contain filler.

- The number of isochronous frame descriptors (optional).

- Isochronous descriptors (optional). Like the "pipe word", each descriptor contains fields separated by colons: status, offset, and length.

- Data Tag

- Data (if Data Tag is '=')

Data stream and its ASCII representation follow on separate lines. Each line starts with a space for the ease of identification.

The following is the list of words for the legacy format, from left to right:

- URB Tag. This is normally a kernel mode address of the URB structure.

- Timestamp in microseconds, a decimal number. The timestamp's resolution depends on available clock, and so it can be much worse than a microsecond (if the implementation uses jiffies, for example). The number of microseconds is usually truncated, so it can wrap if usbmon runs long enough.

- Event Type. This type refers to the format of the event, not URB type. Available types are: S - submission, C - callback, E - submission error.

- "Pipe". The pipe concept is deprecated. This is a composite word, used to be derived from information in pipes. It consists of three fields, separated by colons: URB type and direction, Device address, Endpoint number. Type and direction are encoded with two bytes in the following manner:

Ci Co Control input and output

Zi Zo Isochronous input and output

Ii Io Interrupt input and output

Bi Bo Bulk input and output

Device address and Endpoint number are 3-digit and 2-digit (respectively) decimal numbers, with leading zeroes.

- URB Status. In most cases, this field contains a number, sometimes negative, which represents a "status" field of the URB. This field makes no sense for submissions, but is present anyway to help scripts with parsing. When an error occurs, the field contains the error code. In case of a submission of a Control packet, this field contains a Setup Tag instead of an error code. It is easy to tell whether the Setup Tag is present because it is never a number. Thus if scripts find a number in this field, they proceed to read Data Length. If they find something else, like a letter, they read the setup packet before reading the Data Length.

- Setup packet, if present, consists of 5 words: one of each for bmRequestType, bRequest, wValue, wIndex, wLength, as specified by the USB Specification 2.0. These words are safe to decode if Setup Tag was 's'. Otherwise, the setup packet was present, but not captured, and the fields contain filler.

- Data Length. For submissions, this is the requested length. For callbacks, this is the actual length.

- Data tag. The usbmon may not always capture data, even if length is nonzero. The data words are present only if this tag is '='.

- Data words follow, in big endian hexadecimal format. Notice that they are not machine words, but really just a byte stream split into words to make it easier to read. Thus, the last word may contain from one to four bytes. The length of collected data is limited (see the -s parameter) and can be less than the data length report in the Data Length word.

## FILES
/proc/devices

This file is read to determine the major of /dev/usbmonN if such node does not exist in the system.

/dev/usbmonN

The usbmon attempts to open /dev/usbmon{N}, where N is the bus number. If the node does not exist, usbmon creates it.

## SEE ALSO
lsusb(8)

## AUTHOR
Pete Zaitcev, <zaitcev@redhat.com>.


usbmuxd

package: usbmuxd

title: usbmuxd(8)

text:
# usbmuxd(8)

## NAME
usbmuxd - Expose a socket to multiplex connections from and to iOS devices.

## SYNOPSIS
usbmuxd [OPTIONS]

## DESCRIPTION
usbmuxd stands for "USB multiplexing daemon". This daemon is in charge of multiplexing connections over USB to an iOS device. To users, it means you can sync your music, contacts, photos, etc. over USB. To developers, it means you can connect to any listening localhost socket on the device. usbmuxd is not used for tethering data transfer which uses a dedicated USB interface as a virtual network device. Multiple connections to different TCP ports can happen in parallel. The higher-level layers are handled by libimobiledevice.

When usbmuxd is running (normally started, or stopped as a result of "udev" auto-insertion messages or by systemd) it provides a socket interface in "/var/run/usbmuxd" that is designed to be compatible with the socket interface that is provided on Mac OS X.

You should also create a "usbmux" user that has access to USB devices on your system. Alternatively, you can pass a different username using the -U argument.

Due to iOS 7 the daemon now also manages pairing records with iOS devices and the host in "/var/lib/lockdown" (Linux) or "/var/db/lockdown" (Mac OS X). Ensure proper permissions are setup for the daemon to access the directory.

## OPTIONS
-U, --user USER

Change to this user after startup (needs USB privileges).

-f, --foreground

Do not daemonize (implies one -v).

-n, --disable-hotplug

Disables automatic discovery of devices on hotplug. Starting another instance will trigger discovery instead.

-z, --enable-exit

Enable "--exit" request from other instances and exit automatically if no device is attached.

-u, --udev

Run in udev operation mode (implies -n and -z).

-s, --systemd

Run in systemd operation mode (implies -z and -f).

-x, --exit

Notify a running instance to exit if there are no devices connected (sends SIGUSR1 to running instance) and exit.

-X, --force-exit

Notify a running instance to exit even if there are still devices connected (always works) and exit.

-v, --verbose

be verbose (use twice or more to increase verbose level).

-V, --version

print version information and exit.

-h, --help

prints usage information.

## AUTHOR
The first usbmuxd daemon implementation was authored by Hector Martin.

Now mainly developed by Nikias Bassen, Martin Szulecki and contributors (see AUTHORS file).

## SEE ALSO
idevice_id(1), iproxy(1).

## ON THE WEB
https://libimobiledevice.org

https://github.com/libimobiledevice/usbmuxd


lsusb

package: usbutils

title: lsusb(8)

summary: list USB devices

text:
# lsusb(8)

## NAME
lsusb - list USB devices

## SYNOPSIS
lsusb [ options ]

## DESCRIPTION
lsusb is a utility for displaying information about USB buses in the system and the devices connected to them. It uses udev's hardware database to associate a full human-readable name to the vendor ID and the product ID.

## OPTIONS
-v, --verbose

Tells lsusb to be verbose and display detailed information about the devices shown. This includes configuration descriptors for the device's current speed. Class descriptors will be shown, when available, for USB device classes including hub, audio, HID, communications, and chipcard. Can be used with the -t option.

-s [[bus]:][devnum]

Show only devices in specified bus and/or devnum. Both IDs are given in decimal and may be omitted.

-d [vendor]:[product]

Show only devices with the specified vendor and product ID. Both IDs are given in hexadecimal.

-D device

Do not scan the /dev/bus/usb directory, instead display only information about the device whose device file is given. The device file should be something like /dev/bus/usb/001/001. This option displays detailed information like the -v option; you must be root to do this.

-t, --tree

Tells lsusb to dump the physical USB device hierarchy as a tree. Verbosity can be increased twice with the -v option.

-V, --version

Print version information on standard output, then exit successfully.

## RETURN VALUE
If the specified device is not found, a non-zero exit code is returned.

## SEE ALSO
lspci(8), usbview(8).

## AUTHOR
Thomas Sailer, <sailer@ife.ee.ethz.ch>.


usbhid-dump

title: usbhid-dump(8)

text:
# usbhid-dump(8)

## NAME
usbhid-dump - dump USB HID device report descriptors and streams

## SYNOPSIS
usbhid-dump [OPTION]...

## DESCRIPTION
usbhid-dump uses libusb to dump report descriptors and streams from HID (human interface device) interfaces of USB devices. By default, it dumps HID interfaces of all connected USB devices, but could be limited to a subset of them, or to a single interface, using options.

NOTE: usbhid-dump detaches kernel drivers from the interfaces it dumps and uses them exclusively, so no other program receives the input in the meantime. The report descriptor dumping is instantaneous, but the stream dumping continues until terminated with SIGINT (^C from the terminal) or a timeout expires.

If you accidentally start dumping a stream from the USB keyboard you use to control the terminal, the system will stop receiving the input and you won't be able to terminate usbhid-dump. Just stop your input and wait until the timeout expires. The stream dumping will stop, the keyboard will be reattached to the kernel driver and you will regain control.

The default stream dumping timeout is 60 seconds and could be changed with the -t option.

## OPTIONS
-h, --help

Output a help message and exit.

-v, --version

Output version information and exit.

-s, -a, --address=bus[:dev]

Limit interfaces by bus number and device address. Both 1-255, decimal. Zeroes match any bus or device.

-d, -m, --model=vid[:pid]

Limit interfaces by device vendor and product IDs. Both 1-FFFF, hexadecimal. Zeroes match any vendor or product.

-i, --interface=NUMBER

Limit interfaces by number (0-254), decimal. 255 matches any interface.

-e, --entity=STRING

The entity to dump: either "descriptor", "stream" or "all". The value can be abbreviated down to one letter. The default is "descriptor".

-t, --stream-timeout=NUMBER

Stream interrupt transfer timeout, ms. Zero means infinity. The default is 60000 (60 seconds).

-p, --stream-paused

Start with the stream dump output paused.

-f, --stream-feedback

Enable stream dumping feedback: print a dot to stderr for every transfer dumped.

## SIGNALS
USR1/USR2

Pause/resume stream dump output.

## OUTPUT FORMAT
usbhid-dump outputs dumps in chunks. Each chunk is separated by an empty line and starts with the following header line:

BUS:DEVICE:INTERFACE:ENTITY TIMESTAMP

Here, BUS, DEVICE and INTERFACE are bus, device and interface numbers respectively. ENTITY is either "DESCRIPTOR" or "STREAM". TIMESTAMP is timestamp in seconds since epoch.

After the header the actual dump data follows as hex bytes. A descriptor chunk includes the whole report descriptor. Every stream chunk includes a whole report, usually, but if a report is bigger than endpoint's wMaxPacketSize, it will span several chunks.

## EXAMPLES
Dump report descriptor for a device with address 3 on bus number 2:

usbhid-dump -a 2:3

Dump report stream for a device with vendor ID 0x5543 and product ID 0x0005:

usbhid-dump -m 5543:0005 -es

Dump report descriptor from interface 1 of a device with vendor ID 0x5543:

usbhid-dump -m 5543 -i 1 -ed

Dump report streams from all HID interfaces of all USB devices (caution: you will lose control over the terminal if you use USB keyboard):

usbhid-dump -es

## AUTHOR
Nikolai Kondrashov <spbnick@gmail.com>


usbview

package: usbview

title: usbview(8)

summary: display information on USB devices

text:
# usbview(8)

## NAME
usbview - display information on USB devices

## SYNOPSIS
usbview

## DESCRIPTION
usbview provides a graphical summary of USB devices connected to the system. Detailed information may be displayed by selecting individual devices in the tree display. Red items are those that have no driver associated with them.

## OPTIONS
No command line options are accepted by usbview.

## FILES
/sys/kernel/debug/usb/devices

Kernel file providing information on USB devices attached to the machine.

## SEE ALSO
lsusb(8), lspci(8).

## AUTHOR
usbview was written by Greg Kroah-Hartman <greg@kroah.com>. This manual page was written by Mark Brown <broonie@sirena.org.uk>, for the Debian GNU/Linux system (but may be used freely by others).


blkdiscard

package: util-linux

title: blkdiscard(8)

summary: discard sectors on a device

text:
# blkdiscard(8)

## NAME
blkdiscard - discard sectors on a device

## SYNOPSIS
blkdiscard [options] [-o offset] [-l length] device

## DESCRIPTION
blkdiscard is used to discard device sectors. This is useful for solid-state drivers (SSDs) and thinly-provisioned storage. Unlike fstrim(8), this command is used directly on the block device.

By default, blkdiscard will discard all blocks on the device. Options may be used to modify this behavior based on range or size, as explained below.

The device argument is the pathname of the block device.

WARNING: All data in the discarded region on the device will be lost!

## OPTIONS
The offset and length arguments may be followed by the multiplicative suffixes KiB (=1024), MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB (the "iB" is optional, e.g., "K" has the same meaning as "KiB") or the suffixes KB (=1000), MB (=1000*1000), and so on for GB, TB, PB, EB, ZB and YB.

-f, --force

Disable all checking. Since v2.36 the block device is open in exclusive mode (O_EXCL) by default to avoid collision with mounted filesystem or another kernel subsystem. The --force option disables the exclusive access mode.

-o, --offset offset

Byte offset into the device from which to start discarding. The provided value must be aligned to the device sector size. The default value is zero.

-l, --length length

The number of bytes to discard (counting from the starting point). The provided value must be aligned to the device sector size. If the specified value extends past the end of the device, blkdiscard will stop at the device size boundary. The default value extends to the end of the device.

-p, --step length

The number of bytes to discard within one iteration. The default is to discard all by one ioctl call.

-q, --quiet

Suppress warning messages.

-s, --secure

Perform a secure discard. A secure discard is the same as a regular discard except that all copies of the discarded blocks that were possibly created by garbage collection must also be erased. This requires support from the device.

-z, --zeroout

Zero-fill rather than discard.

-v, --verbose

Display the aligned values of offset and length. If the --step option is specified, it prints the discard progress every second.

-h, --help

Display help text and exit.

-V, --version

Print version and exit.

## EXIT STATUS
blkdiscard has the following exit status values:

0

success

1

failure; incorrect invocation, permissions or any other generic error

2

failure; since v2.39, the device does not support discard operation

## AUTHORS
Lukas Czerner <lczerner@redhat.com>, Karel Zak <kzak@redhat.com>

## SEE ALSO
fstrim(8)

## REPORTING BUGS
For bug reports, use the issue tracker at <https://github.com/util-linux/util-linux/issues>.

## AVAILABILITY
The blkdiscard command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>.


blkid

title: blkid(8)

summary: locate/print block device attributes

text:
# blkid(8)

## NAME
blkid - locate/print block device attributes

## SYNOPSIS
blkid --label label | --uuid uuid

blkid [--no-encoding --garbage-collect --list-one --cache-file file] [--output format] [--match-tag tag] [--match-token NAME=value] [device...]

blkid --probe [--offset offset] [--output format] [--size size] [--match-tag tag] [--match-types list] [--usages list] [--no-part-details] device...

blkid --info [--output format] [--match-tag tag] device...

## DESCRIPTION
The blkid program is the command-line interface to working with the libblkid(3) library. It can determine the type of content (e.g., filesystem or swap) that a block device holds, and also the attributes (tokens, NAME=value pairs) from the content metadata (e.g., LABEL or UUID fields).

It is recommended to use lsblk(8) command to get information about block devices, or lsblk --fs to get an overview of filesystems, or findmnt(8) to search in already mounted filesystems.

lsblk(8) provides more information, better control on output formatting, easy to use in scripts and it does not require root permissions to get actual information. blkid reads information directly from devices and for non-root users it returns cached unverified information. blkid is mostly designed for system services and to test libblkid(3) functionality.

When device is specified, tokens from only this device are displayed. It is possible to specify multiple device arguments on the command line. If none is given, all partitions or unpartitioned devices which appear in /proc/partitions are shown, if they are recognized.

blkid has two main forms of operation: either searching for a device with a specific NAME=value pair, or displaying NAME=value pairs for one or more specified devices.

For security reasons blkid silently ignores all devices where the probing result is ambivalent (multiple colliding filesystems are detected). The low-level probing mode (-p) provides more information and extra exit status in this case. It’s recommended to use wipefs(8) to get a detailed overview and to erase obsolete stuff (magic strings) from the device.

## OPTIONS
The size and offset arguments may be followed by the multiplicative suffixes like KiB (=1024), MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB (the "iB" is optional, e.g., "K" has the same meaning as "KiB"), or the suffixes KB (=1000), MB (=1000*1000), and so on for GB, TB, PB, EB, ZB and YB.

-c, --cache-file cachefile

Read from cachefile instead of reading from the default cache file (see the CONFIGURATION FILE section for more details). If you want to start with a clean cache (i.e., don’t report devices previously scanned but not necessarily available at this time), specify /dev/null.

-d, --no-encoding

Don’t encode non-printing characters. The non-printing characters are encoded by ^ and M- notation by default. Note that the --output udev output format uses a different encoding which cannot be disabled.

-D, --no-part-details

Don’t print information (PART_ENTRY_* tags) from partition table in low-level probing mode.

-g, --garbage-collect

Perform a garbage collection pass on the blkid cache to remove devices which no longer exist.

-H, --hint setting

Set probing hint. The hints are an optional way to force probing functions to check, for example, another location. The currently supported is "session_offset=number" to set session offset on multi-session UDF.

-i, --info

Display information about I/O Limits (aka I/O topology). The 'export' output format is automatically enabled. This option can be used together with the --probe option.

-k, --list-filesystems

List all known filesystems and RAIDs and exit.

-l, --list-one

Look up only one device that matches the search parameter specified with the --match-token option. If there are multiple devices that match the specified search parameter, then the device with the highest priority is returned, and/or the first device found at a given priority (but see below note about udev). Device types in order of decreasing priority are: Device Mapper, EVMS, LVM, MD, and finally regular block devices. If this option is not specified, blkid will print all of the devices that match the search parameter. This option forces blkid to use udev when used for LABEL or UUID tokens in --match-token. The goal is to provide output consistent with other utils (like mount(8), etc.) on systems where the same tag is used for multiple devices.

-L, --label label

Look up the device that uses this filesystem label; this is equal to --list-one --output device --match-token LABEL=label. This lookup method is able to reliably use /dev/disk/by-label udev symlinks (dependent on a setting in /etc/blkid.conf). Avoid using the symlinks directly; it is not reliable to use the symlinks without verification. The --label option works on systems with and without udev. Unfortunately, the original blkid(8) from e2fsprogs uses the -L option as a synonym for -o list. For better portability, use -l -o device -t LABEL=label and -o list in your scripts rather than the -L option.

-n, --match-types list

Restrict the probing functions to the specified (comma-separated) list of superblock types (names). The list items may be prefixed with "no" to specify the types which should be ignored. For example: blkid --probe --match-types vfat,ext3,ext4 /dev/sda1

probes for vfat, ext3 and ext4 filesystems, and

blkid --probe --match-types nominix /dev/sda1

probes for all supported formats except minix filesystems. This option is only useful together with --probe.

-o, --output format

Use the specified output format. Note that the order of variables and devices is not fixed. See also option -s. The format parameter may be: full

print all tags (the default)

value

print the value of the tags

list

print the devices in a user-friendly format; this output format is unsupported for low-level probing (--probe or --info). This output format is DEPRECATED in favour of the lsblk(8) command.

device

print the device name only; this output format is always enabled for the --label and --uuid options

udev

print key="value" pairs for easy import into the udev environment; the keys are prefixed by ID_FS_ or ID_PART_ prefixes. The value may be modified to be safe for udev environment; allowed is plain ASCII, hex-escaping and valid UTF-8, everything else (including whitespaces) is replaced with '_'. The keys with _ENC postfix use hex-escaping for unsafe chars. The udev output returns the ID_FS_AMBIVALENT tag if more superblocks are detected, and ID_PART_ENTRY_* tags are always returned for all partitions including empty partitions.

This output format is DEPRECATED.

export

print key=value pairs for easy import into the environment; this output format is automatically enabled when I/O Limits (--info option) are requested. The non-printing characters are encoded by ^ and M- notation and all potentially unsafe characters are escaped.

-O, --offset offset

Probe at the given offset (only useful with --probe). This option can be used together with the --info option.

-p, --probe

Switch to low-level superblock probing mode (bypassing the cache). Note that low-level probing also returns information about partition table type (PTTYPE tag) and partitions (PART_ENTRY_* tags). The tag names produced by low-level probing are based on names used internally by libblkid and it may be different than when executed without --probe (for example PART_ENTRY_UUID= vs PARTUUID=). See also --no-part-details.

-s, --match-tag tag

For each (specified) device, show only the tags that match tag. It is possible to specify multiple --match-tag options. If no tag is specified, then all tokens are shown for all (specified) devices. In order to just refresh the cache without showing any tokens, use --match-tag none with no other options.

-S, --size size

Override the size of device/file (only useful with --probe).

-t, --match-token NAME=value

Search for block devices with tokens named NAME that have the value value, and display any devices which are found. Common values for NAME include TYPE, LABEL, and UUID. If there are no devices specified on the command line, all block devices will be searched; otherwise only the specified devices are searched.

-u, --usages list

Restrict the probing functions to the specified (comma-separated) list of "usage" types. Supported usage types are: filesystem, raid, crypto and other. The list items may be prefixed with "no" to specify the usage types which should be ignored. For example: blkid --probe --usages filesystem,other /dev/sda1

probes for all filesystem and other (e.g., swap) formats, and

blkid --probe --usages noraid /dev/sda1

probes for all supported formats except RAIDs. This option is only useful together with --probe.

-U, --uuid uuid

Look up the device that uses this filesystem uuid. For more details see the --label option.

-h, --help

Display help text and exit.

-V, --version

Print version and exit.

## EXIT STATUS
If the specified device or device addressed by specified token (option --match-token) was found and it’s possible to gather any information about the device, an exit status 0 is returned. Note the option --match-tag filters output tags, but it does not affect exit status.

If the specified token was not found, or no (specified) devices could be identified, or it is impossible to gather any information about the device identifiers or device content an exit status of 2 is returned.

For usage or other errors, an exit status of 4 is returned.

If an ambivalent probing result was detected by low-level probing mode (-p), an exit status of 8 is returned.

## CONFIGURATION FILE
The standard location of the /etc/blkid.conf config file can be overridden by the environment variable BLKID_CONF. The following options control the libblkid library:

SEND_UEVENT=<yes|not>

Sends uevent when /dev/disk/by-{label,uuid,partuuid,partlabel}/ symlink does not match with LABEL, UUID, PARTUUID or PARTLABEL on the device. Default is "yes".

CACHE_FILE=<path>

Overrides the standard location of the cache file. This setting can be overridden by the environment variable BLKID_FILE. Default is /run/blkid/blkid.tab, or /etc/blkid.tab on systems without a /run directory.

EVALUATE=<methods>

Defines LABEL and UUID evaluation method(s). Currently, the libblkid library supports the "udev" and "scan" methods. More than one method may be specified in a comma-separated list. Default is "udev,scan". The "udev" method uses udev /dev/disk/by-* symlinks and the "scan" method scans all block devices from the /proc/partitions file.

## ENVIRONMENT
Setting LIBBLKID_DEBUG=all enables debug output.

## AUTHORS
blkid was written by Andreas Dilger for libblkid and improved by Theodore Ts’o and Karel Zak.

## SEE ALSO
libblkid(3), findfs(8), lsblk(8), wipefs(8)

## REPORTING BUGS
For bug reports, use the issue tracker at <https://github.com/util-linux/util-linux/issues>.

## AVAILABILITY
The blkid command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>.


blkpr

title: blkpr(8)

text:
# blkpr(8)

## NAME
blkpr - run persistent reservations command on a device

## SYNOPSIS
blkpr [options] device

## DESCRIPTION
blkpr is used to run persistent reservations command on device that supports Persistent Reservations feature.

The device argument is the pathname of the block device.

## OPTIONS
-c, --command command

The command of persistent reservations, supported commands are register, reserve, release, preempt, preempt-abort, and clear.

-k, --key key

The key the command should operate on.

-K, --oldkey oldkey

The old key the command should operate on.

-f, --flag flag

Supported flag is ignore-key.

-t, --type type

Supported types are write-exclusive, exclusive-access, write-exclusive-reg-only, exclusive-access-reg-only, write-exclusive-all-regs, and exclusive-access-all-regs.

-V, --version

Display version information and exit.

-h, --help

Display help text and exit.

## AUTHORS
zhenwei pi <pizhenwei@bytedance.com>

## SEE ALSO
sg_persist(8)

Linux documentation at: <https://docs.kernel.org/block/pr.html> iSCSI specification at: <https://datatracker.ietf.org/doc/html/rfc3720> NVMe-oF specification at: <https://nvmexpress.org/nvme-over-fabrics-part-two/>

## REPORTING BUGS
For bug reports, use the issue tracker at <https://github.com/util-linux/util-linux/issues>.

## AVAILABILITY
The blkpr command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>.


blkzone

title: blkzone(8)

summary: run zone command on a device

text:
# blkzone(8)

## NAME
blkzone - run zone command on a device

## SYNOPSIS
blkzone command [options] device

## DESCRIPTION
blkzone is used to run zone command on device that support the Zoned Block Commands (ZBC) or Zoned-device ATA Commands (ZAC). The zones to operate on can be specified using the offset, count and length options.

The device argument is the pathname of the block device.

## COMMANDS

### report
The command blkzone report is used to report device zone information.

By default, the command will report all zones from the start of the block device. Options may be used to modify this behavior, changing the starting zone or the size of the report, as explained below.

Report output:

start

Zone start sector

len

Zone length in number of sectors

cap

Zone capacity in number of sectors

wptr

Zone write pointer position

reset

Reset write pointer recommended

non-seq

Non-sequential write resources active

cond

Zone condition

type

Zone type

Zone conditions:

cl

Closed

nw

Not write pointer

em

Empty

fu

Full

oe

Explicitly opened

oi

Implicitly opened

ol

Offline

ro

Read only

x?

Reserved conditions (should not be reported)

### capacity
The command blkzone capacity is used to report device capacity information.

By default, the command will report the sum, in number of sectors, of all zone capacities on the device. Options may be used to modify this behavior, changing the starting zone or the size of the report, as explained below.

### reset
The command blkzone reset is used to reset one or more zones. Unlike sg_reset_wp(8), this command operates from the block layer and can reset a range of zones.

### open
The command blkzone open is used to explicitly open one or more zones. Unlike sg_zone(8), open action, this command operates from the block layer and can open a range of zones.

### close
The command blkzone close is used to close one or more zones. Unlike sg_zone(8), close action, this command operates from the block layer and can close a range of zones.

### finish
The command blkzone finish is used to finish (transition to full condition) one or more zones. Unlike sg_zone(8), finish action, this command operates from the block layer and can finish a range of zones.

By default, the reset, open, close and finish commands will operate from the zone at device sector 0 and operate on all zones. Options may be used to modify this behavior as explained below.

## OPTIONS
The offset and length option arguments may be followed by the multiplicative suffixes KiB (=1024), MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB (the "iB" is optional, e.g., "K" has the same meaning as "KiB") or the suffixes KB (=1000), MB (=1000*1000), and so on for GB, TB, PB, EB, ZB and YB. Additionally, the 0x prefix can be used to specify offset and length in hex.

-o, --offset sector

The starting zone specified as a sector offset. The provided offset in sector units (512 bytes) should match the start of a zone. The default value is zero.

-l, --length sectors

The maximum number of sectors the command should operate on. The default value is the number of sectors remaining after offset. This option cannot be used together with the option --count.

-c, --count count

The maximum number of zones the command should operate on. The default value is the number of zones starting from offset. This option cannot be used together with the option --length.

-f, --force

Enforce commands to change zone status on block devices used by the system.

-v, --verbose

Display the number of zones returned in the report or the range of sectors reset.

-h, --help

Display help text and exit.

-V, --version

Print version and exit.

## AUTHORS
Shaun Tancheff <shaun@tancheff.com>, Karel Zak <kzak@redhat.com>

## SEE ALSO
sg_rep_zones(8)

## REPORTING BUGS
For bug reports, use the issue tracker at <https://github.com/util-linux/util-linux/issues>.

## AVAILABILITY
The blkzone command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>.