1SG_IDENT(8) SG3_UTILS SG_IDENT(8)
2
3
4
6 sg_ident - send SCSI REPORT/SET IDENTIFYING INFORMATION command
7
9 sg_ident [--ascii] [--clear] [--help] [--itype=IT] [--raw] [--set]
10 [--verbose] [--version] DEVICE
11
13 Send a SCSI REPORT IDENTIFYING INFORMATION or SET IDENTIFYING INFORMA‐
14 TION command to DEVICE. Prior to SPC-4 (revision 7) these commands were
15 called REPORT DEVICE IDENTIFIER and SET DEVICE IDENTIFIER respectively.
16 SCSI devices that support these two commands allow users to write (set)
17 identifying information and report it back at some later time. The
18 information is persistent (i.e. stored on some non-volatile medium
19 within the SCSI device that will survive a power outage).
20
21 Typically the space allocated for the information is limited: SPC-4
22 (revision 7) states that for information type 0, the minimum length is
23 64 bytes and the maximum is 512 bytes. For other information types (1
24 to 126 inclusive) the maximum length is 256 bytes. Also information
25 types 1 to 126 (inclusive) should contain a null terminated UTF-8
26 string. The author has seen older disks that only support 16 bytes.
27
28 The default action when no options are given is to invoke the Report
29 Identifying Information command with the information type defaulting to
30 zero. Error reports are sent to stderr. By default the information is
31 shown in ASCII-HEX (up to 16 bytes per line) with an ASCII representa‐
32 tion to the right with dots replacing non printable characters.
33
35 Arguments to long options are mandatory for short options as well.
36
37 -A, --ascii
38 invokes the Report Identifying Information command and if any‐
39 thing is found interprets it as ASCII (or UTF-8 depending on the
40 locale) and prints the information to stdout.
41
42 -C, --clear
43 invokes the Set Identifying Information command with an informa‐
44 tion length of zero. This has the effect of clearing the exist‐
45 ing information.
46
47 -h, --help
48 output the usage message then exit.
49
50 -i, --itype=IT
51 where IT is the information type. Defaults to zero. The maximum
52 value is 127 which is special and cannot be used with --set or
53 --clear. The information type of 127 (if supported) causes the
54 REPORT IDENTIFYING INFORMATION command to respond with a list of
55 available information types and their maximum lengths in bytes.
56 The odd numbered information types between 3 and 125 (inclusive)
57 are not to be used (as they clash with the SCC-2 standard).
58
59 -r, --raw
60 invokes the Report Identifying information command and if any‐
61 thing is found sends the information (which may be binary) to
62 stdout. Nothing else is sent to stdout however error reports, if
63 any, are sent to stderr.
64
65 -S, --set
66 first reads stdin until an EOF is detected then invokes the Set
67 Identifying Information command to set what has been fetched
68 from stdin as the information. The amount of data read must be
69 between 1 and 512 bytes length (inclusive).
70
71 -v, --verbose
72 increase the level of verbosity, (i.e. debug output).
73
74 -V, --version
75 print the version string and then exit.
76
77 This utility permits users to write their own identifying information
78 to their SCSI devices. There are several other types of descriptors (or
79 designators) that the user cannot change. These include the SCSI
80 INQUIRY command with its standard vendor and product identification
81 strings and the product revision level; plus the large amount of infor‐
82 mation provided by the "Device Identification" VPD page (see sg_vpd).
83 There is also the READ MEDIA SERIAL NUMBER command (see sg_rmsn). The
84 MMC-4 command set for CD and DVDs has a "media serial number" feature
85 (0x109) [and a "logical unit serial number" feature]. These can be
86 viewed with the sg_get_config utility.
87
89 First, to see if there is an existing information whose format is
90 unknown (for information type 0), use no options:
91
92 # sg_ident /dev/sdb
93 00 31 32 33 34 35 36 37 38 39 30 1234567890
94
95 If it is ASCII then it can printed as such:
96
97 # sg_ident --ascii /dev/sdb
98 1234567890
99
100 The information can be copied to a file, cleared and then re-asserted
101 with this sequence:
102
103 # sg_ident --raw /dev/sdb > t
104 # sg_ident --clear /dev/sdb
105 # cat t | sg_ident --set /dev/sdb
106
108 The exit status of sg_ident is 0 when it is successful. Otherwise see
109 the sg3_utils(8) man page.
110
112 Written by Douglas Gilbert.
113
115 Report bugs to <dgilbert at interlog dot com>.
116
118 Copyright © 2005-2012 Douglas Gilbert
119 This software is distributed under a FreeBSD license. There is NO war‐
120 ranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR‐
121 POSE.
122
124 sg_vpd(sg3_utils), sg_rmsn(sg3_utils), sg_get_config(sg3_utils)
125
126
127
128sg3_utils-1.35 November 2012 SG_IDENT(8)