SG_IDENT(8)
β¨ SG_IDENT(8) β¨
okay bestie, this is the manual page for sg_ident from sg3_utils π
β¨ NAME β¨
sg_ident - send SCSI REPORT/SET IDENTIFYING INFORMATION command π
β¨ SYNOPSIS β¨
sg_ident [--ascii] [--clear] [--help] [--itype=IT] [--raw] [--set]
[--verbose] [--version] DEVICE
β¨ DESCRIPTION β¨
okay so this tool sends a SCSI REPORT IDENTIFYING INFORMATION or SET IDENTIFYING INFORMATION command to DEVICE π
fun fact: before SPC-4 (revision 7), these were called REPORT DEVICE IDENTIFIER and SET DEVICE IDENTIFIER, so if you see the old names in older docs, it's the same vibe π¦ SCSI devices that support these two commands let you write (set) some identifying info and then read it back later on β¨ and it's persistent, meaning it's stored on some non-volatile medium inside the device and survives a power outage π
ngl the space for this info is kinda small π₯Ί SPC-4 (revision 7) says that for information type 0, the minimum length is 64 bytes and the maximum is 512 bytes. For other information types (1 to 126 inclusive), the maximum length is 256 bytes. Also, information types 1 to 126 (inclusive) should hold a null terminated UTF-8 string. The author has seen older disks that only support 16 bytes π
when you run it with no options, it's giving "just peek at the info": it invokes the Report Identifying Information command with the information type defaulting to zero π error reports go to stderr π by default the info is shown in ASCII-HEX (up to 16 bytes per line) with an ASCII version on the right, where non printable characters become dots πΈ
β¨ OPTIONS β¨
ok so arguments to long options are mandatory for short options too, no skipping that part bestie π«Ά
-A,--asciiβ runs the Report Identifying Information command, and if there's anything there, it interprets it as ASCII (or UTF-8, which depends on your locale) and prints it to stdout π-C,--clearβ runs the Set Identifying Information command with an information length of zero, which basically wipes the existing info π§Ήβ¨-h,--helpβ prints the usage message and then exits π-i,--itype=ITβITis the information type. It defaults to zero, and the max is 127. That one is special and can't be used with--setor--clearπ« if supported, information type 127 makes REPORT IDENTIFYING INFORMATION respond with a list of the available information types and their max lengths in bytes π also, the odd numbered information types between 3 and 125 (inclusive) are off limits, because they clash with the SCC-2 standard π-r,--rawβ runs the Report Identifying Information command, and if there's anything, sends it to stdout as-is (it might be binary, so be careful π). Nothing else goes to stdout, but error reports still go to stderr π¦-S,--setβ first reads stdin until it detects an EOF, then runs the Set Identifying Information command to store whatever it grabbed from stdin as the info π the amount of data has to be between 1 and 512 bytes (inclusive) π-v,--verboseβ increases the verbosity level, aka you get more debug output π-V,--versionβ prints the version string and then exits π
this utility lets you write your own identifying info to your SCSI devices π but there are a bunch of other descriptors (or designators) you can't change, no cap π those include the SCSI INQUIRY command with its standard vendor and product identification strings and the product revision level, plus the huge amount of info in the "Device Identification" VPD page (see sg_vpd) π§ there's also the READ MEDIA SERIAL NUMBER command (see sg_rmsn) β¨ and the MMC-4 command set for CD and DVDs has a "media serial number" feature (0x109) [and a "logical unit serial number" feature] πΏ you can view these with the sg_get_config utility πΈ
β¨ EXAMPLES β¨
first up, to see if there's existing info whose format is unknown (for information type 0), just use no options π
# sg_ident /dev/sdb
00 31 32 33 34 35 36 37 38 39 30 1234567890
if it's ASCII, you can print it as such π
# sg_ident --ascii /dev/sdb
1234567890
you can copy the info to a file, clear it, and then re-assert it with this sequence π«Ά
# sg_ident --raw /dev/sdb > t
# sg_ident --clear /dev/sdb
# cat t | sg_ident --set /dev/sdb
β¨ EXIT STATUS β¨
the exit status of sg_ident is 0 when it's successful π otherwise, check out the sg3_utils(8) man page π
β¨ AUTHORS β¨
written by Douglas Gilbert π
β¨ REPORTING BUGS β¨
report bugs to <dgilbert at interlog dot com> π
β¨ COPYRIGHT β¨
Copyright Β© 2005-2018 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_vpd(sg3_utils), sg_rmsn(sg3_utils), sg_get_config(sg3_utils) π¦
bestie, you're officially a SCSI identity expert now ππ this page was from sg3_utils-1.43, August 2018, and you're literally the main character β¨π
π¦ where this page comes from
- alpine 3.24: sg3_utils-doc 1.48-r0 Β· BSD-2-Clause AND GPL-2.0-or-later
- arch rolling: sg3_utils 1.49-1 Β· GPL-2.0-or-later AND BSD-2-Clause
- centos-stream 10: sg3_utils 1.48-11.el10 Β· GPL-2.0-or-later AND BSD-2-Clause
- debian trixie: sg3-utils 1.48-3~deb13u1
- fedora 43: sg3_utils 1.48-10.fc43 Β· GPL-2.0-or-later AND BSD-2-Clause
- fedora 43: sg3_utils 1.48-6.fc43 Β· GPL-2.0-or-later AND BSD-2-Clause
- fedora 44: sg3_utils 1.48-10.fc44 Β· GPL-2.0-or-later AND BSD-2-Clause
- fedora 44: sg3_utils 1.48-8.fc44 Β· GPL-2.0-or-later AND BSD-2-Clause
- nixos 26.05: sg3_utils 1.48
- nixpkgs unstable: sg3_utils 1.49
- ubuntu questing: sg3-utils 1.48-2ubuntu1
- ubuntu resolute: sg3-utils 1.48-3ubuntu3
- ubuntu resolute: sg3-utils 1.48-3ubuntu3.2
- ubuntu stonking: sg3-utils 1.48-3ubuntu5
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms