�ɲɾ�����ӯ�����һ��ˣ��������С���˴��ͣ�������P���ҹ��ñ˽��ά�Բ��������˸߸ԣ�������ơ��ҹ��ñ�����ά�Բ���ˡ���˳^�ӣ������ӡ� ���ͯj�ӣ��ƺ���ӣ� ? PNG ?%k25u25%fgd5n!? PNG ?%k25u25%fgd5n!? PNG ?%k25u25%fgd5n!? PNG ?%k25u25%fgd5n!AUTHORS000064400000000162152526361340005622 0ustar00Douglas Gilbert See the CREDITS file for the names of those who have contributed. COVERAGE000064400000015734152526361340005703 0ustar00 Command coverage ================ The following table lists SCSI commands in alphabetical order on the left and the sg3_utils (or related) utilities that implement invocations of them on the right. The second table lists supported ATA commands. The third table list supported NVMe commands. SCSI command sg3_utils utilities that use this SCSI command ------------ ------------------------------------------------- ATA COMMAND PASS-THROUGH(12) sg_sat_identify, ++ ATA COMMAND PASS-THROUGH(16) sg_sat_identify, sg_sat_set_features, sg_sat_phy_event, sg_sat_read_gplog ++ [sg_sat_chk_power, sg__sat_identify, sg__sat_set_features, sg_sat_smart_rd_data (previous four in the examples directory)] ATA COMMAND PASS-THROUGH(32) sg_sat_identify, ++ BACKGROUND CONTROL sg_bg_ctl CLOSE ZONE sg_zone COMPARE AND WRITE sg_compare_and_write COPY OPERATION ABORT ddptctl, ++ EXTENDED COPY(LID1) sg_xcopy, ddpt, ++ GET CONFIGURATION sg_get_config, ++ GET LBA STATUS sg_get_lba_status, ++ GET STREAM STATUS sg_stream_ctl INQUIRY sg_dd, sg_format, sg_inq, sginfo, sg_logs, sg_map('-i'), sg_modes, sg_opcodes, sg_persist, sg_scan, sg_ses, sg_vpd ++ FINISH ZONE sg_zone FORMAT MEDIUM sg_format, ++ [SSC] FORMAT UNIT sg_format, ++ [SBC] LOG SELECT sg_logs('-r' or '-select'), ++ LOG SENSE sg_logs, ++ MODE SELECT(6) sdparm, sg_wr_mode, sginfo, sg_format, sg_emc_trespass, sg_rdac, ++ MODE SELECT(10) sdparm, sg_wr_mode, sginfo, sg_format, sg_emc_trespass, sg_rdac, ++ MODE SENSE(6) sdparm, sg_modes, sg_wr_mode, sginfo, sg_format, sg_senddiag('-e'), sg_rdac, ++ MODE SENSE(10) sdparm, sg_modes, sg_wr_mode, sginfo, sg_format, sg_senddiag('-e'), sg_rdac, ++ OPEN ZONE sg_zone ORWRITE(16) sg_write_x ORWRITE(32) sg_write_x PERSISTENT RESERVE IN sg_persist, ++ PERSISTENT RESERVE OUT sg_persist, ++ POPULATE TOKEN ddpt, ddptctl, ++ PRE-FETCH(10) sg_seek PRE-FETCH(16) sg_seek PREVENT ALLOW MEDIUM REMOVAL sg_prevent, ++ READ(6) sg_dd, sgm_dd, sgp_dd, sg_read READ(10) sg_dd, sgm_dd, sgp_dd, sg_read READ(12) sg_dd, sgm_dd, sgp_dd, sg_read READ(16) sg_dd, sgm_dd, sgp_dd, sg_read READ ATTRUBUTE sg_read_attr READ BLOCK LIMITS sg_read_block_limits, ++ READ BUFFER(10) sg_rbuf, sg_test_rwbuf, sg_read_buffer, sg_safte, ++ READ BUFFER(16) sg_read_buffer READ CAPACITY(10) sg_readcap, sg_dd, sgm_dd, sgp_dd, sg_format, ++ READ CAPACITY(16) sg_readcap, sg_dd, sgm_dd, sgp_dd, sg_format, ++ READ DEFECT(10) sginfo('-d' or '-G'), sg_reassign('-g'), smartmontools, ++ READ DEFECT(12) sginfo('-d' or '-G'), smartmontools READ LONG(10) sg_read_long, sg_dd, ++ READ LONG(16) sg_read_long, ++ READ MEDIA SERIAL NUMBER sg_rmsn, ++ REASSIGN BLOCKS sg_reassign, ++ RECEIVE COPY DATA(LID1) sg_copy_results, ++ RECEIVE COPY FAILURE DETAILS(LID1) sg_copy_results, ++ RECEIVE COPY OPERATING PARAMETERS ddpt, sg_copy_results, sg_xcopy, ++ RECEIVE COPY STATUS(LID1) sg_copy_results, ++ RECEIVE DIAGNOSTIC RESULTS sg_senddiag, sg_ses, sg_ses_microcode ++ RECEIVE ROD TOKEN INFORMATION ddpt, ddptctl ++ REPORT ALL ROD TOKENS ddptctl ++ REPORT IDENTIFYING INFORMATION sg_ident, ++ (2) REPORT LUNS sg_luns, ++ REPORT REFERRALS sg_referrals, ++ REPORT SUPPORTED OPERATION CODES sg_opcodes REPORT SUPPORTED TASK MANAGEMENT FUNCTIONS sg_opcodes REPORT TARGET PORT GROUPS sg_rtpg, sg_stpg ++ REPORT TIMESTAMP sg_timestamp REPORT ZONES sg_rep_zones REQUEST SENSE sg_requests, ++ RESET WRITE POINTER sg_reset_wp SANITIZE sg_sanitize SEEK(10) sg_seek ++ SEND DIAGNOSTIC sg_senddiag, sg_ses, sg_ses_microcode ++ SEQUENTIALIZE ZONE sg_zone SET IDENTIFYING INFORMATION sg_ident, ++ (3) SET TARGET PORT GROUPS sg_stpg, ++ SET TIMESTAMP sg_timestamp START STOP sg_start, ++ STREAM CONTROL sg_stream_ctl SYNCHRONIZE CACHE(10) sg_sync, sg_dd, sgm_dd, sgp_dd, ++ SYNCHRONIZE CACHE(16) sg_sync++ TEST UNIT READY sg_turs, sg_format, ++ UNMAP sg_unmap, ++ VERIFY(10) sg_verify, ++ VERIFY(16) sg_verify, ++ WRITE(6) sg_dd, sgm_dd, sgp_dd WRITE(10) sg_dd, sgm_dd, sgp_dd WRITE(12) sg_dd, sgm_dd, sgp_dd WRITE(16) sg_dd, sgm_dd, sgp_dd, sg_write_x WRITE(32) sg_write_x WRITE AND VERIFY(10) sg_write_verify WRITE AND VERIFY(16) sg_write_verify WRITE ATOMIC(16) ddpt, sg_write_x WRITE ATOMIC(32) sg_write_x WRITE BUFFER sg_test_rwbuf, sg_write_buffer, ++ WRITE LONG(10) sg_write_long, ++ WRITE LONG(16) sg_write_long, ++ WRITE SAME(10) sg_write_same WRITE SAME(16) sg_write_same, sg_write_x WRITE SAME(32) sg_write_same, sg_write_x WRITE SCATTERED(16) sg_write_x WRITE SCATTERED(32) sg_write_x WRITE STREAM(16) sg_write_x WRITE STREAM(32) sg_write_x WRITE USING TOKEN ddpt, ddptctl, ++ sg_raw ATA command sg3_utils utilities that use this (S)ATA command ----------- ------------------------------------------------ CHECK POWER MODE examples/sg_sat_chk_power IDENTIFY DEVICE sg_inq, sg_scan, sg_sat_identify, examples/sg__sat_identify IDENTIFY PACKET DEVICE sg_inq, sg_sat_identify, examples/sg__sat_identify READ LOG EXT sg_sat_phy_event, examples/sg__sat_phy_event sg_sat_read_gplog READ LOG DMA EXT sg_sat_read_gplog SET FEATURES sg_sat_set_features examples/sg__sat_set_features SMART READ DATA examples/sg_sat_smart_rd_data NVMe command sg3_utils utilities that use this NVMe command ------------ ------------------------------------------------ IDENTIFY sg_inq SES READ sg_senddiag, sg_ses (NVME-MI command) SES WRITE sg_senddiag, sg_ses (NVME-MI command) Device self-test [SNTL of SEND DIAGNOSTIC] sg_senddiag Get features(power management) [SNTL of REQUEST SENSE] sg_requests ++ command wrapper found in sg_cmds_basic.c, sg_cmds_mmc.c or sg_cmds_extra.c for this command (2) this command was known as REPORT DEVICE IDENTIFIER prior to spc4r07 (3) this command was known as SET DEVICE IDENTIFIER prior to spc4r07 Note that any SCSI command, including bi-directional and variable length commands (whose cdb size is > 16 bytes) can be issued by the sg_raw utility. The RECEIVE COPY * commands in SPC-4 were grouped as one command name with 4 service actions in SPC-3 and earlier. The single SPC-3 command name is RECEIVE COPY RESULTS. The two opcodes associated with all EXTENDED COPY commands are now known as THIRD PARTY COPY IN (0x84) and THIRD PARTY COPY IN (0x83). Douglas Gilbert 6th May 2018 COPYING000064400000002725152526361340005614 0ustar00 Upstream Authors: Douglas Gilbert , Bruce Allen , Peter Allworth , James Bottomley , Lars Marowsky-Bree , Kurt Garloff , Grant Grundler , Christophe Varoqui , Michael Weller , Eric Youngdale Copyright: This software is copyright(c) 1994-2012 by the authors Most of the code in this package is covered by a BSD license. On Debian systems, the complete text of the BSD License can be found in `/usr/share/common-licenses/BSD'. All the code in the library (usually called libsgutils) is covered by a BSD license. Some of the older utilities are covered by the GPL. More precisely: You are free to distribute this software under the terms of the GNU General Public License either version 2, or (at your option) any later version. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL-2 file. The later GPL-3 is found in /usr/share/common-licenses/GPL-3 file but no code in this package refers to that license. Douglas Gilbert 10th April 2012 README000064400000066511152526361340005444 0ustar00 README for sg3_utils ==================== Introduction ============ This package contains low level command line utilities for devices that use the SCSI command set. Originally the SCSI command set was associated exclusively with the SCSI Parallel Interface (SPI) transport. SPI has now almost been completely replaced by the Serial Attached SCSI (SAS) transport which also accepts the SCSI command set. Additionally many other storage related transports use the SCSI command set (amongst others); examples are ATAPI devices (CD/DVDs and tapes), USB mass storage devices (including those using the newer UAS[P]), Fibre Channel disks, IEEE 1394 storage devices (SBP protocol), iSCSI, FCoE and SOP devices. Even NVMe which has its own command set accepts SCSI commands in some contexts; one example is for enclosure management where NVME-MI has SES Send and SES Receive commands. SES refers to the SCSI Enclosure Services command set. This package originally targeted the Linux SCSI subsystem. Since most operating systems contain a SCSI command pass-through mechanism, many utilities within this package have been ported. This README mainly concentrates on Linux: see the README.freebsd file for the FreeBSD port, README.solaris for the Solaris port, the README.tru64 file for the Tru64 (OSF) port and README.win32 for the Windows ports (of which there are two variants). Most utilities within the sg3_utils package work at the SCSI command level. For example the sg_inq utility issues a SCSI INQUIRY command and decodes the response. The COVERAGE file has a table containing a row for each SCSI command issued by this package; to the right of each row is the utility (sometimes more than one) that issue that SCSI command. The COVERAGE file has a second table for ATA commands usage. Some utilities interface at a slightly higher level, for example: sg_dd, sgm_dd and sgp_dd. These are closely related to the Unix dd command and typically issue a sequence of SCSI READ and WRITE commands to copy data. These utilities are relatively tightly bound to Linux and are not ported to other Operating Systems. A new utility called ddpt (in a package of the same name) is more generic while still allowing a copy to be done in terms of SCSI READ and WRITE commands. ddpt has been ported to other OSes. License ======= All utilities and libraries have either a "2 clause" BSD license or are "GPL-2ed". The "2 clause" BSD license is taken from the FreeBSD project but drops the last paragraph that directly refers to the "FreeBSD project". That BSD license was updated from the "3 clause" to the newer "2 clause" version on 20180119. To save space various source code files refer to a file called "BSD_LICENSE" in the main, src and lib directories. The author's intention is that users may incorporate all or part of the code in their work as they please. Attribution is encouraged. Please check the code as other contributors (apart from the author) may also have copyright notices. For a list of contributors see the CREDITS file. Description =========== A web site supporting the sg3_utils package can be found at http://sg.danny.cz/sg/sg3_utils.html . That page has a table of released versions for download. The most recent release or beta of sg3_utils may be found on this page: http://sg.danny.cz/sg in the News section. The predecessor to this package was called sg_utils. It is described in http://sg.danny.cz/sg/uu_index.html and old versions can be downloaded from the Downloads section of http://sg.danny.cz/sg . In the Linux 2.4 kernel series these utilities need to use the SCSI generic (sg) driver to access SCSI devices. The name of this package (i.e. sg3_utils) refers to version 3 of the SCSI generic (sg) driver which was introduced at the beginning of the 2.4 Linux kernel series. Significantly this added a new SCSI command interface structure (i.e. struct sg_io_hdr) that is more flexible than the older "sg_header" structure found in the sg driver in the 2.2 and earlier Linux kernel series. The sg_io_hdr structure is also more flexible than the awkward (and limiting) interface to the SCSI_IOCTL_SEND_COMMAND ioctl supported by the Linux SCSI mid level. The version 3 sg driver also added the SG_IO ioctl that is synchronous (i.e. it issues the requested SCSI command and waits for the response (or a timeout) before the ioctl returns to the user space program that invoked it). The SG_IO ioctl is now supported in other parts of the Linux kernel in the 2.6 series. In sg3_utils version 1.27 support has been added for the Linux bsg driver which use the sg version 4 interface. There seems no point in renaming this package sg4_utils. The existing utilities just silently support either. Currently the source build must be able to see the /usr/include/linux/bsg.h file. Then at run time the /proc/devices pseudo file needs to have an entry for the bsg driver (appeared around lk 2.6.28). With this in place each utility at run time checks the device it has been given and if it is a char device whose major number matches the bsg entry in /proc/devices then the sg v4 interface is used. Otherwise the sg v3 interface is used. Utilities that wish to use the asynchronous SCSI command interface (i.e. via a write() read() sequence) or issue special "commands" (e.g. bus and device resets) still need to use the Linux sg driver. Note that various drivers (e.g. cdrom/sr) have different open() flag and permissions policies that the user may need to take into account. If users have problems or questions about them please contact the author. Documentation for the Linux sg device driver can be found at: http://sg.danny.cz/sg/p/sg_v3_ho.html . This is written in DocBook and the original xml can be found in the same directory with the ".xml" extension. Postscript and pdf renderings are also in that directory. Older documentation for the sg version 3 driver can be found at: http://sg.danny.cz/sg/p/scsi_generic_v3.txt . To save the repetition of common code (e.g. SCSI error processing) and reduce the size of the executable files, a shared library called libsgutils.so (its Linux name) is created during the build process. That library is built from the contents of the include and lib subdirectories. The header files in the include subdirectory can be seen as the API of libsgutils and are commented with that in mind. The SCSI pass-through code for the supported operating systems is found in the lib subdirectory with names like sg_pt_linux.c and sg_pt_win32.c . Various distributions (of Linux mainly) distribute sg3_utils as 3 installable packages. One is a package containing the shared library discussed above (e.g. libsgutils2-2_1.33-0.1_i386.deb). A second package contains the utilities (e.g. sg3-utils_1.33-0.1_i386.deb) and depends on the first package). Finally there is an optional package that contains header files and a static library (e.g. libsgutils2-dev_1.33-0.1_i386.deb). This final package is only needed to build other packages (e.g. sdparm) that wish to use the sg3_utils shared library. All the utilities in the src subdirectory have "man" pages that are placed in the doc subdirectory. There is also a sg3_utils (8) man page that summarizes common facilities including exit statuses. Additional information (including each utility's version number) can be found towards the top of each ".c" file corresponding to the utility name. The sg driver in Linux can be seen as having 3 distinct versions: v1 lk < 2.2.6 sg_header based relatively unchanged since 1992 v2 lk >= 2.2.6 enhanced sg_header interface structure [1999/4/16] v3 lk >= 2.4 additional sg_io_hdr interface structure [2001/1/4] v3 lk >= 2.6 same interface as found in lk 2.4 [2.6.0: 2003/12/18] and the bsg driver supports the sg v4 interface and was added around lk 2.6.28 . This package is targeted at "v3" and "v4". Another package called "sg_utils" is targeted at "v2" and to a lesser extent "v1". The "sg_utils" package has a subset of the utilities found in this package. In Linux some sg driver ioctls (notably SG_IO) are defined for many block devices in lk 2.6 series. In practice this means all SCSI block devices, ATAPI block devices (mainly CD, DVD and BD optical devices) but _not_ ATA disks, depending on which kernel configuration options, can be accessed by the utilities in this package. SATA disks that use the libata kernel library (or some other SCSI to ATA Translation (SAT) Layer (SATL)) accept SCSI commands and thus are supported. Support for the SG_IO as been added to the scsi tape driver (st) in lk 2.6.6 . In the src directory the bulk of the utilities are written in relatively clean POSIX compliant C code with Linux specific system calls and structures removed and placed in Linux specific files in the lib directory. A small number of utilities in the src directory do contain Linux specific logic and are not ported to other OSes (e.g. sg_dd). One utility, sg_scan, has two separate implementations, one for Linux (sg_scan_linux.c) and one for Windows (sg_scan_win32.c). The src-lib directory split approach allows FreeBSD, Solaris, Tru64 and Windows specific code to be isolated to a few files in the lib directory whose interfaces match those of the Linux specific code. Darwin is not supported because the Apple folks do not want to give their users a pass-through SCSI interface. The author has read about creative hackers using a VM containing a real OS to circumvent the Apple restriction. C standard is C11 ================== The C code in this package is written for portability rather than speed. It assumes a level of C99 compliance (the C standard prior to C11) and favours POSIX system and library calls over OS specific calls. The C code is written in a C++ friendly way and is checked from time to time that it compiles clean with C++. To accommodate C++ certain C99 constructs such as designated initializers cannot be used. The author has not seriously attempted to build this code on MSVC (aka Visual Studio). There are a few roadblocks (that may be overcome in the future) that include MSVC being basically a C++ compiler, not a C/C++ compiler. For some reason MSVC only claims C89 compliance (i.e. the first C standard from 1989). MSVC 2013 and 2015 are moving closer to C99 compliance and may be sufficient to compile this package. Another problem is the assumption of the availability of basic Unix system calls such as open(). Nearly 20 years ago Microsoft indicated (promised ?) that it would move in the direction of POSIX compliance, but very little ever happened. "Talk is cheap, there should be a tax on it." Building ======== This package is designed to be built with the usual: "./configure ; make ; make install" sequence. In some situations that may need to be prefixed by a call to the "./autogen.sh" script which invokes autoconf and automake. That in turn may require packages containing those utilities to be installed. The libtool utility is also required. Naturally a C compiler is required and due to the vagaries of libtool a C++ compiler also. The "./configure" takes many command line options with the defaults being usually sufficient to start with. One quirk is that the location of the installation is under the /usr/local directory. So the sg_inq utility will be installed at /usr/local/bin/sg_inq . This is controlled by the "--prefix=" option which defaults to "--prefix=/usr/local". As an example to install the executables in /usr/bin and disable the creation of the shared library (libsgutils.so) this invocation could be used: "./configure --prefix=/usr --disable-shared". To reduce the size of an executable as well try this: "./configure --prefix=/usr --disable-shared --disable-scsistrings". Also --disable-shared will produce (realtively) "static" executables in the src directory that are easier to debug. And "./configure --enable-debug" will compile with more debug type options, including more compiler checks and defining "DEBUG" within the src and lib source files. Most utilities in the src directory set '-vv' (i.e. equivalent to calling "--verbose" twice) when "DEBUG" is set. In Linux there are package build files for "rpm" based and for "deb" based systems. The 'sg3_utils.spec' file in the main directory can be used like this: 'rpmbuild -ba sg3_utils.spec' in a rpmbuild tree SPECS directory. To cross build or make a more widely distributable package then the --target option may be useful: 'rpmbuild --target=i386 -ba sg3_utils.spec' or 'rpmbuild --target=x86_64 -ba sg3_utils.spec' . The sg3_utils.spec file in the main directory targets Red Hat systems, an alternative "spec" file for Suse systems has been placed under the 'suse' directory. The 'build_debian.sh' script should build several "deb" packages and place them in the parent directory. In debian based systems doing a 'apt-get install build-essential' is one way to get most of build environment needed if it has not already been loaded. There are now some problems with this script and the superseded Debian 4.0 ("etch"). See debian/README.debian4 for a workaround. Amongst other things debian builds are sensitive to the value in the debian/compat file. If it contains "7" then it works on lenny and gives warning on squeeze (but fails on the earlier etch). Warning ======= Many devices use SCSI command sets over transport protocols not normally associated with SCSI (as defined at http://www.t10.org ). Some of these devices react poorly (e.g. lock up) when sent SCSI commands that they don't support. Even sending a supported SCSI command with a field set to an unexpected value can cause problems. [The author is talking about billions of USB devices with horrible SCSI implementations.] For example, all "SCSI" devices must support the INQUIRY command which the SCSI-2 standard says should request a 36 byte response. However later SCSI standards (e.g. SPC-2) have increased that length but some SCSI devices lock up when they receive a request for anything other than a 36 byte response. Any well implemented "SCSI" device should react sensibly when a utility in sg3_utils sends a SCSI command that it doesn't support. Unfortunately this cannot be guaranteed. Prior to lk 2.6.29 USB mass storage limited sense data to 18 bytes which caused problems for certain types of descriptor based sense data. An example of this is the SCSI ATA PASS-THROUGH command with the CK_COND bit set. Utilities ========= Here is list in alphabetical order of utilities found in the 'src' subdirectory of the sg3_utils package: sginfo, sg_bt_ctl, sg_compare_and_write, sg_copy_results, sgm_dd, sgp_dd, sg_dd, sg_decode_sense, sg_emc_trespass, sg_format, sg_get_config, sg_get_lba_status, sg_ident, sg_inq, sg_logs, sg_luns, sg_map, sg_map26, sg_modes, sg_opcodes, sg_persist, sg_prevent, sg_raw, sg_rbuf, sg_rdac, sg_read, sg_read_attr, sg_readcap, sg_read_block_limits, sg_read_buffer, sg_read_long, sg_reassign, sg_referrals, sg_request, sg_reset, sg_rmsn, sg_rtpg, sg_safte, sg_sanitize, sg_sat_identify, sg_sat_phy_event, sg_sat_read_gplog, sg_sat_set_features, sg_scan, sg_seek, sg_senddiag, sg_ses, sg_ses_microcode, sg_start, sg_stpg, sg_stream_ctl, sg_sync, sg_test_rwbuff, sg_timestamp, sg_turs, sg_unmap, sg_verify, sg_vpd, sg_write_buffer, sg_write_long, sg_write_same, sg_write_verify, sg_write_x, sg_wr_mode, sg_xcopy, sg_zone Each of the above utilities depends on header files found in the 'include' subdirectory and library code found in the 'lib' subdirectory. Associated man pages are found in the 'doc' subdirectory. Additional programs found in the 'archive', 'examples' and 'utils' subdirectories in not build by the top level build infrastructure. Linux binary distributions of the sg3_utils package (e.g. "rpm" and debian packages) typically contain the shared library, the utilities found in the 'src' subdirectory, their associated man pages and some documentation files (e.g. README, INSTALL, CREDITS, COPYING and COVERAGE). See the INSTALL file for generic instructions about building with autotools (e.g. ./configure ). Man pages can be read (without building and installing the package) by going to the 'doc' subdirectory and executing something like this: $ man ./sg_dd.8 To see which SCSI commands (and ATA commands) are used by these utilities refer to the COVERAGE file. Here is a list in alphabetical order of utilities found in the 'examples' subdirectory: - sg_excl, scsi_inquiry, sg_sat_chk_power, sg__sat_identify, sg__sat_phy_event, sg__sat_set_features, sg_sat_smart_rd_data, sg_simple1, sg_simple2, sg_simple3, sg_simple4, sg_simple5, sg_simple16 Also in that subdirectory is a script to test sg_persist, an example data file for sg_persist (called "transport_ids.txt") and an example data file for sg_reassign (called "reassign_addr.txt"). There are several scripts for 'sg_senddiag -pf -raw=-' that will put some SAS disk phys into a "compliant jitter tolerance pattern" (CJTPAT). The 'testing' subdirectory contains source and a Makefiles to test kernel pass-through and associated drivers, mainly for Linux. There is both C code (with the extension ".c") and C++ code (with the extension ".cpp"). There is a "Makefile" to build the C code and a "Makefile.cplus" to build the C++ code. Both depend on some object files from the "lib" subdirectory. So a sequence like this may be required prior to invoking one of the Makefiles in the directory: "cd ; ./configure ; cd lib ; make ; cd ../testing". Here is a list in alphabetical order of utilities found in the 'testing' subdirectory: - bsg_queue_tst, sg_iovec_tst, sg_queue_tst, sg_sense_tst, sg_tst_async (C++), sg_tst_context (C++), sg_tst_excl (C++), sg_tst_excl2 (C++), sg_tst_excl3 (C++) The 'utils' subdirectory contains source and a Makefile to build "hxascdmp" which accepts binary data from stdin (or a file on the command line) and outputs an ASCII-HEX and ASCII representation of it. It is similar to the Unix od command. There is also code to sg_chk_asc.c which checks a given text file (typically a copy of http://www.t10.org/lists/asc-num.txt ) and checks it against the asc/ascq text strings held in sg_lib_data.c . The 'doc' subdirectory contains a README file containing the urls of various related documents. The 'scripts' subdirectory contains some Bourne (bash) shell scripts that rely on utilities in the main directory. One script uses the sdparm utility. These scripts are described in the scripts/README file and have usage messages. Notes for utilities without man pages ===================================== These utils are found in the 'examples' subdirectory. The "scsi_inquiry" program shows the use of the SCSI_IOCTL_SEND_COMMAND ioctl to send a SCSI INQUIRY command. That ioctl() is supported by the SCSI sub system mid level and so is common to all sd, sr, st and sg devices. That ioctl is deprecated in the lk 2.6 series. This program has been placed in the "examples" subdirectory. "sg_simple1" and "sg_simple2" are example programs demonstrating calls to the SCSI INQUIRY and TEST UNIT READY commands. They only differ in their error processing: sg_simple1 uses sg_lib.[hc] for error processing while sg_simple2 does its own more primitive checks. "sg_simple3" tests out user space scatter gather added to the version 3 sg driver. "sg_simple4" shows the INQUIRY command using mmap-ed IO to obtain its response buffer. "sg_simple5" also sends and INQUIRY and TEST UNIT READY commands. It uses the generic pass through mechanism based on sg_pt.h . It will currently build in Linux and FreeBSD (with "make -f Makefile.freebsd"). It has extensive error checking code. "sg_simple16" attempts to send a 16 byte SCSI command, READ_16, to the scsi device. This is only supported for lk >= 2.4.15 and for adapter drivers that indicate that they have 16 byte CDB capability (otherwise DID_ABORT will appear in the host_status). "sg_sat_chk_power" attempts to push an ATA CHECK POWER MODE command through the SAT-defined ATA PASS_THROUGH (16) SCSI command. That ATA command needs to read the "FIS" registers after the command is completed which involves using the ATA Status Return (sense data) descriptor (as defined in SAT). "sg_sat_smart_rd_data" attempts to push an ATA SMART/READ DATA command through the SAT-defined ATA PASS_THROUGH (16) SCSI command. If successful, the 256 word (512 byte) response is output. "sg_tst_excl" and "sg_tst_excl2" use multiple threads to bombard the given device with O_EXCL open flags, so only one should succeed at a time. While holding O_EXCL control a thread attempts a double increment on an integer in the given LBA. If the integer starts even (after the first read) then it should remain even if the O_EXCL flag is doing its job. The "sg_tst_excl" variant uses the Linux SG_IO v3 interface while the "sg_tst_excl2" uses the more generic sg_pt infrastructure. "sg_tst_excl3" is a variant of "sg_tst_excl2". "sg_tst_excl3" only does the double increment from the first thread, each time using O_EXCL on open. The remaining threads check the value is even, each time doing an open without the O_EXCL flag. "bsg_queue_tst" sends an INQUIRY command via the Linux SG_IO v4 interface which is used by the bsg driver. So it will take device names like "/dev/bsg/6:0:0:0". It tests if sending repeated INQUIRYs with the BSG_FLAG_Q_AT_HEAD or BSG_FLAG_Q_AT_TAIL flag makes any difference. "sg_tst_async" is a test harness for the Linux sg driver. It is multi threaded, submitting either TEST UNIT READY, READ(16) or WRITE(16) SCSI commands asynchronously. Each thread opens a file descriptor and submits those commands up to the queue limit (sg driver has a per file descriptor queue limit of 16). Multiple threads doing the same thing act as a multiplier to that queue limit. Command line processing ======================= These utilities can be divided into 3 groups when their handling of command line arguments is considered: - ad hoc, typically in a short form only, sometimes longer (e.g. "sg_logs -pcb /dev/sdc") - inspired by the dd Unix command (e.g. sg_dd, sgm_dd, sgp_dd, sg_read) - recent utilities use "getopt_long" (see "man getopt_long") type command lines. These have short form (starting with "-") and corresponding longer form (starting with "--") options. The older utilities that use ad hoc options, in alphabetical order: - sg_emc_trespass, sginfo(1/2), sg_inq, sg_logs, sg_map, sg_modes, sg_opcodes, sg_rbuf, sg_rdac, sg_readcap, sg_reset, sg_scan (Linux), sg_senddiag, sg_start, sg_test_rwbuf, sg_turs In sg3_utils version 1.23 the following utilities from this group were converted to have a dual getopt_long/ad_hoc interface, defaulting to the getop_long interface: - sg_inq, sg_logs, sg_modes, sg_opcodes, sg_rbuf, sg_readcap, sg_senddiag, sg_start, sg_turs These can be switched back to the older (backward compatible) ad hoc interface by defining the SG3_UTILS_OLD_OPTS environment variable or using '-O' as the first command line option. The more recent utilities that use "getopt_long" only are: - sg_bt_ctl, sg_compare_and_write, sg_decode_sense, sg_format, sg_get_config, sg_get_lba_status, sg_ident, sg_luns, sg_map26, sg_persist, sg_prevent, sg_raw, sg_read_attr, sg_read_block_limits, sg_read_buffer, sg_read_long, sg_reassign, sg_referrals, sg_requests, sg_rmsn, sg_rtpg, sg_safte, sg_sanitize, sg_sat_identify, sg_sat_phy_event, sg_sat_read_gplog, sg_sat_set_features, sg_scan(w), sg_seek, sg_ses, sg_ses_microcode, sg_stpg, sg_stream_ctl, sg_sync, sg_test_rwbuf, sg_timestamp, sg_unmap, sg_verify, sg_vpd, sg_write_buffer, sg_write_long, sg_write_same, sg_write_verify, sg_write_x, sg_wr_mode, sg_zone Dangerous code ============== This C code snippet: unsigned char uc = 0x80; uint64_t ull; ull = (uc << 24); Somewhat surprisingly sets ull to: ull: 0xffffffff80000000 This result is due to the 'unary conversion' of uc to a (32 bit signed) 'int' before the shift. The resultant type from the shift is also an int and it has its top bit set so there is sign extension when it is assigned into a 64 bit unsigned integer. Making sure there is no conversion to 'int' solves the problem. In this case if uc is declared as unsigned int the result will be as expected (i.e. 0x80000000). Bypassing the somewhat dangerous shift operators ================================================ The shift operators in C are "<<" and ">>". They can be dangerous (as shown in the above section) or tedious and hence error prone to use. However they are often needed to cope with the translation of integers on the host OS to the corresponding representation within a SCSI command or parameter data moved to or from a SCSI device. The Logical Block Address (LBA) is a good example; it is either 32 or 64 bits long typically (i.e. 4 or 8 bytes respectively). The host machine representation may be big or little endian and may prefer or require alignment to a particular memory address boundary (e.g. module 4 (or in 'C' code: "(lba % 4) == 0")). For SCSI commands and the parameter data moved to or from a SCSI device, the integer representation is big endian and it is unaligned. Recent versions of this package have replaced the explicit use of the C shift operators with a group of functions modelled on those found in the Linux kernel. These functions contain either "get_unaligned" or "put_unaligned" in their names and are found in the asm/unaligned.h header. This package contains the sg_unaligned.h header that implements a similar set of functions. The current implementation favours correctness over speed. The functions in the package use a "sg_" prefix but otherwise use the same function name as the Linux kernel for the same action. An example of the change made to a snippet of sg_write_buffer.c may clarify this change. The old code was: wbufCmdBlk[3] = (unsigned char)((buffer_offset >> 16) & 0xff); wbufCmdBlk[4] = (unsigned char)((buffer_offset >> 8) & 0xff); wbufCmdBlk[5] = (unsigned char)(buffer_offset & 0xff); and it has been replaced by: sg_put_unaligned_be24(buffer_offset, wbufCmdBlk + 3); The Linux kernel only supplies "unaligned" functions for 16, 32 and 64 bit quantities. SCSI commands also have cases of 24 and 48 bit numbers so sg_unaligned.h contains support for those plus a variant where the byte length is passed as an argument. The unaligned functions are inlined for speed (at the possible expense of space) and now have specializations depending whether the host is big or (more likely) little endian. These functions can be broken down to a memcpy() and optionally a byte-swap for 16, 32 and 64 bit operations. The memcpy() takes care of alignment while the byte-swap (bswap_16(), bswap_32() and bswap_64() ) addresses integer endianness. If the host is little endian and a little endian variant of the unaligned functions is requested, then no byte-swap is required. These specializations can be "compiled out" with this configure option: './configure --disable-fast-lebe' in which case the classic "C shifting" technique is used to implement all the unaligned functions. Associated with the above change, fixed length integer types seem a better fit for SCSI command and parameter integers than the traditional integer types in the C language. Fixed length integer types were standardized in C99 and require the inclusion of . For example this means for an integer that will represent a 64 bit LBA, to favour using "uint64_t" over the "unsigned long long" type. Also "unsigned char" has mostly been replaced by "uint8_t" as the 8 bit (unsigned) byte type; "char" is still used for ASCII text. Other SCSI and storage tools ============================ See http://sg.danny.cz/sg/tools.html Douglas Gilbert 28th June 2018 ChangeLog000064400000232326152526361340006335 0ustar00Each utility has its own version number, date of last change and some description at the top of its ".c" file. All utilities in the main directory have their own "man" pages. There is also a sg3_utils man page. Changelog for sg3_utils-1.44 [20180912] [svn: r791] - same code as release 1.43 20180911 svn rev 789; new release due to sync problem with git mirror at: https://github.com/hreinecke/sg3_utils that has a v1.43 tag dated 20160217 [svn: r663] Changelog for sg3_utils-1.43 [20180911] [svn: r789] - release 1.43 20180911 svn rev 789 - sg_write_x: where x can be normal, atomic, or(write), same, scattered, or stream writes with 16 or 32 byte cdbs (sbc4r04 for atomic, sbc4r11 for scattered) - sg_bg_ctl: new Background control command (sbc4r08) - sg_seek: new SEEK(10) or PRE-FETCH(10 or 16) - sg_stream_ctl: new, STREAM CONTROL or GET STREAM STATUS - sg_senddiag: add --timeout=SECS option - sg_sanitize: add --timeout=SECS option - add --dry-run option - sg_format: add --timeout=SECS option - add --dry-run option to bypass modifying behaviour - add --quick option to skip reconsideration time - extend --wait timeout to 40 hours for disk sizes > 4 TB and 80 hours if > 8 TB - when changing block size allow for Mode Select rejecting SP=1 (Save Page): repeat with SP=0 - FFMT tweaks: default CMPLST to false, shorten poll - make all data-in and data-out buffers page aligned - sg_decode sense: add --cdb and --err=ES options - sg_ses: handle 2 bit EIIOE field in aes dpage - increase join array size from 260 to 520 elements - add --quiet option to suppress messages - expand join handling of SAS connectors and others - expand join debug code - allow multiple --clear=, --get= and --set= options - allow individual index ranges (e.g. --index=3-5) - allow --index=IIA with -ee to enumerate only fields belonging to element type IIA - --data=@FN with --status now decodes dpage(s) in FN - add 'offset_temp' and 'rqst_override' to temperature sensor element type - add 'hw_reset' and 'sw_reset' to enclosure services controller electronics element type (18-047r1) - interpret '--join --page=aes' to only display join rows that have a corresponding AES dpage element - support NVMe attached enclosure via NVME-MI Send and Receive SES commands - decode array status diagnostic page (obsolete) - sync to ses4r01 - sg_ses_microcode: add --dry-run and -ealsd options - sg_ses, sg_ses_microcode, sg_senddiag: make all access buffer page size aligned (typically page_size=4096) - sg_write_buffer: add --dry-run option - sg_luns: resync with drafts (sam6r02+spc5r10) - remove undocumented test "W" format - accept and output on request "quad dashed" format - sg_logs: fix volume statistics lpage when subpage is zero (ssc5r02a); decode mount history log parameter - add --vendor=VP and '--pdt=DT' options - decode Requested recovery, TapeAlert response, and Service buffer information lpages for tape - add min+max 'mounted' temperature and rel. humidity fields to Environmental reporting lpage (spc5r10) - add last n Inquiry/Mode_page data changed log pages (spc5r17) - add zoned block device statistics lpage (zbc2r?, 16-264r4) - fixup enumeration in power condition transition log page (from H. Reinecke, Suse) - sg_inq: fix potential unbounded loop in --export - add --only to stop standard inquiry decoding also doing a serial number vpd page (0x80) fetch - update version descriptor list to 20170114 - add further checks so CDROM standard inquiry response doesn't trick --inhex into thinking it's VPD pg 0x80 - decode NVMe Identify controller/nsid commands - with NVMe --only restricts to a single Identify controller command - add --long which decodes more of the NVMe Identify command responses - sg_inq+sg_vpd: update Extended inquiry data vpd page (spc5r09 and 17-142r5) - block limits and block limit extension VPD pages: add extra info about corner cases - add maximum inquiry|mode_page change logs fields to extended inquiry vpd page (spc5r17) - both now return EDOM (adjusted sg error code) when requested page not in Supported VPD Pages page - add --force option to bypass checking Supported Vpd Pages page and fetch requested page directly - sg_vpd: 3 party copy VPD page improvements - fully implement Device constituents VPD page - decode some WDC/Hitachi vendor VPD pages - improve handling of unknown pages - sg_reassign+sg_write_same: fix ULONG_MAX problem - sg_rdac: add sanity checks for -f=lun value - sg_turs+sg_requests: make both accept '--num=NUM' and '--number=NUM' for mutual compatibility - sg_turs: add --low option - fix exit status when not ready in single case - sg_zone: fix debug cdb naming - add --sequentialize, --count=ZC options, zbc2r01b - sg_reset_wp add --count=ZC option, zbc2r01b - sg_persist: add --maxlen-LEN option, LEN defaults to decimal, similar to --alloc-length= which takes hex - add Replace lost reservation capable (RLR_C) bit in Report Capabilities (spc4r36) - sg_dd: add --dry-run and --verbose options - allow multiple short options (e.g. -dvv ) - sgp_dd: pthread_cancel() has issues in C++ (and the Android multi-threaded library doesn't supply it) so use pthread_kill() in its place [Linux only] - add --dry-run and --verbose options - sgm_dd: add --dry-run and --verbose options - sg_opcode: add '--enumerate' and '--pdt=' options - support CDLP (command duration limit page) - support MLU, Multiple Logical Units (18-045r1) - check resid and trim response if necessary - report when --no-inquiry is ignored - sg_raw: add --enumerate option - add --cmdfile=CF option, permit 64 byte NVMe admin commands to be sent - add --raw option (for CF in binary) - page align input and output buffers - sg_get_lba_status: add --report-type= option (sbc4r12) - add support for 32 byte cdb variant (sbc4r14) - add support for --element-id= and --scan-len= options (sbc4r14) - decode response's RTP and two more provisioning statuses and the additional status (sbc4r12) - decode completion condition (sbc4r14) - sg_modes: add Out of band management control mpage - accept acronym for page/subpage codes - sg_rep_zones: expand --help option information - sg_unmap: add --all=ST,RN[,LA] option to unmap large contiguous segments of a disk/ssd - add --dry-run and --force options - sg_wr_mode: add --rtd option for RTD bit - sg_timestamp: add '--no-timestamp' option - add --elapsed and --hex options - sginfo: don't open /dev/snapshot - introduce SG3_UTILS_DSENSE environment variable - manpages and usage messages: corrections from Gris Ge via github - group_number: is 6 bit field allowing 0 to 63, code in several utilities limited it to 31, fix - convert many two valued 'int's to bool - sg_lib: add SSC maintenance in/out sa names - enhance exit status values and associated strings, add SG_LIB_OS_BASE_ERR (50) - add sg_ll_inquiry_v2(), sg_ll_inquiry_pt() and sg_simple_inquiry_pt() - add sg_ll_report_luns_pt() - add sg_ll_log_sense_v2() - add sg_ll_mode_sense10_v2() - add sg_ll_mode_select6_v2() and sg_ll_mode_select10_v2() for RTD bit - add sg_ll_receive_diag_v2() - add sg_ll_write_buffer_v2() - add sg_get_llnum_nomult() - add sg_ll_get_lba_status16() - add sg_ll_get_lba_status32() - add sg_ll_format_unit_v2() - add sg_ll_test_unit_ready_progress_pt() - add sg_ll_start_stop_unit_pt() - add sg_ll_request_sense_pt() - add sg_ll_send_diag_pt(), sg_ll_receive_diag_pt() - add sg_get_sfs_name() for spc5r11 (Feature sets) - add sg_decode_transportid_str() - add sg_msense_calc_length() - add sg_all_zeros(), sg_all_ffs() - add sg_get_sense_cmd_spec_fld() - add sg_is_scsi_cdb() - add sg_get_nvme_cmd_status_str() - add sg_nvme_status2scsi() - add sg_nvme_desc2sense() - add sg_build_sense_buffer() - add sg_get_nvme_opcode_name() - add sg_memalign() and sg_get_page_size() - add sg_is_aligned() and pr2ws() - add sg_get_big_endian(), sg_set_big_endian() - add hex2stdout(), hex2stderr() and hex2str() - add sg_convert_errno() - add sg_if_can2stdout(), sg_if_can2stderr() and sg_exit2str() - implement 'format' argument in dStrHexStr() - add read buffer(16) command mode names - add Microcode activation sense descriptor spc5r10 - add SG_LIB_OK_TRUE(0) and SG_LIB_OK_FALSE(36) non "error" code defines for exit status - add SG_LIB_LBA_OUT_OF_RANGE error code - add SG_LIB_UNBOUNDED_32BIT (_16BIT and _64BIT) defines to help with decoding corner cases - identify vendor specific sense data (response code 0x7f), print contents in hex - sg_pr2serr.h: add sg_scnpr() [like lk scnprintf()] - sg_pt: add construct_scsi_pt_obj_with_fd() - add pt_device_is_nvme(), get_pt_nvme_nsid() - add check_pt_file_handle() - add get_pt_file_handle(), set_pt_file_handle() - add small SNTL to support sg_ses on NVMe - sg_lib_data: sync asc/ascq codes with T10 20170114 - add write scattered (16+32) cdb names sbc4r11 - sg_cmds_extra: expand sg_ll_ata_pt() to send new Ata pass-through(32) command (sat4r05) - sg_sat_identify: expand to take --len=32 - sg_pt: add dummy pt_device_is_nvme() - rescan-scsi-bus.sh: harden code - fixes from Suse; bump version - bump version to 20180615 - add to install list in Makefile, hope it does not clash with other package providing it - add --ignore-rev to ignore revision change - 55-scsi-sg3_id.rules: fixes from Suse - https://github.com/hreinecke/sg3_utils branch sles15 synced 20170914 - move some testing utilities out of the 'examples' and 'utils' directories into the new 'testing' directory - add testing/sg_tst_nvme utility - clean Makefile.freebsd in examples/ and testing/ - gcc 7.2 cleanups (sysmacros.h etc) - clang --analyze static checker clean ups - shellcheck cleanup on scripts - ./configure automake utility: - option --enable-debug added for testing - option --disable-linuxbsg retired, still accepted but now ignored, Linux sg v3 or v4 interface decision made at runtime - Info section now printed at end of ./configure - automake: add AM_PROG_AR to configure.ac - upgrade to version 1.15 - various configure.ac and Makefile.am cleanups - add SG_LIB_ANDROID build 'define'. If defined then SG_LIB_LINUX is also defined, so test for Android before Linux if need to differentiate - update BSD license from 3 to 2 clause aka FreeBSD license (without reference to FreeBSD project) - debian: bump compat file contents from 7 to 10 Changelog for sg3_utils-1.42 [20160217] [svn: r663] - sg_timestamp: new, to report or set timestamp - sg_read_attr: new, supported by tape drives - sg_stpg: fix truncation of target port field - sg_inq: cope with unicode strings, udev fixes - update version descriptor list to 20160125 - '--export': new entries for UUID descriptor - sg_ses: add more field acronyms (ses3r11) - sg_logs: add Utilization lpage (sbc4r07) - add Background operation lpage - add Pending defects lpage - add LPS misalignment lpage (sbc4r10) - document '--All' ('-A') option - rework lto tape vendor lpages - sg_vpd: add Block limits extension VPD page - add Device constituents VPD page - add LB Protection VPD page (ssc ssc5r02a) - LB provisioning VPD page: expand LBPRZ, add Minimum and Threshold percentage fields - rework lto tape vendor VPD pages - sg_inq+sg_vpd+sg_xcopy: add support for locally assigned UUIDs in VPD page 0x83 (spc5r08) - sg_sanitize: add --znr option (sbc4r07) - sg_rep_zones: add --partial option (zbc-r04) - sg_format: add ffmt option (sbc4r10) - add support for FORMAT MEDIUM (for tape) - sg_raw: document length relationships - rescan-scsi-bus.sh: updates from Suse - sg_lib_data: sync asc/ascq codes with T10 20151126 - sg_lib: add 'sense' categories for SCSI statuses: condition met, busy, task set full, ACA active and task aborted - add pr2serr() extern - change sg_get_sense_str() and dStrHexStr(), return chars written (returned void previously) - add sg_get_sense_descriptors_str() function - add sg_get_designation_descriptor_str() function - sg_get_desig_type_str()+sg_get_desig_assoc_str() and sg_get_desig_code_set_str() added - sg_get_opcode_sa_name() break out zoning in/out, read attribute and read position service actions - sg_cmds_extra: add sg_ll_format_unit2() for FFMT - sg_pr2serr.h: new, to shorten fprintf(stderr, ...) - sg_io_linux, sg_pt_linux: drop SUGGEST_* decoding - sg_unaligned.h: add 48 bit support and gets for variable length unsigned integers - add specializations for little and big endian - change sg_ll_*() function's 'int noisy' to bool Changelog for sg3_utils-1.41 [20150511] [svn: r644] - sg_zone: new utility for open, close and finish zone commands introduced in zbc-r02 - sg_rep_zones and sg_reset_wp: change opcodes as indicated in zbc-r02 - sg_read_buffer: add READ BUFFER(16) support (spc5r02) - sg_logs: add --enumerate and acronyms - allow decode from hex or binary in file - decode environmental reporting + limits lpages - sg_write_buffer: add --timeout=TO option - sg_lib interface: add sg_lib_pdt_decay(), TPROTO_PCIE plus support for zoning service actions - sg_lib: in Linux blocked devices yield ENXIO from ioctl(SG_IO), map to SG_LIB_CAT_NOT_READY - clean up sg_warnings_stream handling - sg_inq+sg_vpd: fix SCSI name string decoding in device identification VPD page (0x83) - increase sanity on Unit Serial number VPD page - improve rdac vpd page reporting (vendor) - sg_inq: improve NAA handling in dev_id VPD page - update version descriptor list to 20150126 - sg_vpd: add atomic boundary values (sbc4r04) - block limits VPD page: fix unmap granularity alignment value; spc5r02 additions - sg_readcap: add support for ZBC's rc_basis field - sg_senddiag: fix bug with --raw option - add support for -HHH for output suitable for --raw - sg_ses: enclosure element: add failure and warning acronyms, fix warning indication output - additional element status dpage: add PCIe/NVMe - handle element descriptor names that count multiple trailing NULLs - rescan-scsi-bus.sh: add --issue-lip-wait option and improve error handling - improve dm-multipath handling - sg_modes: make '-HHH' output suitable as input to 'sdparm --inhex=' - sg_rdac: add '-6' option for mode sense/select(6) - add support for reporting more SCSI transports and accessing rdac extended mode page 0x2c - sg_write_same: cleanup, mainly man page - scsi_logging_level: replace use of tr command - examples/sg_tst_async: cleanup - examples/sg-simple_aio.c: remove - sg_lib_data: sync asc/ascq codes with T10 20150423 - Makefile cleanup - autogen.sh: upgrade to buildconf 20091223 version Changelog for sg3_utils-1.40 [20141110] [svn: r620] - sg_write_verify: new utility for WRITE AND VERIFY - sg_ses_microcode: new utility - sg_sat_read_gplog: new utility - sg_senddiag: add --maxlen= option - sg_copy_results: correct response length calculations - sg_format: make '-FFF' bypass mode sense/select - add --mode=MP to supply alternate mode page, default remains read-write error recovery mpage - output unit serial number and LU name prior to - sg_inq: expand Block limits VPD page output - fix --cmddt output if not supported by device - more sanity checks on vendor supplied fields - sg_vpd: add --all option - more TPC VPD page decoding - add zoned block device characteristics page - more sanity checks on vendor supplied fields - sg_ses: fix problem with --index=sse (and ssc) - mask status element before using as control - defeat previous item with --mask (ignore) option - SAS connector status element: add overcurrent bit - handle element descriptor names that count a trailing NULL - add --warn option mainly for broken joins - add optional descriptions to -ee output - sync with ses3r07 - sg_sanitize: add --desc and --zero options - output unit serial number and LU name prior to - sg_rep_zones: corrections, sync with zbc-r01c - sg_persist: split help into two pages, '-hh' for 2nd - sg_logs: refine tape drive output - sg_raw: with -vvv decode T10 CDB name - do not output/print data-in if error - sg_opcodes: add --compact field - sg_senddiag: add --page=PG option - sg_reset: add words for EAGAIN from reset ioctl - sg_sat_*: mention t_type and multiple_count fields - win32: sg_scan: handle larger configurations - sg_lib: trim trailing spaces in dStrHex() and friends - sg_lib_data: sync asc/ascq codes with T10 20140924 - clean up service action string functions - sg_ll_unmap_v2(): fix group number - sg_ll_inquiry(), sg_ll_mode_sense*(), sg_ll_log_sense(): use resid to clear unfilled data-in buffer - sg_unaligned.h: add header for building parameters - examples/sg_tst_async: new Linux sg test utility Changelog for sg3_utils-1.39 [20140612] [svn: r588] - sg_rep_zones: new utility for ZBC REPORT ZONES - sg_reset_wp: new utility, ZBC RESET WRITE POINTER - sg_ses: add --eiioe=auto|force option - fix AES dpage element indexing problems - add --readonly option - sg_write_buffer: add --bpw=CS option to call write buffer multiple times for big blobs - sg_format: add --ip_def option to fully provision - sg_opcodes: add --mask option - sg_logs: add --in=FN option for log select params - add --filter=PARC (parameter code) - add --no_inq for suppress initial INQUIRY call - add --readonly option - sg_persist: add --readonly option, environment variable SG_PERSIST_IN_RDONLY sets ro on prin cmds - sg_inq: sync version descriptors dated 20105176 - suppress dev-id VPD messages so they only appear when --verbose is given - add new SCSI_IDENT_*_ATA pair to --export output - sg_luns: add decoding for conglomerate LUNS - add --lu_cong option to simulate the LU_CONG bit - sg_vpd: add --vendor=VP option, re-order vendor specific pages, split lto into lto5 and lto6 - add Supported block lengths and protection types page (sbc4r01) - add Block device characteristics extension page (sbc4r02) - sg_copy_results, sg_get_lba_status, sg_luns, sg_read_buffer, sg_readcap, sg_referrals, sg_rtpg, sg_sat_set_features, sg_sat_identify: add --readonly option - sginfo: strip trailing spaces from INQUIRY text - sg_rbuf: add --echo option (to use echo buffer) - sg_lib: add sanitize command service action names - add 'sense' categories for reservation conflict, data protect and protection information violations - add sg_get_category_sense_str() to API - change struct sg_simple_inquiry_resp::rmb to byte_1 - add initial zbc service actions - dStrHex(Err): fix output truncation error - linux, sg: support SCSI_PT_FLAGS_QUEUE_AT_TAIL and SCSI_PT_FLAGS_QUEUE_AT_HEAD (block layer queueing) - sg_lib_data: sync asc/ascq codes with T10 20140516 - sync operation code with T10 20140515 - add id string for SPC-5 - scripts/59-scsi-sg3_utils.rules: removed - functionality split into two scripts: 55-scsi-sg3_id.rules + 58-scsi-sg3_symlink.rules - examples/sg_persist_tst.sh: add --exclusive option - win32: sg_scan, sg_ses and sg_log fixes - examples/sgq_dd: re-add old utility as example Changelog for sg3_utils-1.38 [20140401] [svn: r563] - sg_ses: add --dev-slot-num= and --sas-addr= - fix --data=- problem with large buffers - new --data=@FN to read hex data from file FN - error and warning message cleanup - add --maxlen= option - sg_inq: add --block=0|1 option to control opens - add --inhex=FN to read response in ASCII hex from a file; --inhex=FN --raw reads response in binary - make -HHH (-HHHH for '-p ai') output suitable for another sg_inq invocation to use --inhex to decode - add LU_CONG to standard inquiry response output - decode ASCII information VPD pages - add HAW_ZBC in block dev char. VPD page (sbc4r01) - sync version descriptors dated 20131126 - allow --page=-1 to force std INQUIRY decoding - fix overflow in encode_whitespaces - improve unit serial number display (VPD page 0x80) - sg_vpd: add LU_CONG to standard inquiry response output - add --inhex=FN to read response in ASCII hex from a file; --inhex=FN --raw reads response in binary - decode Third Party Copy (tpc) page - add HAW_ZBC in block dev char. VPD page (sbc4r01) - add LTO and DDS vendor pages - allow --page=num to restrict --enumerate output - sg_persist: add PROUT: Replace Lost Reservation (spc4r36) - add --transport-id= for SOP: 'sop,' - sg_readcap: for --16 show physical block size if different from logical block size - sg_xcopy: environment variables: XCOPY_TO_SRC and XCOPY_TO_DST indicate where xcopy command is sent - change default to send xcopy to dst (was src) - improve CL handling of short options (e.g. '-vv') - sg_luns: guard against garbage response - sg_decode_sense: with --nospace ignore spaces on command line, so multiple arguments are concatenated - sg_write_same: repeat if unit attention - sg_rtpg: fix indexing bug with --extended option - sg_logs: placeholder for pending defects lpage - sg_unmap: fix another problem with --grpnum= option - sg_lib.h: add PDT_ZBC define (spc4r36p) - sg_lib_data: sync asc/ascq codes with T10 dated 20140320 - add pdt string for ZBC (spc4r36p) - sg_lib: extensions to sg_get_num() and sg_get_llnum() - sg_cmds_extra: fix sa bug in sg_ll_3party_copy_out() - scripts/rescan-scsi-bus.sh: check if FC driver exports issue_lip before using it - man page added (Linux only) - scripts/59-scsi-sg3_utils.rules: linux specific udev rules - examples: add sg_tst_excl3 for testing O_EXCL - improve sg_tst_excl and sg_tst_excl2 - add sg_tst_context for testing file handle contexts - upgrade automake to version 1.13.3 - add suse directory and 'spec' file to facilitate builds Changelog for sg3_utils-1.37 [20131014] [svn: r522] - sg_compare_and_write: fix wrprotect setting - add --quiet option to suppress miscompare report - merge features from another implementation - sg_inq: fix referrals VPD page - dev_id VPD: T10 vendor id designator clean up - sg_logs: improve for tape drives, general cleanup - sg_persist: fix core dump on -Q option - sg_unmap: fix core dump on -g option - sg_vpd: dev_id VPD: T10 vendor id designator clean up - cleanup up dev_id NAA-3: locally assigned - sg_ses: add --nickname and --nickid options - eiioe added to additional element status page (ses3r6) - multiple --filter options to prune output - sg_verify: improve miscompare handling - rename --btychk=ndo option to --ndo=ndo (hide former) - add --quiet option - sg_xcopy: allow sg and bsg devices - fix for bpt going negative - limit each XCOPY(LID1) command to 65535 blocks - fix for seek in multi-segment copies - sg_sanitize: skip 15 second safety delay with --fail - sg_libs: extended copy opcode renamed (spc4r34) - sg_ll_receive_copy_results(): expand for all sa_s - add sg_get_sense_key() - add sg_ll_3party_copy_out() - add dStrHexErr(): ascii hex to stderr - add dStrHexStr(): ascii hex to string - add SG_LIB_CAT_MISCOMPARE to categories - clean header files - sg_pt_freebsd: sanity check on sense_resid; fix leaks - scripts/rescan-scsi-bus.sh KG's v1.57 + HR patch - improve wlun handling, detect updated and resized devices, better multipath support - Makefile.am cleanup - examples: add sg_tst_excl and sg_tst_excl2 Changelog for sg3_utils-1.36 [20130531] [svn: r497] - sg_vpd: Protocol-specific port information VPD page for SAS SSP, persistent connection (spl3r2), power disable (spl3r3) - block device characteristics: add FUAB bit - sg_xcopy: handle more descriptor types; handle zero maximum segment length; allow list IDs to be disabled; improve skip/seek handling; allow xcopy on destination - sg_reset: and --no-esc option to stop reset escalation - clean up cli, add long option names - sg_luns: add --test=ALUN option for decoding LUNs - decoded luns output in decimal or hex (if -HH given) - add '--linux' option to show Linux LUN after T10 representation, can map one to the other - sg_inq: add --vendor option to show standard inquiry's vendor specific fields in ASCII - take resid into account with response output - sg_sync: add --16 (for 16 byte command) and --timeout= - sg_logs: add data compression page (ssc4) - sg_sat_set_features: increase --lba from 1 to 4 bytes - sg_write_same: add --ndob option (sbc3r35d) - sg_map: mark as deprecated - sginfo: mark as deprecated, especially -l (list) - sg_lib: improve snprintf handling - sg_lib_data: sync asc/ascq codes with T10 20130117 - sg_cmds (lib): if noisy given, give more UA info - make code more C++ friendly Changelog for sg3_utils-1.35 [20130117] [svn: r476] - sg_compare_and_write: new utility - sg_inq+sg_vpd: block device characteristics VPD page: add product_type, WABEREQ, WACEREQ and VBULS fields - sg_inq: more --export option changes for udev - sg_vpd: add more rdac vendor specific vpd pages - sg_verify: add --ebytchk option for sbc3r34 changes - sg_stpg: --offline option: fix 'Invalid state 0xe' - sg_ses: Door Lock element changed to Door element and abbreviation changed from 'dl' to 'do' (ses3r05) - archive/rescan-scsi-bus.sh: upgrade to version 1.53hr - move rescan-scsi-bus.sh to scripts directory - sync to sbc3r34 - sg_lib: sg_ll_verify10+16 expand BYTCHK to 2 bit field - sg_pt_win32, sg_scan(win32): changes for cygwin 1.7.17 - clean up man page summary lines Changelog for sg3_utils-1.34 [20121013] [svn: r461] - sg_xcopy: new dd like utility for extended copy command - sg_copy_results: new utility for receive copy results - sg_verify: add 16 byte cdb, bytchk (data-out buffer) and group number support - sync to spc4r36 and sbc3r32 - sg_inq: add --export so sg_inq can replace udev's scsi_id - decode old EMC Symmetrix abuse of VPD page 0x83 - sg_vpd: decode old EMC Symmetrix abuse of VPD page 0x83 - sg_ses: increase max dpage response size to 64 KB - allow ident,locate on enclosure controller - more sanity for additional element status descriptor - sg_sanitize: add --ause, --fail and --test= - sg_luns: add long extended flat space addressing format - sg_logs: add ATA pass-through results lpage (SAT-2) - sg_rtpg: add --extended option - sg_senddiag: list rebuild assist diag page name - sg_pt_linux: expand DID_ (host_byte) codes - cope with a transport error plus sense data - prefer major() over MAJOR() macro - sg_lib: fix sg_get_command_name() service actions - report sdat_ovfl bit (if set) in sense data - decode extended_copy and receive_copy service actions - decode read_buffer and write_buffer modes - decode ATA PT fixed format sense (SAT-2) - sg_cmds_extra: add sg_ll_report_tgt_prt_grp2() - ./configure options: - change --enable-no-linux-bsg to --disable-linuxbsg - add --disable-scsistrings to reduce utility sizes Changelog for sg3_utils-1.33 [20120118] [svn: r435] - sg_ses: major rework of indexes (again), now two level - sg_write_buffer: new --specific option for mode specific field; new mode 13 (spc4r32) - sg_vpd: add hp3par volume info vendor VPD page - fix 'scsi ports' [0x88] page problem - add 'sinq' pseudo page for standard inquiry response - add power consumption page - sg_format: add --poll= option for request sense polling - improve handling of disks > 2 TB and DIF (protection) - sg_logs: LB provision lpage extra (sbc3r28) - sg_modes: application tag mpage subcode 0xf0->0x2 - sg_write_same: no prot fields when wrprotect=0 - sg_get_lba_status: reflect change in sbc3r25 to Parameter Data Length response field (offset reduced from 8 to 4) - sg_inq, sg_vpd: sync with spc4r33 - win32: change DataBufferOffset type per MSDN; caused problem with 64 bit machines (with buffered interface) - sg_luns: tweak documentation for vendor specific reports - add man pages for scsi_loging_level, scsi_mandat, scsi_satl and scsi_temperature Changelog for sg3_utils-1.32 [20110730] [svn: r410] - sg_sanitize: new utility for command added in sb3r27 - sg_sat_identify: add '--ident' to output WWN - sg_ses: major rework of descriptor output - add --index, --descriptor, --join, --clear, --get, and --set options - sg_raw: exit status corrections - sg_decode_sense: add --nospace and --hex options - sg_logs: fix bug with large --maxlen - zero response length when resid implies it is invalid - add scope field to lb provisioning lpage (sb3r27) - sg_inq: sync version descriptors with spc4r31 - sg_lib_data: sync asc/ascq codes with spc4r31 - sg_vpd: add LBPRZ field in LB provisioning VPD page - sg_format: allow format of pdt 7 (some MO drives) - sg_cmds_basic: sg_cmds_process_resp() handle status good with a sense key other than no_sense (e.g. completed) - add README.iscsi Changelog for sg3_utils-1.31 [20110216] [svn: r386] - sg_decode_sense: new utility to decode sense data - sg_vpd: LB provisioning + Block limits pages (sbc3r26) - sync asc/ascq and version descriptors with spc4r28 - sg_get_config, sg_rmsn, sg_verify: add --readonly option - sg_lib: implement forwarded sense data descriptor - decode user data segment referral sense data descriptor - sg_lib, sg_turs, sg_format: more precision for progress indication (two places after decimal point) - sg_lib(win32): add runtime selection of SPT direct or indirect interface - sg_read_buffer+sg_write_buffer: set SPT direct - add examples/forwarded_sense.txt + examples/ref_sense.txt Changelog for sg3_utils-1.30 [20101111] [svn: r363] - sg_referrals: new utility for REPORT REFERRALS - sbc3r25 renames 'thin' provisioning' to 'logical block provisioning': changes in sg_format, sg_inq, sg_logs, sg_modes, sg_readcap, sg_vpd - sg_inq: update version descriptor list to spc4r27 - extended inquiry vpd page add extended self test completion minutes field - sg_lib: sync asc/ascq list to spc4r27 - dStrHex(): trim excess trailing spaces - sg_read_long: add --readonly option (open() is rw) - sg_raw: add --readonly option (open() is rw) - allow bidirectional commands - sg_vpd: rdac vendor page [0xc8] parse corrections - extended inquiry vpd page add extended self test completion minutes field - sg_ses: expand --data (in) buffer to 2048 bytes - sg_opcodes: add extended parameter data for TMFs (spc4r26) - sg_dd: clean count calculation, document nocache flag - treat bsg devices as implicit sg_io - add more conversions - sg_write_same: if READ CAPACITY(16) fails try 10 byte variant - anticipate approval of proposal to allow UNMAP and ANCHOR bits to be set on WRITE SAME(10) with '--10' option - sg3_utils man page: sections added for OS device names Changelog for sg3_utils-1.29 [20100406] [svn: r334] - sg_rtpg: new logical block dependent state and bit (spc4r23) - sg_start: add '--readonly' option for ATA disks - sg_lib: update asc/ascq list to spc4r23 - sg_inq: update version descriptor list to spc4r23 - sg_vpd: block device characteristics page: fix form factor - update Extended Inquiry VPD page to spc4r23 - update Block Limits VPD page to sbc3r22 - update Thin Provisioning VPD page to sbc3r22 - Automation device serial number and Data transfer device element VPD pages (ssc4r01) - add Referrals VPD page (sbc3r22) - sg_logs: add thin provisioning and solid state media log pages - addition of IBM LTO specific log pages - sg_modes: new page names from ssc4r01 - sg_ses: sync with ses3r02 (SAS-2.1 connector types) - sg_unmap: add '--anchor' option (sbc3r22) - sg_write_same: add '--anchor' option (sbc3r22) - sg_pt interface: add set_scsi_pt_flags() to permit passing through SCSI_PT_FLAGS_QUEUE_AT_TAIL and AT_HEAD flags - add examples/sg_queue_tst+bsg_queue_tst for SG_FLAG_Q_AT_TAIL - add AM_MAINTAINER_MODE to configure.ac to lessen build issues - add BSD_LICENSE file to this and lib directories, refer to it from source and header files. Some source has GPL license Changelog for sg3_utils-1.28 [20091002] [svn: r315] - sg_unmap: new utility for thin provisioning - add examples/sg_unmap_example.txt - sg_get_lba_status: new utility for thin provisioning - sg_read_block_limits: new utility for tape drives - sg_logs: add cache memory statistics log (sub)page - sg_vpd, sg_inq: extend Block limits VPD page (sbc3r19) - sg_vpd: add Thin provisioning VPD page (sbc3r20) and TapeAlert supported flags VPD page - sg_inq: note VPD page support better in sg_vpd - sg_persist: add transport specific transportID format - allow transportIDs to be read from named file - sg_opcodes: allow --opcode= option to take OP and SA values (comma separated) - tweak print format, remove test code - sg_requests: remove test code in progress calculation - sg_reset: add target reset option - sg_luns: reduce default maxlen to 8192 (for FreeBSD) - sg_raw: extend max cdb length from 16 to 256 bytes - align heap allocs to page boundaries - sg_lib: sg_set_binary_mode() needs config.h included - add progress indication sense data descriptor (0xa) - change SG3_UTILS_* constants to SG_LIB_* - decode service actions within persistent reserve in/out - sync with spc4r21 - sg_cmds_extra: add sg_ll_unmap() and sg_ll_get_lba_status() - sg_pt_linux: fix check condition but empty sense buffer; occurred when sg v3 node used and /usr/include/linux/bsg.h visible - major() macro grief, if present include and use MAJOR() instead - scripts/sas_disk_blink: moved from this package to sdparm - utils/hxascdmp: in Windows set binary mode on read files - examples/sg_persist_tst.sh: add PRIN read full status command - sg_raw,sg_write_buffer,sg_write_long,sg_write_same: in Windows set binary mode on read files - sg_pt_win32: default to non-direct variant of SPT interface - use './configure --enable-win32-spt-direct' to override - non-direct data length set to 16 KB, extended if required - debian: incorporate patch from debian sid Changelog for sg3_utils-1.27 [20090411] [svn: r250] - sg_write_same: new utility: 10, 16 and 32 byte cdb variants - sg_inq: sync version descriptors with spc4r18 - add power condition VPD page - expand block limits VPD page (sbc3r18) - sg_vpd: add power condition VPD page - expand block limits VPD page (sbc3r18) - sg_map26: fix for lk 2.6.26 when CONFIG_SYSFS_DEPRECATED_V2 is not defined - output cdb when verbose option given - correct tape minors >= 32 - sg_dd: flock flag (does LOCK_EX|LOCK_NB) - switch open on input for sg device nodes: first open read-write and if that fails try opening read-only - experiment with of2=OFILE2; add conv=sparse - use posix_fadvise() to defeat caching of normal+block files when new 'nocache' flag given - sg_dd copied to own package called ddpt - sg_dd, sgm_dd, sgp_dd: accept 'count=-1' for calculate count, accept '-V' for version string - sg_get_config: add OSSC feature [mmc6r02] - sg_modes: add ATA power condition mode page - sg_logs: protocol specific (SAS) lpage sync to sas2r15 - power condition transitions lpage (added in spc4r18) - extra parameters for start-stop cycle counter lpage - sg_format: add '--fmtpinfo=' and '--pie=' options (sbc3r18) - sg_readcap: more protection + thin provisioning (sbc3r18) - add a '--16' option for 16 byte cdb version - sg_persist: code clean up - allow '--transport-id=' argument to use space as separator - add '--alloc-length=' argument - sg_scan: (win32) new format, scsi adapter scan optional - sginfo: fix crash when 1024 sg device nodes (or more) - sg_ses: allow '--data=' argument to use space as separator - sg_senddiag: allow '--raw=' argument to use space as separator - sg_reassign: allow '--address=' argument to use space as separator - sg_wr_mode: allow '--contents=' and '--mask=' arguments to use space as separator - sg3_utils.spec: correction to configure call - sg_pt: add scsi_pt_open_device_flags() call - add scsi_pt_version() and clear_scsi_pt_obj() calls - clear os_err at start of do_scsi_pt() - add linux bsg support via runtime detection - sg_cmds: add sg_cmds_open_device_flags() - sg_cmds_extra: sg_ll_format_unit: remove rto_req argument, the expanded fmtpinfo argument subsumes it. - clearer split between Linux and Windows only code and doc - automake tools: change to what Ubuntu 8.10 provides - Ubuntu 8.10 libtool problems -> Debian 4.0 Changelog for sg3_utils-1.26 [20080625] [svn: r183] - sg_sat_phy_event: new utility; copied from examples directory and enhanced, rename original to sg__sat_phy_event - sg_ses: sync with ses2r19b, many nomenclature changes - sg_get_config: sync with mmc6r01 - allow Microcode upgrade and DVD read feature descriptors to be 4 bytes long - add '--raw' option - sg_verify: add --vrprotect= option - sg_vpd: add nominal form factor to block dev. char. VPD page - add --maxlen= option to set allocation length in cdb - sg_inq: add --maxlen= option that does same as --len= - move version descriptors (spc4r15) to sg_inq_data.c file - sg_inq+sg_vpd: logic for "NAA-3 Locally assigned" identifier - update extended inquiry VPD page - sg_modes: add --maxlen= option to specify allocation length - sg_start: add '--noflush' and '--mod=PC_MOD' options (sbc3r14) - sg_request: add a '--progress' option (similar to sg_turs) - add --maxlen= option to set allocation length in cdb - sg_luns: add --maxlen= option to specify allocation length - sg_dd: improve MMC handling of 'illegal mode for this track' read errors (with ILI and info field) - sg_dd, sgm_dd, sgp_dd, sginfo, sg_rbuf, sg_read: replace "%lld" and friends with PRI macros - sg_opcodes: tmf name change in spc4r15 (async event) - sg_turs: add more to man page about '--progress' indication - sg_write_long: add examples section to man page - '--raw' option: modify utilities that can send binary output to call sg_set_binary_mode(). For MingGW port CR problem. - sg_lib: update asc/ascq and command name strings to spc4r15 - split sg_lib into sg_lib_data.[hc] and sg_lib.[hc] - split sg_cmds_extra into sg_cmds_extra and sg_cmds_mmc - add osd2r03 service actions (all different from osd-r10) - add sg_get_trans_proto_str() - add sg_get_sense_filemark_eom_ili() function (MMC uses ILI) - add sense key specific unit attention condition queue overflow decoding (added in spc4r13) - add sg_set_text_mode() and sg_set_binary_mode() functions for non-Unix OSes - sg_cmds_mmc: add sg_ll_set_streaming() function - sg_cmds_extra: add vrprotect argument to sg_ll_verify10() - add sg_ll_get_performance() and sg_ll_set_cd_speed() - change 'long long' to int64_t and 'unsigned long long' to uint64_t to stress that 64 bit integer wanted, not larger - audit of dangerous 'u64 = uch[24] << 24' code, replace most 'unsigned long's - multiple documentation corrections provided by Dan Horak - win32/MinGW: define SG3_UTILS_MINGW when detected - remove archive/pre_configure subdirectory - move sg_io_linux.c into the lib subdirectory - utils/hxascdmp: add hxascdmp(1) man page - switch primary build to ubuntu environment, rename library to libsgutils2 to avoid clash Changelog for sg3_utils-1.25 [20071016] [svn: r115] - sg_stpg: new utility to Set Target Port Groups - sg_safte: new utility to query SAF-TE processor (SES like) - sg_sat_set_features: new utility (actually copied from examples directory); renamed examples version to: sg__sat_set_features - sg_read_buffer: restore (had fallen out of build scripts) - sg_dd: add oflag=sparse to step over bs*bpt number of zeros; - with oflag=sparse, write last bs*bpt segment at end or after error so file length of OFILE is appropriate - when coe>1 then SCSI READ LONG logic remembers extended block length of first encountered error - sg_dd, sgm_dd, sgp_dd: allow iflag=null and oflag=null both of which do nothing (placeholders) - sg_ses: sync with ses2r17 then r18 - sg_vpd, sg_inq: add block device characteristics VPD page - sg_inq: add '--vpd' option (or '-e') for backward compatibility - sg_vpd: decode protocol specific lu information page for SAS - add more RDAC vendor VPD pages - sg_logs: update background scan results log page, sbc3r11 - add generation code to protocol specific page for SAS SSP - add media changer diagnostic data log page - sg_raw: fix error message when do_scsi_pt() fails - sg_lib: sync asc/ascq codes with spc4r11 - add sg_get_num_nomult() - add TPROTO_* protocol identifier constants to sg_lib.h - sg_cmds_extra: add sg_ll_set_tgt_prt_grp() - place source in subversion repository - split code into src/ lib/ and include/ directories - sync debian directory with their 1.24 version (sid unstable) - convert build logic to use autotools (i.e. './configure ; make') - rename this file from CHANGELOG to ChangeLog - note: only code in lib/ and src/ directories built by autotools; some other subdirectories still use hand-crafted Makefiles Changelog for sg3_utils-1.24 [20070507] [svn: r77] - sg_raw: new utility to send arbirary SCSI commands - sg_luns: increase number of luns that can be fetched - fix length of raw and hex output - add '--quiet' option to output only ASCII hex representation of each lun - sg_rtpg: update for changes in spc4r09 - sg_persist: update documentation, spc-4 references - fix exit status values - sg_inq: update version descriptors per spc4r09 - fix '--id' and '--extended' - extend block limits VPD page (sbc3r09) - sg_vpd: extend block limits VPD page (sbc3r09) - append relative target port identifier to SAS target port address with '-iq' option - sg_logs: add decoding for stats+performance log pages - fix showing of page names for pdt > 0 - implement '-HH' for single and all pages, fix '-r' - when '--maxlen=' given, only do single fetch - add Tape Alert (ssc), Media and Element statistics (smc) pages - add '--brief' option - sg_ses: sync with ses2r16 - fix bay number for SAS - sg_format: add '--dcrt' and '--security' options - sgm_dd: add 'smmap' oflag for shared_mmap_io testing - add 'dio' oflag - sg_dd, sgp_dd: add 'dio' iflag and oflag - sg_modes: change SAS mode page names per sas2r09 - check validity of block descriptors length - sg_pt: change opaque context object from 'void *' to 'struct sg_pt_base *' - sg_opcodes: anticipate extra tmfs from 07-159r0 - sg_sat_set_features: add more usage information - add man page - sg_sat_phy_event: add to examples directory - sg_lib: sync asc/ascq codes with spc4r10 - Solaris port: using uscsi interface - various .html files removed from doc directory Changelog for sg3_utils-1.23 [20070131] [svn: 75] - sg_read_buffer: new utility - sg_write_buffer: new utility - sg_opcodes, sg_senddiag, sg_logs, sg_modes, sg_start, sg_inq, sg_turs, sg_readcap, sg_rbuf: add getopt_long() based cli; old and new cli selectable, new getopt_long cli is default - scripts: new subdirectory containing some bash scripts - add scripts/README file - sg_reassign: add '--hex' option for grown and primary lists - sg_rtpg: add '--raw' option - sg_lib.h, sg_cmds_basic.h + sg_cmds_extra.h: add C++ 'extern "C" ' wrappers - cleanup C code so it will compile as C++ - sg_lib: sync with spc4r08 - include , use PRId64 instead of %lld form - fix sg_get_sense_str() when empty sense buffer - win32 port: add Makefile.mingw + related support for MinGW - sg_cmds_extra: add sg_ll_read_buffer() and sg_ll_write_buffer() - sg_dd, sgp_dd, sgm_dd, sg_read: use lseek64() instead of llseek.c - sgm_dd: accept coe= for interworking with sg_dd - sg_rdac: fix on non-linux ports - sg_ses: fix spurious warning in additional element status page - '-rr' option outputs a diagnostic page in binary to stdout - sg_opcodes: add command timeout descriptor support (spc4r08) - change linux specific pass through to generic pass through - sg_logs: add 'name=value' decoding for SAS specific lpage - examples+utils subdirectories: remove symlinks - synchronize man pages with usage messages - sg3_utils.spec: rework Changelog for sg3_utils-1.22 [20061016] [svn: 72] - sgp_dd: accept verbose= as well as deb= to ease interworking with sg_dd and sgm_dd - sg_sat_set_features: added to examples directory - sg_lib: sync asc/ascq text with spc4r06 - move SG_LIB_CAT_NO_SENSE and SG_LIB_CAT_RECOVERED to 20 and 21 respectively; add SG_LIB_CAT_ABORTED_COMMAND at 11 (its sense key value) - sg_vpd: tweak '--page=sp --quiet' output - change '-HHH' so same as '-rr' (prepares ATA Information (ai) response for hdparm) - sg_requests: add '-s' option to set exit status from parameter data - sg_modes: exit quickly from '-e' if device not ready - sg_logs: sync sas log pages with sas2r05a - expand background scan results log page - add '-m=' to limit response length - drop '-scum' and '-sthr' options and add '-select' - sg_write_long: add '--16' option to send 16 byte cdb - add '--wr_uncor' and '--pblock' options - sg_senddiag: cleanup and add sdiag_sas_p1_stop.txt to examples directory - sg_format: add '--cmplst=' option (default: 1) - add '--pfu=' option - expand man page to discuss P/D/C/GLISTs - sg_reassign: add '--primary' option to fetch primary defect list (PLIST) length - sg_readcap: add '-H' option to output response in hex and '-r' to output response in binary to stdout - add logical blocks per physical block (sbc3r07) - sginfo: add PLIST and GLIST designation to defect lists - sg_cmds: split this support file into sg_cmds_basic.[hc] and sg_cmds_extra.[hc] - add sg_ll_ata_pt() (SATL ATA pass) to sg_cmds_extra.[hc] - sg_rdac: fix includes for FreeBSD - sg_dd: add 'coe_limit=' option to exit after consecutive 'coe' type read errors - sgm_dd: print out throughput information when signal arrives if time=1 (like sg_dd does already) - sg_inq: change '-HHH' so same as '-rr'. Now sg_inq, sg_vpd and sdparm output for hdparm with '-HHH' -add '-l=' option - sg_read_long: add '--pblock' option for physical blocks - sg_luns: add '--hex' and '--raw' options - sg_requests: add '--hex' and '--raw' options - sg_scan: windows version added (was previously linux only) - 2 man pages: sg_scan.8l and sg_scan.8w that are installed as sg_scan.8 - archive directory: removed all but rescan-scsi-bus.sh - README points to previous version in that directory - sg_sat_identify: add to main directory - rename earlier version to examples/sg__sat_identify.c - sg_ident: rework as spc4r07 changed command names and expanded functionality Changelog for sg3_utils-1.21 [20060706] [svn: 70] - sg_vpd: new utility for decoding VPD pages. sg_inq's cli is cluttered; also borrows from sdparm's VPD handling - sg_rdac: new utility for vendor specific work - sg_lib: add sg_vpd_dev_id_iter() to iterate over di VPD page - add sg_ata_get_chars() to fetch chars from ATA words - sync additional sense code strings with spc4r05a - add SG_LIB_CAT_NOT_READY category when sense_key is NOT READY - add SG_LIB_FILE_ERROR category for open problems - add SG_LIB_SYNTAX_ERROR category for command line problems - broaden SG_LIB_CAT_MEDIA_CHANGED to SG_LIB_CAT_UNIT_ATTENTION - add SG_LIB_CAT_MALFORMED for bad responses - BEWARE: these changes cause confusion if an executable from this version is run with a libsgutils library from 1.20 or earlier - sg_cmds: add SG_LIB_CAT_NOT_READY return to most "ll" functions - alter many utilities to report SG_LIB_CAT_NOT_READY - sg_dd: add retries= option for sg_io - sg_logs: add '-T' option to output protocol specific port log page - add support for log subpages (new in spc4r05) - more sanity checks in Start Stop Cycle Counter page - sg_cmds: add sg_ll_read_long16() - add page_code and subpage_code to sg_ll_log_select() - add subpage_code to sg_ll_log_sense() - sg_read_long: do READ LONG(16) when '--16' given - sg_read: accept and ignore 'of=' arguments - sg_dd: expand medium/hardware error "coe' processing to include the "blank check" sense key (for optical devices) - sg_ses: expand display element (per 05-011r2) - sg_format: clear 'cmplst' bit (for MO disks) - add '--six' ('-6') option for mode sense/select(6) - sg_format + sg_test_rwbuf: fix for when char is unsigned - sg_inq: VPD page 0x89: output ATA IDENTIFY DEVICE strings - for IDENTIFY (PACKET) DEVICE response use sg_ata_get_chars() - sg3_utils.html : new name, was previously u_index.html. Copy placed in doc subdirectory - tools.html : SCSI and storage tools reference, copy placed in doc subdirectory - sg3_utils.8 : add a new man page containing general information especially common exit status values - sg_sat_identify: added to examples directory (SAT passthrough test) - extend to pass through IDENTIFY PACKET DEVICE with '-p' option - sg_sat_chk_power: added to examples directory - sg_sat_smart_rd_data: added to examples directory - sg_chk_asc: added to utils directory to check asc_ascq codes - debian: stop placing archive directory under examples - add build_debian.sh script Changelog for sg3_utils-1.20 [20060418] [svn: 68] - sg_logs: decode phy event descriptors in SAS port specific log page (sas2r03) - new parameter control byte format (spc4r03), subpages to come - update Makefile (linux) to install sg_io_linux.h + sg_linux_inc.h - sg_map26: fix for block device mapping in lk 2.6.16-rc1 and beyond - cope with sysfs removal of 'generic' symlink post lk 2.6.16, anticipate removal of 'tape' symlink - sg_dd, sgm_dd, sgp_dd: fix problem around 0x7fffffff blocks - sg_dd: fix read_long processing error (when 'coe=2' or 3) - expand 'coe=' to take 0...3 (invokes read long with 2 or 3) - allow for SG_GET_RESERVED_SIZE yielding 0, lk 2.6.16 feature - sgp_dd: add 'iflag=' and 'oflag=' arguments; signals (like sg_dd) - sgm_dd: add 'iflag=' and 'oflag=' arguments; signals (like sg_dd) - sg_get_config: double->dual renaming (mmc5r03) - sg_read: add 'dpo=' and 'fua=' options - allow 'count' < 0 (or 'bpt=0') for issuing zero block READs - allow for SG_GET_RESERVED_SIZE yielding 0, lk 2.6.16 feature - add 'no_dxfer=0|1' option - sg_modes: fix exit value when MODE SENSE fails - add '-e' to examine presence of page codes from 0x0 to 0x3e - sg_requests: add '--num=' and '--time' options for timing multiple invocations - sg_inq: fix vpd 0x83 designator code 8 name: "scsi name string" - sg_scan: if lk 2.6, use sysfs to find active sg device nodes - sg_map: if lk 2.6, use sysfs to find active sg device nodes - sg_ses: expand display element (per 05-011r1) - sg_start: add an '-i' option which is equivalent to '--imm=1' - sg_senddiag: update man page showing use of two scripts in examples directory (sdiag_sas_p0_cjtpat.txt and _p1_) - sg_lib: fix sg_get_sense_descriptors_str() case 9 (ATA Return) Changelog for sg3_utils-1.19 [20060127] [svn: 66] - sg_start: accept '--' options (e.g. 'sg_start --stop') - add '--fl=' option for jump to format layer (mmc5) - sg_logs: background scan log page, resync with sbc3r03 - add '-scum' and '-sthr' for setting defaults - add device statistics log page (ssc + adc) - fix "last n" deferred errors/error events incrementing - partial addition of log subpages (spc4r03) - sg_get_config: sync features with mmc5 rev 02b - sg_wr_mode: mask out dpofua bit in mode select header - sg_inq: try harder with '-A' to identify ATA device - broaden meaning of '-d' option to decode ... - decode software interface id VPD page ('-p=84 -d') - decode device capabilities (ssc) VPD page ('-p=b0 -d') - sginfo: correct defect list handling ('-d' and '-G') - sg_verify: improve error processing (e.g. medium errors) - sg_ses: scsi target_initiator port additional element status (ses2r14) - many: arguments that currently accept '0x' or '0X' to indicate a hex number may alternatively take a trailing 'h' or 'H' to indicate hex - sg_lib: update asc/ascq strings (spc4r03) - sg_lib+sg_cmds: make independent of linux via sg_pt.h function based interface. - linux pass through code placed in sg_pt_linux.c - rename sg_include.h to sg_linux_inc.h - linux specific code in sg_lib.[hc] moved to sg_io_linux.[hc] - port to FreeBSD: using sg_pt_freebsd.c - port to Tru64: using sg_pt_osf1.c - sg_cmds: add sg_ll_get_config(), sg_ll_format_unit(), sg_ll_reassign_blocks(), sg_ll_persistent_reserve_in+out(), sg_ll_read_long10(), sg_ll_verify10(), sg_ll_write_long10() - sg_persist: add "allow commands" to report capabilities - sg_persist_tst: (examples) takes device node as argument - sg_luns: add "security protocol" wlun Changelog for sg3_utils-1.18 [20051118] [svn:63] - sg_map26: new utility to map sg devices in lk 2.6 - sg_luns: luns > 16,384 (sam-4 rev 4) - sg_ses: bump fan speed field to 11 bits - SAS connector names (ses2r13) - sg_inq: add '-rr' option for "hdparm --Istdin" - sg_get_config: tracking mmc-5 - sg_write_long: add support for COR_DIS bit - sg_cmds: add sg_ll_test_unit_ready_progress() - sg_turs: '-p' option shows progress - sg_dd: add 'iflag=' and 'oflag=' options - remove output of mode page info when verbose > 0 - add control of DPO bit via iflag/oflag - sg_lib: add sg_get_pdt_str() - update asc/ascq strings - sg_modes + sginfo: add SAS(2) SSP shared mode subpage - doc: rename "html" directory to "doc" - Makefile: add 'libtool --finish' to install Changelog for sg3_utils-1.17 [20050922] [svn: 60] - sg_inq: add '-a' option for ATA information VPD page - add '-b' option for Block limits VPD page (SBC) - add '-A' option for probing ATA or ATAPI device - increase raw ('-r') and verbose ('-v') output for ATA(PI) devices to 512 bytes (was 256 bytes) - output hex ('-H') and verbose response for ATA(PI) devices in 16 bit words (corrected for endianness) - output bytes if '-HH' option given - sync with spc4 rev 02 - sg_lib: add dWordHex() and sg_is_big_endian() - sync asc/ascq with spc4 rev 02 - sg_cmds: defensive prefill for inquiry commands - sg_opcodes: sync with spc4 rev 02 (add tmf I_T nexus reset) - sginfo: add EBACKERR in Informational exception mode page - add Background control mode page (SBC-3) - sgm_dd: add 'verbose=' option Changelog for sg3_utils-1.16 [20050810] [svn: 58] - sg_ident: new utility to report+set device identifier - sg_map: increase MAX_SG_DEVS from 256 to 2048 - debian: new directory to support deb package builds - sg_get_config: add '--current' option, same as '--rt=1' - update for DVD+RW Dual Layer - sg_inq: add notes in source about use of SCSI INQUIRY - decode Management network addresses VPD page ('-m') - decode Mode page policy VPD page ('-M') - sginfo: increase device mapping capability (> 78 disks) - add '-r' option to scan /dev/raw* device nodes [Tim Hunt] - sg_dd: change bpt default value to 32 when bs >= 2048 bytes - sg_ses: mention SAF-TE in man page - sg_readcap: add '-b' option for brief output (2 hex numbers) - sg_cmds: add sg_ll_start_stop_unit(), sg_ll_prevent_allow(), sg_ll_report_dev_id() and sg_ll_set_dev_id() - sg_lib: add extra argument to sense print functions to enable the suppression of the raw output of the sense buffer - resid > 0 warnings now includes number actually fetched - sg_start: add '-load' and '-eject' options - default to start action when no other indication given - change -imm=0|1 option default to 0 (was 1) - gcc 4.0: cleanup warnings (apart from sgp_dd: revisit later) Changelog for sg3_utils-1.15 [20050605] [svn: 56] - sg_cmds: sg_get_mode_page_controls(): improve error processing, add double fetch - sg_turs, sg_rbuf, sg_requests, sg_test_rwbuf, sg_format, sg_dd and sgm_dd: add O_NONBLOCK to open() - sgm_dd: switch to use SG_IO ioctl (that leaves only sgp_dd using the asynchronous sg write()/read() sequence) - sg_ses: sync with rev 12 changes - sg_map: extend to cope with sparse disk device names with up to 3 letters (e.g. /dev/sdaaa) [Nate Dailey] - sg_modes: add '-f' option to flexibly decode broken mode sense responses. - zero prefill response; stop decoding response after 3 unit attention mode pages seen (i.e. malformed) - add '-L' option for LLBAA bit in msense 10 cdb - sg_reset: update man page - sg_inq: VPD page 0x83: output eui addresses in hex as well - Makefile: fix bug in rules for sgp_dd (when 'make dep' used) - sg_format: expand explanations in its man page - sg_inq, sg_logs, sg_modes, sg_opcodes, sg_rbuf, sg_readcap, sg_scan, sg_senddiag, sg_start and sg_turs: allow command line to take concaternated options - sg_start: add -start and -stop to parallel "1" and "0" - sg_senddiag: set pf bit with '-l' option Changelog for sg3_utils-1.14 [20050506] [svn: 54] - sg_rmsn: new utility to read media serial number - sg_rtpg: add T_SUP bit report - sg_ses: ses-2 rev 11 changes (mainly to additional element status) - add 'bay number' to SAS additional element status - sg_modes: recognise attached enclosure and medium changer - sg_inq: spell out non-zero peripheral qualifiers - note VS bit preceding MultiP(ort) when latter set - VPD page 0x83: output naa addresses in hex as well - sginfo: recognise attached enclosure and medium changer - increase device mapping capability (to 78 disks) [Tim Hunt] - sg_senddiag: add option to send raw diagnostic page - sg_get_config: update some BD information - sg_reasign: add '-g' option to give grown defect list length - sg_dd: note default bpt value (128) may be too high for cd/dvds - sg_lib: sync with SPC-3 rev 22a [opcodes + asc/q] - add DID_IMM_RETRY and DID_REQUEUE [linux specific "host" bytes] - sg_cmds: add send+receive diagnostic, read defect data commands - add duration output on some commands when verbose > 2 - spec: change to produce libsgutils (and -devel variant) as well as sg3_utils binary rpms - sdparm: new utility like hdparm but for SCSI disks (or other devices) - moved to its own package called: sdparm Changelog for sg3_utils-1.13 [20050313] [svn: 52] - sg_format: new utility to format disks (perhaps change block size) - sg_ses: rename "device element" to "additional element" [SES-2 rev 10] - add SAS expander and connector elements; add download microcode and subenclosure nickname diagnostic pages - fix additional element descriptor for SAS - off by 1 error when no type descriptor text in config page - sg_logs: log page for background media scan results - sginfo: add "-flba64" option for outputting 64 bit lba defect lists - sg_get_config: additions for BD from MMC-5 rev 1b - sg_lib: add SG_LIB_CAT_ILLEGAL_REQ sense category - add sg_get_sense_progress_fld() - SPC-3 rev21d updates: report + set timestamp - sg_get_num() + sg_get_llnum(): switch to multipliers that are compatible with SI and with IEC 60027-2. Used modern GNU's dd command as guide. - report field replaceable unit code in fixed format - sg_dd: add logic to use read_long on unrecovered read errors when 'coe' set, read just prior to error if 'coe' clear - both 'odir' and 'blk_sgio" are honoured on block devices - add 'verbose' switch, output some mode page info when verbose - print out elapsed time/throughput when signal received - add new web page discussing sg_dd, copy in html subdirectory - sg_read: add 'blk_sgio' and 'odir' options - sg_wr_mode: clear mode data length in mode select(10) - sg_test_rwbuf: add long options, allow test to run multiple times - sg_cmds: add sg_get_mode_page_types() [get current, changeable, etc] - llseek.c: add Makefile rule without "-std=c99", breaks on some archs Changelog for sg3_utils-1.12 [20050121] [svn: 50] - sg_wr_mode: new utility to modify (i.e. write to) mode pages - sg_reassign: new utility: issues Reassign Blocks command - sg_rtpg: new utility: issues Report Target Port Groups command [Christophe Varoqui] - ATA IDENTIFY command misspelt as "IDENTITY" in several places - sginfo: tweak SAS mode pages to match sas 1.1 rev 07 - add NV_DIS bit to disk caching mode page - sg_map: open /dev/nst* rather than /dev/st* (to stop spurious rewinds) - sg_lib: ATA return sense descriptor - add sg_get_sense_info_fld() to fetch info field from sense data - fix bug in sg_scsi_sense_desc_find() - add sense key specific decoding for fixed format sense data - sg_modes: extend '-p' option to allow '-p=,' - add '-A' option to output all mode pages and subpages - extend '-l' option to show subpages, selected command set pages - sg_inq: fix LUN WWN output in unit path report VPD page (emc) [Hergen Lange] - sg_get_config: some additions for DVD-R dual layer - sg_modes: show write protect (WP) and DpoFua flags for disks - sg_cmds: add llbaa argument to sg_ll_mode_sense10() Changelog for sg3_utils-1.11 [20041126] [svn: 48] - sg_sync: new utility: invokes the synchronize cache command - sg_prevent: new utility: invokes the prevent allow medium removal command - sg_get_config: new utility: get configuration command for dvds and cds - sg_request: fix, allocation length wasn't set - sg_start: remove '-s', as start_stop_unit implicitly syncs caches - sg_ses: add SAS expander element type - sg_inq: add sanity check to unit serial number (VPD page 0x80) - output ANSI version string (e.g. "SPC-2", previously was number) - add '-s' option to decode SCSI Ports VPD page - sg_logs: decoding of format status and non-volatile cache log pages (0x8 and 0x17 in sbc-2) - sg_dd: handle compile error when O_DIRECT not defined - sginfo: tighten sanity checks around Unit serial number VPD page Changelog for sg3_utils-1.10 [20041030] [svn: 46] - sg_readcap, sg_dd, sgm_dd, sgp_dd: fix sg_ll_readcap_10+16 (sg_cmds.c) - sg_luns: new utility to report luns - sg_logs: with '-t' (show temperature) ignore extra parameters in temperature log page (still show them with '-p=d') - sg_ses: clean argument sanity checks - sg_cmds: add more common command wrappers Changelog for sg3_utils-1.09 [20041022] [svn: 44] - sg_ses: new utility to get status and set control on SES devices - sg_verify: new utility to verify block devices - sg_emc_trespass: new utility for EMC specific trespass mode page - sg_request: new utility that sends a REQUEST SENSE command - sg_logs: '-r' to reset to manufacturer's defaults - decode last n error events and last n deferred errors pages - add names of ADC log pages - sg_inq: update to SPC-3 rev 21 - decode Extended INQUIRY data VPD page [0x86] {'-x'} - decode Unit Path Report VPD page [0xc0] (EMC) {'-P'} - sginfo: decode SAS protocol specific lu mode page - sg_err: convert to sg_lib + update to SPC-3 rev 21 - change GPL to FreeBSD license - flag vendor specific asc/ascq ranges - libsgutils: library made from sg_lib.c and sg_cmds.c - rpm "spec" file additionally builds a "-devel" rpm with static libsgutils.a and sg_lib.h and sg_cmds.h - utils/hxascdmp.c: add FreeBSD license - sg_persist: additions to man page - add sg_persist_tst.sh example script to examples directory - sg_turs: add '-v' and '-V' options - sg_senddiag: add '-v' option Changelog for sg3_utils-1.08 [20040831] [svn: 42] - sg_inq: fix noisy message when EVPD and raw modes set - for VPD page 0, list supported page names if known {'-e'} - add '-d' option to list version descriptors - sg_opcodes: numerically sort list of opcodes unless '-u' given - add '-a' to sort alphabetically list of opcode names - add '-t' to report supported task management functions - sg_persist: add 'register and move" PROUT service action - add transportId support, document in sg_persist.8 and example - sg_modes: handle subpage code for known pages (e.g. control extension) - clean up sense buffer handling (allow for descriptor format) - SPC-3 draft revision 20a updates - sg_write_long: new utility to exercise WRITE LONG command - sg_read_long: new utility to exercise READ LONG command - sg_err.c: fix compile errors when SG_KERNEL_INCLUDES defined in lk 2.6 - sg_includes.h typedef of u64 for BLKGETSIZE64 ioctl in lk 2.4 - add safe_strerror(), sg_scsi_normalize_sense(), sg_normalize_sense() and sg_scsi_sense_desc_find() functions - add more sense data descriptor format decoding - move multiple implementations of dStrHex() into sg_err.c - sg_logs: exit if SCSI INQUIRY fails (e.g. when applied to ATA disk) - sginfo: bug fixes and SPC-3 revision 20a updates - add '-E' option to access Control Extension mode (sub)page - sg_start: change '-d' switch to '-v' (verbose) switch for consistency - document extra power condition states in man page - sg_readcap: output rto_en and prot_en bits from long read capacity data - add COVERAGE file to list SCSI command coverage Changelog for sg3_utils-1.07 [20040708] [svn: 40] - sginfo: clean up inquiry vendor,product,revision strings - '-Fhead': sort defect list by head Tom Steudten - rework sg_err for better command name coverage: service actions, variable length and peripheral device type - update asc,ascq codes to SPC-3 revision 19 - move scsi_devfs_scan to archive directory - add sg_opcodes utility to list supported operation codes - add sg_persist utility to support persistent reservations - add '-i' option to sg_inq to decode device identification VPD page (0x83) - sg_inq tries an ATA IDENTIFY if SCSI INQUIRY fails - sg_dd, sgm_dd and sgp_dd calculate block device sizes (if count not given) - drop SG_GET_VERSION_NUM ioctl guard in most utilities Changelog for sg3_utils-1.06 [20040426] [svn: 37] - sg_logs: some HBAs don't like odd transfer lengths so increment - do INQUIRY and output product strings - add ASCII rendering of the Protocol specific SAS page - add '-v' verbose option to output cdb - sg_scan: optionally take device file names (e.g. /dev/hdc and /dev/sda) - only request 36 byte INQUIRY responses - sg_err: add sg_decode_sense() function - sg_inq: update output (ref: SPC-3 t10/1416-d rev 17, 28 January 2004) - remove '-p' option to print out PCI address of host - add '-v' verbose option to output cdb - sginfo: allow '-u' to take hex arguments (prefixed by '0x'), when subpage value is 255 show multiple subpages - accept /dev/hd? ATAPI devices directly in lk 2.6 - add '-t [,]' argument; like '-u' but decodes page if it recognizes it - drop '-L' argument - add cd/dvd, tape, SES, more disk and more SPC-3 decoded mode pages - add transport protocol decoded mode pages for SPI-4, FCP and SAS - sg_modes: print all subpages when '-subp=ff' is selected - do INQUIRY and output product strings - add '-v' verbose option to output cdb - Makefile: add -W compile flag and fix exposed warnings - .spec file: change to build on Mandrake without errors Changelog for sg3_utils-1.05 [20031112] [svn: 35] - sginfo: major rework; add IE page, clean up control, cache + disconnect pages (as per SPC-3 and SBC-2). - when storing, update saved page (change from previous version) - use 10 byte mode sense and select by default (override with '-6') - mode subpage support - sg_dd, sgm_dd + sgp_dd: - 64 bit capable (read capacity; count, skip and seek values). - numerical arguments accept hex (prefixed by '0x' or '0X') - require bpt > 0 - fix problem when reading /dev/null - sg_dd: Treat SIGUSR1 properly: print stats and continue; - sgp_dd: reduce READ CAPACITY response size to 8 bytes - sg_read: require bpt > 0 - sg_test_rwbuf: switch from sg_header to sg_io_hdr interface N.B. After these changes no sg3_utils utilities (in the main directory) use the sg_header interface - sg_scan: switch from sg_header to sg_io_hdr interface - sg_senddiag: increase extended foreground timeout to 60 minutes - sg_inq: add names of peripheral device types - sg_readcap: show total size in bytes, MB, GB - sg_logs: read log pages twice (first time to get response length), for fragile HBAs; decode Seagate 0x37 + 0x3e pages; display pcbs - sg_modes: fix core dump when corrupted response, don't print extra pages - sg_map: increase sg device scanning from 128 to 256 - change man page references from lk 2.5 to lk 2.6 - examples/sg_iovec_tst: added testing sg_iovec (sg_io_hdr iovec's) [retrospective addition to this log: "#define __user" added into sg_include.h so user space programs aren't broken if they choose to include kernel header.] - utils/hxascdmp: add utility for displaying ASCII hex Changelog for sg3_utils-1.04 [20030513] [svn: 33] - all remaining utilities in the main directory have man pages [thanks to Eric Schwartz for 7 man pages] - add CREDITS file - sg_simple1, sg_simple2, sg_simple3, sg_simple4, sg_simple16 and scsi_inquiry: moved to the examples directory - sg_debug: moved to the archive directory - sg_modes: add '-subp=' for sub page code, suggests 6/10 byte alternative if bad opcode sense received, flip -cpf flag to -pf, add page names for most peripheral types - sg_turs: default '-n=' argument to 1, only when '-n=1' print error message in full - sg_logs: print temperature "" for 255, '-t' switch for temperature (from either temperature or IE log page) - sg_dd: add '-odir=0|1' switch for O_DIRECT on block devices - sg_start: add '-imm', '-loej' and 'pc=' switches plus man page - sg_readcap: add '-pmi' and 'lba=' switches - open files O_NONBLOCK in sg_inq, sg_modes and sg_logs so they can be used on cd/dvd drivers when there is no disk present Changelog for sg3_utils-1.03 [20030402] [svn: 30] - sg_senddiag: added, allows self tests and listing of diag pages - sg_start: changed to use SG_IO so works on block devices - sg_err: print out some "sense key specific" data [Trent Piepho] - sg_modes: add "-6" switch for force 6 byte MODE SENSE [Trent Piepho] - sg_modes: more information on page codes and controls - sg_inq, sg_modes, sg_logs, sg_senddiag: add man pages - sg_dd: add "append=0|1" switch for glueing together large files - note in README about utilities offered by scsirastools package Changelog for sg3_utils-1.02 [20030101] [svn: 28] - sg_inq: check if cmddt or evpd bits ignored - sg_inq: warn -o= not used for standard INQUIRY - sg_turs: add -t option to time Test Unit Ready commands - sg_errs: (used by most utilities) warn if sense buffer empty - sg_modes: make safe with block SG_IO (bypass SG_GET_SCSI_ID ioctl) - sg_logs: make safe with block SG_IO, self-test page work - sg_dd: add "blksg_io=" switch to experiment with block SG_IO - sg_read: now use SG_IO ioctl rather than sg write/read - sginfo: fix writing parameters, check for block devices that answer sg's ioctls, recognize "scd" device names - sg_map: stop close error report on tape devices - sg_readcap: make safe with block SG_IO - sg_start: make safe with block SG_IO - sg_test_rwbuf: make safe with block SG_IO Changelog for sg3_utils-1.01 [20020814] [svn: 27] ---------------------------- - add raw switch ("-r") to sg_inq [Martin Schwenke] Changelog for sg3_utils-1.00 [20020728] [svn: 26] ---------------------------- - update sg_err [to SPC-3 T10/1416-D Rev 07 3 May 2002] - "sg_inq -cl" now outputs opcode names - add "continue on error" option to sg_dd - add _LARGEFILE64_SOURCE _FILE_OFFSET_BITS=64 defines to Makefile - drop 'gen' argument from sg_dd and friends, allow any file types except scsi tape device file names - treat of=/dev/null as special (skip write). Accept of=. as alias for of=/dev/null - decode various log pages in sg_logs - add 'dio' argument to sgm_dd for testing "zero copy" copies Changelog for sg3_utils-0.99 [20020317] ---------------------------- - add 'fua' and 'sync' arguments to sg_dd, sgp_dd and sgm_dd - improve sg_inq, add "-cl" and "-36" arguments - add sg_modes + sg_logs for MODE SENSE and LOG SENSE queries - add rescan-scsi-bus.sh [Kurt Garloff] to archive directory Changelog for sg3_utils-0.98 [20020216] ---------------------------- - move sg_reset back from archive to main directory + build - sprintf() to snprintf() changes - add "time=" argument to sg_dd, sgp_dd and sgm_dd to time transfer - add man pages for sgm_dd and sg_read, update sg_dd and sgp_dd man pages - add "cdbsz=" argument to sg_dd, sgp_dd, sgm_dd + sg_read - add "gen=0|1" argument to sg_dd Changelog for sg3_utils-0.97 [20011223] ---------------------------- - move isosize to archive since introduced into util-linux-2.10s Changelog for sg3_utils-0.96 [20011221] ---------------------------- - add '-p' switch to sg_inq to provide PCI slot_name - add '-n' switch to scsi_inquiry for non-blocking open - new sgm_dd (dd variant) using mmap-ed IO - sg_rbuf now has a '-m' argument to select mmap-ed IO - sg_rbuf now has a '-t' switch to do timing + throughput calculation - add sg_simple4 to demonstrate mmap-ed IO on an INQUIRY response - add sg_simple16 to do a READ_16 (16 byte SCSI READ command) - mmap-ed IO requires sg version 3.1.22 or later - add sg_read to read multiple times starting at same offset Changelog for sg3_utils-0.95 [20010915] ---------------------------- - make sg_dd, sgp_dd and archive/sgq_dd warn if dio selected but /proc/scsi/sg/allow_dio is '0' - sg_map can now do any INQUIRY (when '-i' argument given) - expand example in scsi_inquiry Changelog for sg3_utils-0.94 [20010419] ---------------------------- - add sg_start, documented in README.sg_start [Kurt Garloff] - add osst support in sg_map [Kurt Garloff] - improvements to sginfo [Kurt Garloff] Changelog for sg3_utils-0.93 [20010415] ---------------------------- - more include file fine tuning - some "dio" work sg_rbuf - extend sgp_dd so "continue on error" works on normal files - introduce sg_include.h to encapsulate sg include problems - add scsi_devfs_scan - add sg_bus_xfer to archive directory - more error info in sginfo Changelog for sg3_utils-0.92 [20010116] ---------------------------- - change sg_err.c output from stdout to stderr - change sg_debug to call system("cat /proc/scsi/sg/debug"); - fix in+out totals in sg_dd and sgp_dd when partial transfers - lower include dependencies in sg_err.h - add sgq_dd + Makefile to archive directory Changelog for sg3_utils-0.91 [20001221] ---------------------------- - signalling handling added to sg_dd (and documented in sg_dd.8) - add man page for sg_rbuf (and a small change to its code) - add "-d" switch to isosize and cope with > 2 GB (and man page) Changelog for sg3_utils-0.90 ---------------------------- - switch from dated versioning. Previous version was sg3_utils001012. Arbitrarily start at package version 0.90 . Start Changelog. - incorporate Kurt Garloff's patches from Suse scsi.spm source rpm compilation: - add Kurt Garloff's sg_test_rwbuf utility to read and write to disk buffer - clean up Makefile to include a "make install" (and also add a "make uninstall"). - add "-uno" switch to sginfo - make raw and sg devices equally acceptable to sg_dd and sgp_dd. [Raw devices still not as fast as sg devices doing disk to disk copies in sgp_dd but this may be improved soon. Still faster than using dd!] - change lseek() in sg_dd and sgp_dd to _llseek() [using code borrowed from fdisk] so big disks can be properly offset with 'skip' and 'seek' arguments. [This change is significant for raw devices and normal files since sg devices already use 31 bit block addressing.] - rename sg_s3_inq to sg_inq. This utility allows the INQUIRY response to be decoded as per SCSI 3 and 4. Also can probe VPD and CmdDt pages. - change multiplier suffixes on sg_dd, sgp_dd and sg_turs so lower case "k, m, g" are powers of 2 while "K, M, G" are powers of 10. This idea borrowed from lmdd (lmbench suite) - retire a few more less used utilities into the archive directory. - add man pages for sg_dd, sgp_dd and sg_map CREDITS000064400000012767152526361340005610 0ustar00The author of sg3_utils would like to thank the following people who have made contributions: Andries Brouwer rewrite of isosize (original written by Joerg Schilling). isosize is now found in the util-linux package and in the archive directory of this package. Bart Van Assche harden (improve) code in rescan-scsi-bus.sh [20160224] configure.ac and Makefile.am cleanup plus sgp_dd code to replace pthread_cancel with pthread_kill [20180102] Brian Bunker contributed sg_read_block_limits and the target reset addition to sg_reset [20090615] Christophe Varoqui original sg_rtpg [20041229] Clayton Weaver contributed safe_strerror(). Dan Horak website support for this package and others. Lot of fixes, recently man pages [20140128] Dave Johnson improved disk defect list handling [20051218] Dave Williams help with sgp_dd especially and "> 0x7fffffff" with sg*_dd [20060303] Eric Schwartz who wrote these man pages: sg_readcap, sg_reset, sg_scan, sg_start, sg_test_rwbuf, sg_turs and sginfo Eric Seppanen borrowed ideas from alternate implementation of sg_compare_and_write [20130823] Eric Youngdale author of scsi_info on which sginfo is based. Frank Jansen : additions to sg_scan; contributed code for '--alloc-length=' option in sg_persist [20090402] Grant Grundler co-author of blk512-linux that has become sg_format [20050201] Greg Inozemtsev extensions to sg_xcopy [20130207+20130816] Hannes Reinecke contributed sg_rdac, (and some corresponding VPD entries to sg_vpd_vendor), sg_stpg and sg_safte [20071013+20130110] sg_referrals [20100906] sg_inq --export option [20120220+20130109] sg_xcopy+sg_copy_results [20120322] rescan-scsi-bus.sh patches to Kurt Garloff's v1.57 [20130715] 55-scsi-sg3_id.rules + 58-scsi-sg3_symlink.rules [20140527] sg_sat_read_gplog [20141107] sg_inq --only option plus --inhex fixes [20180102] Hayashi Naoyuki port to Tru64 [20060127] Heiko Eissfeldt sg based example programs for the original sg driver Ilan Steinberg sg_xcopy: contributed --on_src and --on_dst options [20130505] Ingo van Lil contributed sg_raw [20070331] James Bottomley co-author of blk512-linux that has become sg_format [20050201] Jan Engelhardt autotools clean-up [20150216] Joe Krahn help with int64_t cleanup [20071219] Kai Makisara help with tape minor numbers in lk 2.6 plus earlier advice [20081008] Kurt Garloff original sg_start and sg_test_rwbuf. Additions to sginfo and sg_map. Author of rescan-scsi-bus.sh with latest update to v1.57 [20130331] Lars Marowsky-Brée contributed Unit Path Report VPD page decoding in sg_inq (vendor specific: EMC) and sg_emc_trespass utility Luben Tuikov help with documentation and other suggestions [20061014] contribution sg_read_buffer and sg_write_buffer [20061103] Marius Konitzer suggested and tested oflag=sparse for sg_dd Martin Schwenke added the raw switch "-r" to sg_inq Nate Dailey < Nate dot Dailey at stratus dot com > extended sg_map for sparse disk node names (e.g. /dev/sdaaa) [20050511] Pat LaVarre pointed out danger of negative bpt values in sg_dd (and friends); also problems when reading /dev/null Peter Allworth original dd clone design used by sg3_utils's dd variants (e.g. sg_dd). Roland Dreier extension and correction to sg_xcopy [20120205] Ronnie Sahlberg has written libiscsi and a set of external patches to add direct iSCSI support to this package. See README.iscsi [20110518] Saeed Bishara contributed sg_write_long Sean Stewart various improvements to rescan-scsi-bush.sh script [20130827] Shahar Salzman contributed sg_compare_and_write [20121205] Thomas Kolbe Solaris port help and testing [20070503] Tim Hunt increased number of (sd and sg) devices that sginfo could detect. Tom Steudten sginfo addition: add '-Fhead' option to sort defect list by head. Trent Piepho print out some "sense key specific" data and "-6" switch for sg_modes Douglas Gilbert 2nd January 2018 README.sg_start000064400000002316152526361340007262 0ustar00Hi, you can use sg_start to start (spin-up, 1) and stop (spin-down, 0) devices. I also offers a parameter (-s) to send a synchronize cache command to a device, so it should write back its internal buffers to the medium. Be aware that the Linux SCSI subsystem at this time does not automatically starts stopped devices, so stopping a device which is in use may have fatal results for you. So, you should apply with care. I use it in my shutdown script at the end (before the poweroff command): # SG_SHUG_NOS is set in my config file rc.config # SG_SHUT_NOS="0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15" if test -x /bin/sg_start; then if test "`basename $command`" = "reboot"; then for no in $SG_SHUT_NOS; do /bin/sg_start /dev/sg$no -s >/dev/null 2>&1; done else for no in $SG_SHUT_NOS; do /bin/sg_start /dev/sg$no -s 0 >/dev/null 2>&1; done fi fi Enjoy! Kurt Garloff Postscript ========== sg_start has been reworked to allow a block device (e.g. /dev/sda) in addition to the sg device name (e.g. /dev/sg0) in the lk 2.6 series. sg_start now has more command line options, see its man page. Douglas Gilbert 2004/5/8 BSD_LICENSE000064400000002434152526361340006253 0ustar00 Copyright (c) 1999-2018, Douglas Gilbert All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.