SG_SAFTE(8)

๐Ÿ“ฆ
version 1.49 ยท 5 versions
, in alpine 3.24, arch rolling, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, ubuntu questing, ubuntu resolute, ubuntu stonking

โœจ NAME โœจ

okay bestie, this is the SG_SAFTE(8) page, and it's all about sg_safte, which lets you access a SCSI Accessed Fault-Tolerant Enclosure (SAF-TE) device ๐Ÿ’…

๐ŸŽ€ SYNOPSIS ๐ŸŽ€

sg_safte [--config] [--devstatus] [--encstatus] [--flags] [--help]
[--hex] [--insertions] [--raw] [--usage] [--verbose] [--version] DEVICE

๐ŸŒธ DESCRIPTION ๐ŸŒธ

okay so sg_safte fetches the enclosure status by sending a SCSI READ BUFFER command ๐Ÿซถ The DEVICE should be a SAF-TE device, and that can be either a storage array controller (INQUIRY peripheral device type 0xc) or a generic processor device (INQUIRY peripheral device type 0x3). no cap, it's giving hardware nerd โœจ

If you don't give any options and just pass the DEVICE argument, you get the overall enclosure status, as reported by the option --config ยฎis reported. main character energy ๐Ÿ‘‘


๐Ÿ’œ OPTIONS ๐Ÿ’œ

Quick vibe check: arguments to long options are mandatory for short options too. The options are also sorted alphabetically by their long name, so they're super easy to find ๐Ÿงš

  • -c, --config โ€” this one issues a Read Enclosure Configuration ยฎ(READ BUFFER ID 0) cdb to the device, and it gets you a list of the enclosure hardware resources ๐ŸŒˆ
  • -d, --devstatus โ€” slays. It sends a Read Device Slot Status ยฎ(READ BUFFER ID 4) cdb, which tells you the current state of each drive or slot ๐Ÿ’–
  • -s, --encstatus โ€” sends a Read Enclosure Status ยฎ(READ BUFFER ID 1) cdb, which tells you how the components are operating ๐Ÿ”ฅ
  • -f, --flags โ€” sends a Read Global Flags ยฎ(READ BUFFER ID 5) cdb and reads the most recent state of the global flags on the RAID processor device ๐Ÿฆ‹
  • -h, --help โ€” prints the usage message, then exits ๐Ÿซถ
  • -H, --hex โ€” prints the response to a READ BUFFER command in ASCII hex to stdout. Use it once and you get the response to the first READ BUFFER command (buffer_id=0), which should be the enclosure configuration. Use it twice (or more) and you get the responses to the later READ BUFFER commands too ๐Ÿ“
  • -i, --insertions โ€” sends a Read Device Insertions ยฎ(READ BUFFER ID 3) cdb, which counts how many times devices got inserted while the RAID system was powered on โœจ
  • -r, --raw โ€” prints the response to a READ BUFFER command in binary to stdout. Once gives you the first response (buffer_id=0, the enclosure configuration), and twice or more gives you the later responses as well ๐ŸŒธ
  • -u, --usage โ€” sends a Read Usage Statistics ยฎ(READ BUFFER ID 2) cdb to the device, and you get the total usage time and number of power-on cycles of the RAID device โญ
  • -v, --verbose โ€” turns up the verbosity (aka debug output) ๐Ÿ™ˆ
  • -V, --version โ€” prints the version string, then exits ๐Ÿ’…

๐Ÿฆ‹ NOTES ๐Ÿฆ‹

ngl, this implementation is based on the intermediate review document dated 19970414, named "SR041497.pdf". So yeah, it's pretty old ๐Ÿ’€ Intel and nStor are the authors. Intel has a zip archive with this and related documents in the "SAF-TE: SCSI Accessed Fault Tolerant Enclosures Interface Specification" section of this page: https://www.intel.com/content/www/us/en/servers/ipmi/ipmi-technical-resources.html

Lowkey, there's similar functionality in SPC-4 SCSI Enclosure Services (SES) devices (Peripheral device type 0xd), which you can query with the sg_ses utility ๐Ÿงš

๐Ÿ“ EXAMPLES ๐Ÿ“

To view the configuration:

sg_safte /dev/sg1

To view the device slot status:

sg_safte --devstatus /dev/sg1

๐ŸŒˆ EXIT STATUS ๐ŸŒˆ

If it works, sg_safte exits with 0 ๐ŸŽ‰ If not, check the sg3_utils(8) man page for the rest of the exit codes ๐Ÿซถ

๐Ÿ‘‘ AUTHORS ๐Ÿ‘‘

Written by Hannes Reinecke and Douglas Gilbert ๐Ÿ’–

๐Ÿ’Œ REPORTING BUGS ๐Ÿ’Œ

Found something broken? Report bugs to <dgilbert at interlog dot com> ๐Ÿ™ˆ

Copyright ยฉ 2004-2016 Hannes Reinecke and 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_inq, sg_ses (in sg3_utils package); safte-monitor (internet) โœจ


okay that's the whole tea โ˜• this page came from sg3_utils-1.43, April 2016. stay iconic, bestie ๐ŸŒธ๐Ÿ’œ๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from