SG_COPY_RESULTS(8)
β¨ NAME β¨
Okay bestie, let's talk about sg_copy_results π It's how you send a SCSI RECEIVE COPY RESULTS command (XCOPY related) π§
π SYNOPSIS π
sg_copy_results [--failed|--params|--receive|--status] [--help] [--hex]
[--list_id=ID] [--readonly] [--verbose] [--version] [--xfer_len=BTL]
DEVICE
πΈ DESCRIPTION πΈ
Okay so this utility is literally made to check on the status of the SCSI Extended Copy (XCOPY) facility π₯ (see SPC-3 revision 23 sections 6.3 and 6.17). It's showing up in some modern storage arrays, so you might be seeing it out in the wild. It sends a SCSI RECEIVE COPY RESULTS command to the given DEVICE and then shows you whatever came back π
Now the lore π During the draft stages of SPC-4, the T10 committee glowed up the XCOPY command so it now has two variants: "LID1" (for a List Identifier length of 1 byte) and "LID4" (for a List Identifier length of 4 bytes). This utility supports the older LID1 variant, which is also found in SPC-3 and earlier. The LID1 variant in SPC-4 is command level (binary) compatible with XCOPY as defined in SPC-3, but some of the command naming has changed. This utility sticks with the older, SPC-3 XCOPY names π¦
The command has four distinct modes of operation, and the service action field is what tells them apart π
COPY STATUS [SPC-4: RECEIVE COPY STATUS(LID1)] Shows the current status of the EXTENDED COPY command identified by the list id field π
RECEIVE DATA [SPC-4: RECEIVE COPY DATA(LID1)] Returns the held data read by the EXTENDED COPY command identified by the list id field. Highkey, this option only means something if the respective segment descriptor is supported π
OPERATING PARAMETERS [SPC-4: RECEIVE COPY OPERATING PARAMETERS] Returns the copy manager operating parameters β¨ This one is also super useful for figuring out if the SCSI Extended Copy facility is supported at all.
FAILED SEGMENT DETAILS [SPC-4: RECEIVE COPY FAILURE DETAILS(LID1)] Returns the copy target device sense data and other info about any failed segments π
π OPTIONS π
Quick reminder: arguments to long options are mandatory for short options as well π«Ά
-f,--failedβ sets the service action field to FAILED SEGMENT DETAILS [4] π-h,--helpβ outputs the usage message, then exits π§-H,--hexβ prints out the response buffer in hex π₯-l,--list_id=IDβ sets the list identifier field toID(default:0) πΈ-p,--paramsβ sets the service action field to OPERATING PARAMETERS [3]. This is the default, so you're already in the right place π-R,--readonlyβ opens theDEVICEread-only (e.g. in Unix with theO_RDONLYflag). The default is to open it read-write, so add this if you want to be extra careful π-r,--receiveβ sets the service action field to RECEIVE DATA [1] π¦-s,--statusβ sets the service action field to COPY STATUS [0] π-v,--verboseβ turns up the verbosity (aka debug output) π-V,--versionβ prints the version string, then exits β¨-x,--xfer_len=BTLβ sets the allocation length field toBTL. This is the byte transfer length and the maximum (byte) size of the response.BTLmust be less than10000and defaults to520π
π NOTES π
Decoding of RECEIVE DATA service action is not implemented. Don't say I didn't warn you π
Lowkey iconic history: the functionality of sg_xcopy has been ported to the more general ddpt utility (and package), and the functionality of this utility has been ported to the ddptctl utility π§
π§ EXAMPLES π§
Let's query the operating parameters for a device π
# sg_copy_results -p /dev/sdo
Receive copy results (report operating parameters):
Supports no list identifier: no
Maximum target descriptor count: 2
Maximum segment descriptor count: 1
Maximum descriptor list length: 92 bytes
Maximum segment length: 33553920 bytes
Inline data not supported
Held data limit: 0 bytes
Maximum stream device transfer size: 0 bytes
Total concurrent copies: 0
Maximum concurrent copies: 255
Data segment granularity: 512 bytes
Inline data granularity: 1 bytes
Held data granularity: 1 bytes
Implemented descriptor list:
Segment descriptor 0x02: Copy from block device to block device
Target descriptor 0xe4: Identification descriptor
π EXIT STATUS π
The exit status of sg_copy_results is 0 when it's successful. Otherwise, check out the sg3_utils(8) man page for the deets β
π¦ AUTHORS π¦
Written by Douglas Gilbert π
π REPORTING BUGS π
Report bugs to <dgilbert at interlog dot com> π«Ά
π₯ COPYRIGHT π₯
Copyright Β© 2012-2014 Hannes Reinecke and Douglas Gilbert. This software is distributed under a BSD-2-Clause license. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE π
π SEE ALSO π
sg_xcopy(sg3_utils), ddpt, ddptctl(ddpt) π
Bestie, you're literally so ready to query XCOPY now π Stay iconic. This page is from sg3_utils-1.40, September 2014 πΈβ¨
π¦ where this page comes from
- alpine 3.24: sg3_utils-doc 1.48-r0 Β· BSD-2-Clause AND GPL-2.0-or-later
- arch rolling: sg3_utils 1.49-1 Β· GPL-2.0-or-later AND BSD-2-Clause
- centos-stream 10: sg3_utils 1.48-11.el10 Β· GPL-2.0-or-later AND BSD-2-Clause
- debian trixie: sg3-utils 1.48-3~deb13u1
- fedora 43: sg3_utils 1.48-10.fc43 Β· GPL-2.0-or-later AND BSD-2-Clause
- fedora 43: sg3_utils 1.48-6.fc43 Β· GPL-2.0-or-later AND BSD-2-Clause
- fedora 44: sg3_utils 1.48-10.fc44 Β· GPL-2.0-or-later AND BSD-2-Clause
- fedora 44: sg3_utils 1.48-8.fc44 Β· GPL-2.0-or-later AND BSD-2-Clause
- nixos 26.05: sg3_utils 1.48
- nixpkgs unstable: sg3_utils 1.49
- ubuntu questing: sg3-utils 1.48-2ubuntu1
- ubuntu resolute: sg3-utils 1.48-3ubuntu3
- ubuntu resolute: sg3-utils 1.48-3ubuntu3.2
- ubuntu stonking: sg3-utils 1.48-3ubuntu5
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms