Projects / sg3_utils

sg3_utils

sg3_utils is a package of utilities for accessing devices that use SCSI command sets. Most utilities issue a single command and display the response, while some work at a slightly higher level. There are utilities for fetching INQUIRY data and VPD, mode, and log pages. There is support for modern SCSI transports such as SAS and FCP. The package is written for Linux and has been ported to FreeBSD, Solaris, Tru64, and Windows. There is an earlier version of this package for Linux 2.2 series kernels called sg_utils.

Licenses

RSS Recent releases

  •  19 Jan 2013 01:08

Release Notes: This release adds the sg_compare_and_write utility. www.t10.org changes since October 2012 have been tracked .

  •  15 Oct 2012 03:19

Release Notes: This release adds sg_xcopy and sg_copy_results for SCSI EXTENDED COPY command support. Changes have been tracked at www.t10.org since January 2012.

  •  19 Jan 2012 23:34

Release Notes: This release adds another major reworking of the sg_ses utility. SCSI (t10.org) draft standard changes were incorporated.

  •  04 Aug 2011 06:53

Release Notes: A sg_sanitize utility was added. A major rework of the sg_ses utility was undertaken. SCSI (t10.org) draft standard changes were incorporated.

  •  17 Feb 2011 06:12

Release Notes: A sg_decode_sense utility was added along with additional decode logic for new SCSI sense descriptors. SCSI draft standard changes were incorporated.

RSS Recent comments

25 Apr 2013 16:01 Tom4015

Does Sdparm support SCSI FW download?

25 Jan 2012 16:42 yuvalkashtan

We have developed sg_xcopy and would like to submit it.
Supposed to work for every VAAI (VMWare accelerated...) compliant storage system.

Are you interested in adding it to the sg3_utils? or otherwise we'll open a new package.

TIA,
Yuval.

04 Aug 2011 03:08 dpgilbert

The x64 windows problem reported by xu_john with the DataBufferOffset field has been fixed. That fix will appear in version 1.33 .
As for OS X, Apple have an aversion to generic SCSI pass-throughs. They suggest writing a special driver for each type of controller if I understand their explanation. I have no intention of doing that.

25 Feb 2011 08:22 KeithLocke

I have used the sg3_utils for years on Linux, and it is one of the greatest set of tools ever created, but now I am in need of these features on OS X 10.6.6. I have been unable to get the source to build, any direction would be greatly appreciated.

20 Feb 2011 02:17 xu_john

sg_utils(sg_inq) not work in x64 windows(2003 and 2008) using VS2005

The DeviceIoControl return error code 1306, the root cause is a field of
SCSI_PASS_THROUGH structure using wrong data type,

in file sg_pt_win32.h file
ULONG DataBufferOffset;

but in MSDN, it's
ULONG_PTR DataBufferOffset;

In 32bit Windows, the ULONG and ULONG_PRT is the same size(4bytes), but for
64bit Windows, the ULONG_PTR is 8bytes, and ULONG only 4bytes, After change
the data type the sg_inq work fine.

Not sure here existing any other different type between the sg_utils and MSDN.

Screenshot

Project Spotlight

Lilith Logback event viewer

A logging and access event viewer for Logback.

Screenshot

Project Spotlight

Diffuse

A graphical tool for comparing and merging text files.