/
githubmirror
/
sg3_utils
ОбзорДокументацияВойти
/
githubmirror
/
sg3_utils
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
ДокументацияПоддержка
Политика конфиденциальностиПользовательское соглашениеПолитика использования «cookies»Согласие субъекта персональных данных
2026 ©
sg3_utils/
inhex/
..
README

scsi-rescan.8 manpage: fix error in Makefile.am

3 месяца назад
descriptor_sense.hex

more JSON work: sense data and vpd device id, start on sg_vpd

4 года назад
fixed_sense.hex

sg_rem_rest_elem: new utility for removing or restoring elements; bug fixes

4 года назад
forwarded_sense.hex

move some hex file from examples to inhex directory; add testing/sg_take_snap; remove no_waitq from testing

5 лет назад
get_elem_status.hex

sg_get_elem_status: fractional elements added [sbc6r02]; freebsd warning cleanup

4 месяца назад
get_lba_status.hex

update command, asc, vpd, mode tables; drop debugging code sin sg_inq; sg_get_lba_status: additional LBA accessibility values

4 месяца назад
inq_emc_symm.hex

sg_inq+sg_vpd: rework designation descriptor handling; add sgj_haj_vs_len(); change sgj_js_designation_descriptor() to sgj_haj_designation_descriptor()

2 месяца назад
inq_standard.hex

sg_logs: add --exclude and --undefined options, improve 'last_n' log pages; add inhex/logs_last_n.hex

4 года назад
inq_standard.raw

sg_wr_mode: add --mfile=MF option for decoding mask in the MF file; add inhex support for sg_wr_mode

3 года назад
logs_last_n.hex

sg_logs: add --exclude and --undefined options, improve 'last_n' log pages; add inhex/logs_last_n.hex

4 года назад
logs_sdeb_aa.hex

sg_lib: add sgj_js_nv_s_nex(); clean warnings from RPi big endian

3 года назад
luns_lu_cong.hex

conditional copy getopt.h into include directory when missing

4 месяца назад
luns_wlun.hex

conditional copy getopt.h into include directory when missing

4 месяца назад
modes_mm_sdeb.hex

sg_lib: add sgj_js_nv_s_nex(); clean warnings from RPi big endian

3 года назад
modes_sdeb.hex

json interface: add sgj_new_unattached_string/integer/bool functions for leaves; sg_modes documentation

3 года назад
nvme_dev_self_test.hex

move some hex file from examples to inhex directory; add testing/sg_take_snap; remove no_waitq from testing

5 лет назад
nvme_identify_ctl.hex

move some hex file from examples to inhex directory; add testing/sg_take_snap; remove no_waitq from testing

5 лет назад
nvme_read_ctl.hex

sg_lib: document internal json interface in include/sg_pr2serr.h; codespell fixes

4 года назад
nvme_read_oob_ctl.hex

sg_lib: document internal json interface in include/sg_pr2serr.h; codespell fixes

4 года назад
nvme_write_ctl.hex

sg_lib: document internal json interface in include/sg_pr2serr.h; codespell fixes

4 года назад
opcodes.hex

sg_opcodes: add --inhex=FN to process earlier -HHH, add experimental --json[=JO] option; sg_turs: change nanosleep() to Sleep() in MinGW

4 года назад
readcap_zbc.hex

sg_readcap+sg_luns: add --inhex= and json

4 года назад
ref_sense.hex

move some hex file from examples to inhex directory; add testing/sg_take_snap; remove no_waitq from testing

5 лет назад
rep_density.hex

sg_rep_density: new utility for decoding the response of Report density support command [ssc (tape)]

5 лет назад
rep_density_media.hex

sg_rep_density: new utility for decoding the response of Report density support command [ssc (tape)]

5 лет назад
rep_density_media_typem.hex

sg_rep_density: new utility for decoding the response of Report density support command [ssc (tape)]

5 лет назад
rep_density_typem.hex

sg_rep_density: new utility for decoding the response of Report density support command [ssc (tape)]

5 лет назад
rep_realms.hex

sgp_dd: add check for stdatomic.h presence in configure.ac; scripts: 55-scsi-sg3_id.rules remove outdated rule

5 лет назад
rep_zdomains.hex

sgp_dd: add check for stdatomic.h presence in configure.ac; scripts: 55-scsi-sg3_id.rules remove outdated rule

5 лет назад
rep_zones.hex

sgp_dd: add check for stdatomic.h presence in configure.ac; scripts: 55-scsi-sg3_id.rules remove outdated rule

5 лет назад
ses_areca_all.hex

sgp_dd: add check for stdatomic.h presence in configure.ac; scripts: 55-scsi-sg3_id.rules remove outdated rule

5 лет назад
stream_ctl_get.hex

sg_dd: add grpnum=GN operand and --nocopy option

3 года назад
stream_ctl_open.hex

sg_stream_ctl: add --hex, --inhex=, --json= and --raw options; JSON: make output more consistent so most command responses have a *_paramter_data

3 года назад
tst_script.sh

sg_inq: --export output conformance for SCSI name string and ATA fields (github: PR #83); Apply udev-conforming character encoding to VPD 0x83 designator type 8 (SCSI name string) and the T10 vendor ID ATA subfield, matching the encoding already used by designator types 0 and 1 since commit 4d770f1

2 месяца назад
vpd_atai.hex

Add NVMe Information VPD page; clean up ATA Information VPD page; add sgj_haj_vs_hex_bytes_nex() sg_json function;rename: build_debian.sh to debian_build.sh

3 месяца назад
vpd_bdce.hex

rescan-scsi-bus.sh: fix handling of '-I <secs>' option ; sg_inq+sg_vpd: more JSON work

4 года назад
vpd_bl.hex

Various small changes

месяц назад
vpd_constituents.hex

sgp_dd and sgm_dd: add --progress option

3 года назад
vpd_cpr.hex

sgp_dd: add check for stdatomic.h presence in configure.ac; scripts: 55-scsi-sg3_id.rules remove outdated rule

5 лет назад
vpd_dev_id.hex

sgp_dd: add check for stdatomic.h presence in configure.ac; scripts: 55-scsi-sg3_id.rules remove outdated rule

5 лет назад
vpd_di_all.hex

sg_inq+sg_vpd: rework designation descriptor handling; add sgj_haj_vs_len(); change sgj_js_designation_descriptor() to sgj_haj_designation_descriptor()

2 месяца назад
vpd_di_bad_all.hex

sg_lib: add sg_strscpy() to replace strncpy(); sg_json: add sgj_haj_vs_nex(); fixes from regression testing against version 1.48

2 месяца назад
vpd_di_name_inject.hex

sg_inq: --export output conformance for SCSI name string and ATA fields (github: PR #83); Apply udev-conforming character encoding to VPD 0x83 designator type 8 (SCSI name string) and the T10 vendor ID ATA subfield, matching the encoding already used by designator types 0 and 1 since commit 4d770f1

2 месяца назад
vpd_di_old_emc_symm.hex

sg_inq+sg_vpd: rework designation descriptor handling; add sgj_haj_vs_len(); change sgj_js_designation_descriptor() to sgj_haj_designation_descriptor()

2 месяца назад
vpd_fp.hex

sg_wr_mode: add --mfile=MF option for decoding mask in the MF file; add inhex support for sg_wr_mode

3 года назад
vpd_lbpro.hex

sgp_dd: add check for stdatomic.h presence in configure.ac; scripts: 55-scsi-sg3_id.rules remove outdated rule

5 лет назад
vpd_lbpv.hex

rescan-scsi-bus.sh: fix handling of '-I <secs>' option ; sg_inq+sg_vpd: more JSON work

4 года назад
vpd_nvmei.hex

Add NVMe Information VPD page; clean up ATA Information VPD page; add sgj_haj_vs_hex_bytes_nex() sg_json function;rename: build_debian.sh to debian_build.sh

3 месяца назад
vpd_ref.hex

rescan-scsi-bus.sh: fix handling of '-I <secs>' option ; sg_inq+sg_vpd: more JSON work

4 года назад
vpd_sbl.hex

rescan-scsi-bus.sh: fix handling of '-I <secs>' option ; sg_inq+sg_vpd: more JSON work

4 года назад
vpd_sdeb.hex

rescan-scsi-bus.sh: fix handling of '-I <secs>' option ; sg_inq+sg_vpd: more JSON work

4 года назад
vpd_sfs.hex

sgp_dd: add check for stdatomic.h presence in configure.ac; scripts: 55-scsi-sg3_id.rules remove outdated rule

5 лет назад
vpd_tpc.hex

sg_wr_mode: add --mfile=MF option for decoding mask in the MF file; add inhex support for sg_wr_mode

3 года назад
vpd_zbdc.hex

rescan-scsi-bus.sh: fix handling of '-I <secs>' option ; sg_inq+sg_vpd: more JSON work

4 года назад
vpd_zbdc.raw

lib/sg_pt_solaris.c : fix compilation issue per https://github.com/doug-gilbert/sg3_utils/pull/41

3 года назад
wr_mode_cont.hex

sg_wr_mode: add --mfile=MF option for decoding mask in the MF file; add inhex support for sg_wr_mode

3 года назад
wr_mode_mask.hex

sg_wr_mode: add --mfile=MF option for decoding mask in the MF file; add inhex support for sg_wr_mode

3 года назад
z_act_query.hex

sg_z_act_query: new utility for sending either a Zone activate or Zone query command; sg_rep_zones: add Report zone starting LBA granularity field in REPORT ZONES response [zbc2r12]; sg_decode_sense: add --nodecode option; initialize all sense buffers to 0; rework main README file

5 лет назад
README
Hex data for various sg3_utils utilities
========================================
 
The files in this folder contain hexadecimal data (in ASCII) and associated
comments. Comments start with the hash mark symbol: '#' and extend to the
end of that line. Files containing hexadecimal data have the extension ".hex".
There is at least one file containing binary data and it has the extension
".raw".
 
The utility that each hex file is associated with can be determined in most
cases by prepending "sg_" to those filenames. The beginning of such a
filename should match an executable whose source should be found in the
'src' sibling directory.
 
For example:
vpd_dev_id.hex
after prepending 'sg_' the filename becomes:
sg_vpd_dev_id.hex
which is a partial match on the sg_vpd utility.
The remaining 'dev_id.hex' is meant to suggest that the 'device identifier'
VPD page is what is being represented. The 'device identifier' VPD page is
mandatory for SCSI devices since SPC-2 (INCITS 351-2001).
 
Assuming sg3_utils is installed, it can be tested like this:
sg_vpd --inhex=<folder_holding_sg3_utils>/inhex/vpd_dev_id.hex
 
And should output this:
 
Device Identification VPD page:
Addressed logical unit:
designator type: NAA, code set: Binary
0x5000c5003011cb2b
Target port:
designator type: NAA, code set: Binary
transport: Serial Attached SCSI Protocol (SPL-4)
0x5000c5003011cb29
designator type: Relative target port, code set: Binary
transport: Serial Attached SCSI Protocol (SPL-4)
Relative target port: 0x1
Target device that contains addressed lu:
designator type: NAA, code set: Binary
transport: Serial Attached SCSI Protocol (SPL-4)
0x5000c5003011cb28
designator type: SCSI name string, code set: UTF-8
SCSI name string:
naa.5000C5003011CB28
 
Not all the hex files follow the "prepend sg_" pattern. Those hex files
starting with 'nvme_' are examples of invoking NVMe commands with the
sg_raw utility.
 
Binary <--> Hexadecimal
-----------------------
The vpd_zbdc.raw file is binary and was created by:
sg_decode_sense --inhex=vpd_zbdc.hex --nodecode --write=vpd_zbdc.raw
as an example of converting a file in ASCII hexadecimal byte oriented
format to binary.
 
Turning binary output into hexadecimal can be done several ways. For
viewing in byte oriented ASCII hex these Unix commands can be used:
od -t x1 vpd_zbdc.raw
hexdump -C vpd_zbdc.raw
 
Each line starts with a "input offset" which is a running count of
bytes, starting at zero. The hexdump example shows an ASCII rendering
of those 16 bytes to the right of each line. The sg_decode_sense utility
may also be used:
sg_decode_sense --binary=vpd_zbdc.raw -H
sg_decode_sense --binary=vpd_zbdc.raw -HH
 
The second form of sg_decode_sense appends an ASCII rendering of the 16
bytes to the right of each line.
 
When ASCII hexadecimal is being used as input to a utility in this
package, the "input offset" at the start of each line (and the optional
ASCII rendering to the right of each line) must not be given.
That can be done with hexdump:
hexdump -v -e '16/1 "%02x " "\n"' vpd_zbdc.raw
 
Strange that hexdump can't display unadorned ASCII hex bytes without a
special formatting string.
 
And the sg_decode_sense utility can do it with (with the --nodecode option):
sg_decode_sense -N --binary=vpd_zbdc.raw -HHH
That will print suitable lines of hexadecimal (16 bytes per line) to the
console (stdout) To go the other way (i.e. hexadecimal to binary):
sg_decode_sense -N --inhex=vpd_zbdc.hex --write=vpd_zbdc.bin
 
The author has a hexdump-like utility called hxasdmp whose source and
manpage is the utils directory (a sibling of this directory. hxascdmp and
its manpage are not normally installed. hxascdmp is purely byte-oriented.
 
 
Conclusion
----------
Users are encouraged to send the author any ASCII hex files for utilities
that support --inhex and don't have hex data already. Special cases are
also welcome. They help the author test this code.
 
Douglas Gilbert
4th May 2026