SG_Z_ACT_QUERY(8)

πŸ’– NAME πŸ’–

Okay so bestie, welcome to SG_Z_ACT_QUERY(8) from SG3_UTILS πŸ’…. This utility is literally sg_z_act_query β€” send a SCSI ZONE ACTIVATE or ZONE QUERY command. That's the whole vibe, no cap. ✨

✨ SYNOPSIS ✨

sg_z_act_query [--activate] [--all] [--force] [--help] [--hex]
[--inhex=FN] [--maxlen=LEN] [--num=ZS] [--other=ZDID] [--query] [--raw]
[--verbose] [--version] [--zone=ID] DEVICE

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so, picture this: sg_z_act_query sends a SCSI ZONE ACTIVATE or ZONE QUERY command to DEVICE. If you don't pass --activate, it sends a ZONE QUERY command. These commands were added in the ZBC-2 draft revision 4 (zbc2r04.pdf).

Both commands have similar cdb_s and responses, which is why they're both chillin' in this one utility. The difference? Only ZONE ACTIVATE will potentially activate or deactivate zones. Both commands will perform a "Verify activations operation" as defined in ZBC-2. Periodt.

🌸 OPTIONS 🌸

Heads up, bestie: arguments to long options are mandatory for short options as well. Iykyk.

  • -A, --activate β€” sends a ZONE ACTIVATE command to DEVICE. The default, aka when you don't give this option, is to send a ZONE QUERY command.
  • -a, --all β€” sets the ALL field in the cdb.
  • -f, --force β€” when decoding the response, certain sanity checks are done; if they fail, a message goes to stderr and a non-zero exit status is set. Give this option and those sanity checks are bypassed.
  • -h, --help β€” output the usage message then exit.
  • -H, --hex β€” output the response in hexadecimal to stdout. Used once: the whole response is output in ASCII hexadecimal with a leading address (starting at 0) on each line. Used twice: each zone activation descriptor in the response is output separately in hexadecimal. Used thrice: the whole response is output in hexadecimal with no leading address (on each line). The output format when this option is given thrice is suitable for a later invocation with the --inhex=FN option.
  • -i, --inhex=FN β€” FN is a file name whose contents are assumed to be ASCII hexadecimal. If DEVICE is also given then DEVICE is ignored, a warning is issued, and the utility continues, decoding the file named FN. See the "HEX, BINARY AND JSON FORMATS" section in the sg3_utils manpage for more information. If the --raw option is also given then the contents of FN are treated as binary. By default it is assumed the response is from a ZONE QUERY command but that shouldn't matter because the response of the ZONE ACTIVATE and ZONE QUERY commands is of the same form.
  • -m, --maxlen=LEN β€” LEN is the (maximum) response length in bytes. It is placed in the cdb's "allocation length" field. If not given (or LEN is zero) then 8192 is used. The maximum allowed value of LEN is 1048576. The draft standard disallows allocation lengths less than 64 β€” periodt.
  • -n, --num=ZS β€” ZS is placed in the "Number of zones" field in the cdb. This option is usually ignored if the --all option is given. If the --all option is not given, the default value of this field is 1.
  • -o, --other=ZDID β€” the ZDID value will be placed in the "Other zone domain ID" field of the cdb to be sent to DEVICE.
  • -q, --query β€” causes the ZONE QUERY command to be sent to DEVICE. Since this is the default action, this option is typically not needed. If both this option and the --activate option are given, an error will be reported (and no command will be sent).
  • -r, --raw β€” output response in binary (to stdout) unless the --inhex=FN option is also given. In that case the input file name (FN) is decoded as binary (and the output is _not_ in binary (but may be hex)).
  • -v, --verbose β€” increase the level of verbosity, (i.e. debug output).
  • -V, --version β€” print the version string and then exit.
  • -z, --zone=ID β€” ID is placed in the cdb's ZONE ID field. A zone id is a zone start logical block address (LBA). The default value is 0. ID is assumed to be in decimal unless prefixed with '0x' or has a trailing 'h' which indicate hexadecimal. The maximum value that can be given is 2^64 - 2. In the unlikely event of wanting to give 2^64 - 1, enter "-1".

πŸ’€ EXIT STATUS πŸ’€

The exit status of sg_z_act_query is 0 when it is successful. Otherwise see the sg3_utils(8) man page.

πŸ‘‘ AUTHORS πŸ‘‘

Written by Douglas Gilbert.

πŸ™ˆ REPORTING BUGS πŸ™ˆ

Report bugs to <dgilbert at interlog dot com>.

Copyright Β© 2021-2023 Douglas Gilbert

This software is distributed under a BSD-2-Clause license. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

πŸŽ€ SEE ALSO πŸŽ€

sg_zone,sg_rep_zones,sg_reset_wp(sg3_utils)


xoxo, this page is from sg3_utils-1.48, dated June 2023 🫢✨

πŸ“¦ where this page comes from