From aca9d4f4895f3e048df3db16b7606e2a7eb1d86f Mon Sep 17 00:00:00 2001 From: DatuX Date: Tue, 8 Mar 2022 18:54:44 +0100 Subject: [PATCH] Updated zfs check (markdown) --- zfs-check.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/zfs-check.md b/zfs-check.md index 2b587ec..7604904 100644 --- a/zfs-check.md +++ b/zfs-check.md @@ -4,7 +4,7 @@ zfs-check is a tool to generate checksum streams from a zfs datasets. (it also can be used on regular block devices and files) -Its kind of like sha1sum but incremental: It generates a hash per "chunk" of data. This allows you to use it on huge datasets and only do a partial check of the data. +Its kind of like sha1sum but incremental: It generates a sha1 hash per "chunk" of data. This allows you to use it on huge datasets and only do a partial check of the data. ## Why? @@ -89,8 +89,30 @@ You can use it via a simple SSH pipe to compare to datasets: ``` +## Only checking a small sample of the total data +You can use the `--skip` option to skip a certain amount of chunks. To only check 10% of your data use --skip 9. (It will check 1 block and then skip 9 blocks) +```shell +[root@pve1 ~]# zfs-check rpool/data/vm-101-disk-0@offsite-20220308020453 --skip 9 --verbose + zfs-check v3.2-alpha2 - (c)2022 E.H.Eefting (edwin@datux.nl) + + Target : rpool/data/vm-101-disk-0@kantoor_offsite-20220308020453 + Block size : 4096 bytes + Block count : 25600 + Effective chunk size : 104857600 bytes + Skip chunk count : 9 (checks 10.00% of data) + +0 87a193d73a27aceb38334eca51d180493c9a2348 +10 2c2ceccb5ec5574f791d45b63c940cff20550f9a +20 2c2ceccb5ec5574f791d45b63c940cff20550f9a +30 6fdee2a737a0b4db519a70dc2ecd765a90a10bce +``` +Normally you use this on the "generating" side. + +You can also use it on the "checking" side: It will then just skip this number of hashes. This is usefull if you already generated a 100% list of checksums, but you only want to compare a smaller sample of it. + +Note: Keep in mind that if you use --skip on both sides, it will skip 2 times. If you use --skip=9 on both sides, the sender will only send 10% and the checker will only check 10% of that amount. (resulting in a coverage of 1%) \ No newline at end of file