$ 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
). In 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 --dev-slot-num=0 --set=ident /dev/sg3
$ sleep 10
$ sg_ses --dsn=0 --clear=ident /dev/sg3
$ sg_ses -x 5 -S ident /dev/sg3
$ sleep 10
$ sg_ses -x 5 -C ident /dev/sg3
$ sg_ses --join /dev/sg3
$ sg_ses --join --filter /dev/sg3
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 an indexing option to choose an element. |
-c |
--control |
send control information.
That information is provided by --data= option |
-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 (or binary if '-rr' is also
given) |
-d @FN |
--data=@FN |
FN is a file name containing ASCII hex bytes
(or binary if '--raw --raw' is given) |
-D DES | --descriptor=DES |
for indexing: find element
whose Element Descriptor page's name entry matches DES.
Implies --join |
-x SN |
--dev-slot-num=SN --dsn=SN |
for indexing: find element whose Additional
Element status page's device slot number entry matches SN.
Implies --join. Found in sg_ses version 1.79 and
later (from sg3_utils version 1.38). The --dsn
synonym was added in sg_ses version 1.94 . |
-E=A_F |
--eiioe=A_F |
A_F is either 'auto' or 'force'. Prior to the EIIOE bit's introduction in ses3r06 several arrays acted as if this bit was present and set. If 'force' is given the Additional Element Status page's element index field is treated as if EIIOE=1. If 'auto' is given a heuristic is used to decide whether to set EIIOE or not. Found in sg_ses version 1.88 and later (from sg3_utils version 1.39). |
-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). Use twice to further reduce
output |
-G STR |
--get=STR |
get value of field described
by STR. Requires an indexing 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. Use '-HHH' or '-HHHH'
to output ASCII hex suitable for '--data=@FN' in a
later invocation |
-I IIA |
--index=IIA | individual index ('-1' for
overall) or Element Type abbreviation (e.g. 'arr'). Range of
indexes can also be given (e.g. --index=3-5
matches array index 3, 4 and 5) |
-I TIA,II |
--index=TIA,II |
TIA is Type Header
index or Element Type abbreviation; II is
individual index ('-1' for overall) |
-i |
--inner-hex | decode page and print element(s) in hex |
-j |
--join |
group (or "join") Enclosure
Status, Element Descriptor and Additional Element Status
pages. Use twice to add Threshold In page |
-l |
--list |
same action as --enumerate |
-M |
--mask |
--clear and --set do a
read (status element), mask, modify, write cycle attempting
to preserve other settings in the element. The mask step
zeros parts of the status element that are reserved (or
different) in the control element. This option drops the
mask step. Prior to sg_ses version 1.99 (in sg3_utils
version 1.40), there was no mask step. |
-m LEN | --maxlen=LEN | maximum response length in bytes. Default is 65532 which may be too large for old systems |
-N SEID |
--nickid=SEID |
SEID is subenclosure identifier
(default: 0 (which is primary enclosure)) |
-n SEN | --nickname=SEN | SEN is the new subenclosure nickname |
-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). Use '--page=all'
to output all diagnostics pages whose page numbers are 0x2f
and lower (i.e. all SES dpages plus page 0x0) |
-q |
--quiet |
suppress some output messages |
-r |
--raw |
print status page in ASCII
hex suitable for --data=- ; when used twice
outputs page in binary to stdout |
-R |
--readonly |
open DEVICE read-only (default: open it
read-write) |
-A SA |
--sas-addr=SA |
for indexing: find element whose Additional Element status page's SAS address entry matches SA. Will only match device slot and array device slot elements. Implies --join . Found in sg_ses version 1.79 and later (from sg3_utils version 1.38). |
-S STR |
--set=STR |
set value of field described by STR. Requires an indexing option to choose an element. |
-s |
--status |
fetch status information. The
default action when no options given is to display the
Supported Diagnostic Pages page. If this is the only option,
the action is the same. |
-v |
--verbose |
increase verbosity of output.
Use multiple times for more debug information |
-V |
--version |
print version number and its
date then exit |
-w |
--warn |
warn about join problems and some other
issues. Output is sent to stderr |
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 list (grouped by type):
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 --index=3-5 --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 < t
Return to main page.
Last updated: 20th March 2018