iscsi-md5sum: Add new tool

The new tool 'iscsi-md5sum' is used to calculate MD5 value of an iSCSI
target. This help users to verify data at range [LBA, Length).

For example, double-write on a RAID1 of 2 iSCSI targets, a daemon
process runs iscsi-md5sum to check data periodically.

Originally, we have to use several steps to achieve:
1, use iscsiadm to login.(root privilege required)
2, use dd(dd if=/dev/sdX of=/TMPPATH bs=4k count=LENGTH skip=LBA)
   to dump data. (root privilege required, additional disk space required)
3, use md5sum to calculate MD5 value
4, remove data.

Instead, a single command iscsi-md5sum without root privilege is enough.

Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
This commit is contained in:
zhenwei pi
2023-07-28 18:34:10 +08:00
parent 9e9a3e8198
commit 45b274aec8
2 changed files with 596 additions and 1 deletions

View File

@@ -3,7 +3,7 @@ AM_CFLAGS = $(WARN_CFLAGS)
AM_LDFLAGS = -no-undefined
LIBS = ../lib/libiscsi.la
bin_PROGRAMS = iscsi-inq iscsi-ls iscsi-swp iscsi-pr iscsi-discard
bin_PROGRAMS = iscsi-inq iscsi-ls iscsi-swp iscsi-pr iscsi-discard iscsi-md5sum
if !TARGET_OS_IS_WIN32
bin_PROGRAMS += iscsi-perf iscsi-readcapacity16
endif