COMPARE AND WRITE(8) SG3_UTILS COMPARE AND WRITE(8) (NAME) sg_compare_and_write - SCSI COMPARE AND WRITE (SYNOPSIS) sg_compare_and_write [--dpo] [--fua] [--fua_nv] [--grpnum=GN] [--help] --in=IF [--inw=WF] --lba=LBA [--num=NUM] [--quiet] [--timeout=TO] [--verbose] [--version] [--wrprotect=WP] [--xferlen=LEN] DEVICE (DESCRIPTION) SCSI COMPARE AND WRITE DEVICE . . --inw=WF --in=IF --inw=WF . --inw=WF --in=IF . NUM . LBA DEVICE ( LBA DEVICE ) COMPARE AND WRITE MISCOMPARE . 14 ( MISCOMPARE ) . LBA NUM DEVICE . (data-out) COMPARE AND WRITE --xferlen=LEN . LEN (2 * NUM * 512) NUM 1024 . 512 --xferlen=LEN . ( WP 0 ) NUM LEN 1040 . SCSI READ CAPACITY ( ). T10 SCSI COMPARE AND WRITE DEVICE . DEVICE (verify) . LBA DEVICE MISCOMPARE stderr ( ). --quiet . --quiet 14 . SBC-3 36 . SBC-3 SCSI . (OPTIONS) . . -d, --dpo DPO CDB COMPARE AND WRITE. -f, --fua FUA CDB COMPARE AND WRITE. -F, --fua_nv FUA_NV CDB COMPARE AND WRITE. SBC-3 35d << >> . -g, --grpnum=GN GN CDB COMPARE AND WRITE . GN 0 63 0 . -h, --help . -i, --in=IF () IF. ( --inw=WF ) ( --inw=WF ). IF '-' stdin ( ) . -C, --inc=IF --in. -D, --inw=WF () WF. DEVICE COMPARE AND WRITE . --in=IF . -l, --lba=LBA LBA COMPARE AND WRITE . '0x' 'h' . -n, --num=NUM NUM LBA NUM LBA . NUM 1 . -q, --quiet MISCOMPARE stderr . 14 MISCOMPARE . -t, --timeout=TO TO . 60 . NUM ( ) 60 . -v, --verbose ( ). -V, --version . -w, --wrprotect=WP WRPROTECT cdb WP. 0 ( ) . -x, --xferlen=LEN LEN . (2 * NUM * 512) . DEVICE 512 WP ( ) LEN . (NOTES) ( LBA) . <> sg3_utils(8) . (EXAMPLES) (SCSI) . 512 . ( backup01.bin) : # sg_dd if=/dev/sg1 bs=512 of=backup01.bin count=2 2+0 records in 2+0 records out : /dev/sg1 (mounted) __. (unmount) . . scsi_debug . 0xff : # sg_dd iflag=ff bs=512 of=/dev/sg1 count=1 1+0 records in 1+0 records out 0x0: # sg_dd iflag=00 bs=512 seek=1 of=/dev/sg1 count=1 1+0 records in 1+0 records out : # sg_dd if=/dev/sg1 bs=512 of=ff00.bin count=2 2+0 records in 2+0 records out compare and write . ( LBA 0) ( ff00.bin) . ( 0xff ) ff00.bin LBA 0 : # sg_compare_and_write --in=ff00.bin --lba=0 --num=1 /dev/sg1 ( ). : # sg_compare_and_write --in=ff00.bin --lba=0 --num=1 /dev/sg1 Miscompare at byte offset: 0 [0x0] sg_compare_and_write failed: Miscompare . sg_compare_and_write 0x0 LBA 0x0 . sg_compare_and_write LBA 0x0 0xff ( : 0) . 3 ff00.bin 0x0 : # sg_dd bs=1 iflag=00 of=ff00.bin count=3 3+0 records in 3+0 records out 'bs=1' . dd ( sg_dd) . sg_compare_and_write : # sg_compare_and_write --in=ff00.bin --lba=0 --num=1 /dev/sg1 Miscompare at byte offset: 3 [0x3] sg_compare_and_write failed: Miscompare 0 1 2 3 . SCSI COMPARE AND WRITE . (EXIT STATUS) sg_compare_and_write 0 . 14 . EXIT STATUS sg3_utils(8) . MISCOMPARE 98 . (AUTHORS) Shahar Salzman. Douglas Gilbert. Eric Seppanen. (REPORTING BUGS) shahar.salzman@kaminario.com dgilbert@interlog.com (COPYRIGHT) Copyright (C) 2012-2020 Kaminario Technologies LTD Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * 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. * Neither the name of the nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 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 Kaminario Technologies LTD 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. (SEE ALSO) sg_xcopy, sg_receive_copy_results(sg3_utils) sg3_utils-1.47 April 2021 COMPARE AND WRITE(8)