Skip to contentSkip to conversation

sg3_utils-1.27 available

Announce Douglas Gilbert 2 participants 4 messages Apr 12, 2009 – Apr 13, 2009 SCSI

lore
Share & tools
lore
#0 lore raw

sg3_utils is a package of command line utilities for sending SCSI and some ATA commands to devices. This package targets the linux kernel (lk) 2.6 and lk 2.4 series. Ported to FreeBSD, Tru64, Solaris, and Windows (cygwin and mingw).

This version adds one new utility: sg_write_same. Various changes made by www.t10.org since June 2008 are reflected in this version. Thin provisioning support is new and more support has been added for large sector sizes. The Linux port adds support for bsg devices. Copy of ChangeLog below.

Note that the web site has changed since the last release.

For an overview of sg3_utils and downloads see this page:
http://sg.danny.cz/sg/sg3_utils.html
The sg_dd utility has its own page at:
http://sg.danny.cz/sg/sg_dd.html
The SG_IO ioctl is discussed at:
http://sg.danny.cz/sg/sg_io.html
A full changelog can be found at:
http://sg.danny.cz/sg/p/sg3_utils.ChangeLog

A release announcement has been sent to freshmeat.net . [Given the current state of freshmeat.net I have no idea whether that was successful. My sg3_utils and sg_utils projects were mashed up together.]

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]
....

Doug Gilbert

#1 lore raw

Hello Doug , I thought sometime ago I'd mentioned the lack of support
for device name(actuall filename) expansion in these tools .
I am aware that a simple 'for do' loop would acomplish the same thing
but that requires writing a script/function in order to do something that bash/ksh/.../??? has had available for quite sometime now .
Would you please entertain the request to add the ability to use shell
expansion of file expansion in the sg3 tools ?

Tia , JimL

$ sudo src/sginfo  /dev/sg[0-5]
INQUIRY response (cmd: 0x12)
----------------------------
Device Type                        0
Vendor:                    SEAGATE
Product:                   ST118273LW
Revision level:            6246

Only gives me device sg0 .

Signature · 5 lines
+------------------------------------------------------------------+
| James   W.   Laferriere | System    Techniques | Give me VMS     |
| Network&System Engineer | 2133    McCullam Ave |  Give me Linux  |
| [email protected] | Fairbanks, AK. 99701 |   only  on  AXP |
+------------------------------------------------------------------+
#2 lore raw
Quoted 6 lines · Mr. James W. Laferriere

Hello Doug , I thought sometime ago I'd mentioned the lack of
support for device name(actuall filename) expansion in these tools .
I am aware that a simple 'for do' loop would acomplish the same
thing but that requires writing a script/function in order to do something that bash/ksh/.../??? has had available for quite sometime now .
Would you please entertain the request to add the ability to use
shell expansion of file expansion in the sg3 tools ?

Jim,
sginfo is particularly difficult due to its syntax:
sginfo [OPTIONS] [DEVICE] [REPLACEMENT_PARAMETERS]

In the worst case it would be hard to distinguish between an additional DEVICE and the replacement parameters. As noted in its man page sginfo is a port of Eric Youngdale's scsiinfo utility. I regard sginfo as in legacy mode and suggest people use sdparm instead.

And sdparm does what you want, its syntax is:
sdparm [OPTIONS] DEVICE [DEVICE...]
That was done in response to a request from you!

Currently all the utilities in sg3_utils only support one device. In the sg3_utils/scripts directory are bash script examples, some of which do want you want. Even after cleaning up the option processing in sg3_utils with getopt_long() it only takes a small flourish to cause problems if multiple device names are allowed. For example, sg_start can be used to spin down a disk with either:
sg_start --stop /dev/sdc
sg_start 0 /dev/sdc
Now the second invocation becomes ambiguous if multiple device names are allowed and there is a device name called "0" in the current directory.

Some utilities are already dangerous, even when they look safe. Allowing multiple file names compounds the danger. For example, some SCSI commands are quite creative with their use of zero. If multiple devices were allowed, do not try this:
sg_write_same --num=0 /dev/sd*

Doug Gilbert

#3 lore raw

Hello Doug ,

Quoted 12 lines · Douglas Gilbert
Quoted 6 lines · Mr. James W. Laferriere

Hello Doug , I thought sometime ago I'd mentioned the lack of support
for device name(actuall filename) expansion in these tools .
I am aware that a simple 'for do' loop would acomplish the same thing
but that requires writing a script/function in order to do something that bash/ksh/.../??? has had available for quite sometime now .
Would you please entertain the request to add the ability to use shell
expansion of file expansion in the sg3 tools ?

Jim,
sginfo is particularly difficult due to its syntax:
sginfo [OPTIONS] [DEVICE] [REPLACEMENT_PARAMETERS]

Quoted 5 lines

In the worst case it would be hard to distinguish between an additional DEVICE and the replacement parameters. As noted in its man page sginfo is a port of Eric Youngdale's scsiinfo utility. I regard sginfo as in legacy mode and suggest people use sdparm instead.

Ok , I see the problem(s) .

Quoted 3 lines

And sdparm does what you want, its syntax is:
sdparm [OPTIONS] DEVICE [DEVICE...]
That was done in response to a request from you!

I thought we had discussed this sometime ago , Just getting early
old'timers :) . It helped me very much in a previous life .

Quoted 14 lines

Currently all the utilities in sg3_utils only support one device. In the sg3_utils/scripts directory are bash script examples, some of which do want you want. Even after cleaning up the option processing in sg3_utils with getopt_long() it only takes a small flourish to cause problems if multiple device names are allowed. For example, sg_start can be used to spin down a disk with either:
sg_start --stop /dev/sdc
sg_start 0 /dev/sdc
Now the second invocation becomes ambiguous if multiple device names are allowed and there is a device name called "0" in the current directory.

Quoted 6 lines

Some utilities are already dangerous, even when they look safe. Allowing multiple file names compounds the danger. For example, some SCSI commands are quite creative with their use of zero. If multiple devices were allowed, do not try this:
sg_write_same --num=0 /dev/sd*

Same as above , I'm finally seeing the light .

Quoted 1 line

Doug Gilbert

Tnx , JimL

Signature · 5 lines
+------------------------------------------------------------------+
| James   W.   Laferriere | System    Techniques | Give me VMS     |
| Network&System Engineer | 2133    McCullam Ave |  Give me Linux  |
| [email protected] | Fairbanks, AK. 99701 |   only  on  AXP |
+------------------------------------------------------------------+