$ sg_ses /dev/sdb
SEAGATE ST33000650SS
0002
disk device (not an enclosure)
Supported diagnostic pages:
Supported diagnostic pages [sdp] [0x0]
Protocol specific (SAS transport) [] [0x3f]
Translate address (SBC) [] [0x40]$ lsscsi -g
[1:0:0:0] disk
ATA
ST3320620AS 3.AA
/dev/sda /dev/sg0
[6:0:0:0] disk SEAGATE
ST33000650SS 0002 /dev/sdb
/dev/sg1
[6:0:1:0] disk SEAGATE
ST32000444SS 0006 /dev/sdc
/dev/sg2
[6:0:2:0] enclosu Intel
RES2SV240 0600
-
/dev/sg3/dev/sdd). On Linux the bsg
driver could also be used and its device node would be /dev/bsg/6:0:2:0
for the enclosure. Now let us try sg_ses on /dev/sg3 :$ sg_ses /dev/sg3
Intel
RES2SV240 0600
Supported diagnostic pages:
Supported diagnostic pages [sdp] [0x0]
Configuration (SES) [cf] [0x1]
Enclosure status/control (SES) [ec,es] [0x2]
String In/Out (SES) [str] [0x4]
Threshold In/Out (SES) [th] [0x5]
Element descriptor (SES) [ed] [0x7]
Additional element status (SES-2) [aes] [0xa]
Supported SES diagnostic pages (SES-2) [ssp] [0xd]
Download microcode (SES-2) [dm] [0xe]
Subenclosure nickname (SES-2) [snic] [0xf]$ sg_ses --index=0 --set=ident
/dev/sg3
$ sleep 5
$ sg_ses --index=0 --clear=ident
/dev/sg3
$ sg_ses -I 5 -S ident /dev/sg3
$ sleep 5
$ sg_ses -I 5 -C ident /dev/sg3
$ sg_ses --join /dev/sg3
$ sg_ses --join --filter /dev/sg3 sg_ses [options] DEVICE
| short
option |
long
option |
Brief
description |
| -b B1 |
--byte1=B1 |
byte 1 (2nd byte) of control
page set to B1. Only active with --control |
| -C STR |
--clear=STR |
clear value of field described by STR. Requires either --descriptor= or --index= option to choose an element. |
| -c |
--control |
send control information. That
information provided by --data= |
| -d H,H... | --data=H,H... |
H,H... is a string of ASCII hex bytes for control pages |
| -d - |
--data=- |
fetch that string of ASCII hex
bytes from stdin |
| -D DN | --descriptor=DN |
the Element Descriptor page
might contain DN. If so then this option is an alternative to --index=
option |
| -e |
--enumerate |
list recognized diagnostic page
codes and Element Type names. When used twice lists acronyms for the
--clear, --get and --set options. Ignores other options and DEVICE
argument |
| -f |
--filter |
reduce the amount of output when
displaying pages (e.g. Enclosure Status and the Additional Element
Status). |
| -G STR |
--get=STR |
get value of field described by
STR. Requires either --descriptor= or --index= option to choose an
element. |
| -h |
--help |
print usage message then exit |
| -H |
--hex |
print the read diagnostic page
in hexadecimal. Action varies depending on other options. For example
with the --get=STR option prints the output value in hex. |
| -i |
--inner-hex |
decode page and print element(s)
in hex |
| -I IIA |
--index=IIA | individual index ('-1' for
overall) or Element Type abbreviation (e.g. 'arr') |
| -I TIA,II |
--index=TIA,II |
TIA is Type Header index or
Element Type abbreviation; II is individual index ('-1' for overall) |
| -j |
--join |
group ("join") Enclosure Status,
Element Descriptor and Additional Element Status pages. Use twice to
add Threshold In page |
| -l |
--list |
same action as --enumerate |
| -p PG |
--page=PG |
SES diagnostic page code PG is
an abbreviation or a number in
decimal (prefix with '0x' (or 'h' suffix) for hex) |
| -r |
--raw |
print status page in ASCII hex
suitable for --data=- ; when used twice outputs page in binary to stdout |
| -S STR |
--set=STR |
set value of field described by STR. Requires either --descriptor= or --index= option to choose an element. |
| -s |
--status |
fetch status information. The
default action when no options given (including this one) is to display
the Supported Diagnostic Pages page |
| -v |
--verbose |
increase verbosity of output.
Use multiple times for more debug information |
| -V |
--version |
print version number and its
date then exit |

| Element
instances |
A --index= |
B --index= |
C --index= |
D --index= |
E --index= |
F --index= |
| Array Device Slot overall element |
0,-1 |
-1 |
arr,-1 |
arr |
_23,-1 |
_23 |
| Array Device Slot individual element 0 |
0,0 |
0 |
arr,0 |
_23,0 |
||
| Array Device Slot individual element 1 |
0,1 |
1 |
arr,1 |
_23,1 |
||
| Array Device Slot individual element 2 |
0,2 |
2 |
arr,2 |
_23,2 |
||
| Power Supply (5v) overall element |
1,-1 |
ps,-1 |
ps |
_2,-1 |
_2 |
|
| Power Supply (5v) individual element 0 |
1,0 |
ps,0 |
_2,0 |
|||
| Power Supply (5v) individual element 1 |
1,1 |
ps,1 |
_2,1 |
|||
| Power Supply (12v) overall element |
2,-1 |
ps1,-1 |
ps1 |
_2_1,-1 |
_2_1 |
|
| Power Supply (12v) individual element 0 |
2,0 |
ps1,0 |
_2_1,0 |
|||
| Vendor Specific LED display overall element |
3,-1 |
_134,-1 |
_134 |
$ sg_ses --page=ed /dev/sg3
Element descriptor In diagnostic page:
generation code: 0x0
element descriptor by type list
Element type: Array device slot,
subenclosure id: 0 [ti=0]
Overall descriptor:
ArrayDevicesInSubEnclsr0
Element 0 descriptor:
ArrayDevice00
Element 1 descriptor:
ArrayDevice01
Element 2 descriptor:
ArrayDevice02
...$ sg_ses --index=arr,0 --set=ident /dev/sg3
$ sg_ses --descriptor=ArrayDevice00 --set=ident /dev/sg3
$ sg_ses --descriptor=xxx --set=ident /dev/sg3
descriptor name: xxx not found (check 'ed' page [0x7])

$ sg_ses --index=arr,5 --set=ident /dev/sg3
$ sg_ses --index=arr,5 --set=ident=1 /dev/sg3
$ sg_ses --index=arr,5 --set=ident --page=ec /dev/sg3
$ sg_ses --index=5 --set=ident /dev/sg3$ sg_ses --index=arr,5 --set=2:1 /dev/sg3
$ sg_ses --index=arr,5 --set=2:1=1 /dev/sg3
$ sg_ses --index=arr,5 --set=2:1:1=1 /dev/sg3$ sg_ses -ee
--clear, --get, --set acronyms for enclosure status/control [0x2] page:
...
ident [Device slot] [2:1:1]
ident [Array device slot] [2:1:1]
ident [Power supply] [1:7:1]
ident [Cooling] [1:7:1]
...
locate [Device slot] [2:1:1]
locate [Array device slot] [2:1:1]
locate [Power supply] [1:7:1]
locate [Cooling] [1:7:1]
...$ sg_ses --index=ps,0 --set=ident /dev/sg3$ sg_ses --page=str /dev/bsg/6:0:2:0$ sg_ses --page=str --raw /dev/bsg/6:0:2:0 > t$ sg_ses --page=str --control --data=- /dev/bsg/6:0:2:0 < t$ sg_ses --page=str /dev/bsg/6:0:2:0$ sg_ses --page=es --raw /dev/bsg/6:0:2:0 > t
$ sg_ses --page=ec --byte1=0x8 --control --data=-
/dev/bsg/6:0:2:0 < tReturn to main page.
Last updated: 19th January 2012