SG_SAFTE(8)
โจ 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 ๐ฅ
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
- 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
- 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