From 3df0a0558182ce5597f00886cf17e4189a4b94c8 Mon Sep 17 00:00:00 2001 From: DatuX Date: Tue, 8 Mar 2022 18:38:30 +0100 Subject: [PATCH] Updated zfs check (markdown) --- zfs-check.md | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/zfs-check.md b/zfs-check.md index cb46601..174de3f 100644 --- a/zfs-check.md +++ b/zfs-check.md @@ -2,7 +2,7 @@ ## What does it do? -zfs-check is a tool to generate checksum streams of zfs datasets. (it also can be used on regular block devices and files) +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. @@ -16,6 +16,39 @@ In such cases the checksums are still OK, but they are of the wrong (corrupt) da So a tool to actually compare the data of 2 datasets was needed, hence zfs-check. +## How to use it? + +In its simplest form you can just use it on a directory like this: + +```shell +[root@pve1 ~]# zfs-check /bin --verbose |head -20 + zfs-check v3.2-alpha2 - (c)2022 E.H.Eefting (edwin@datux.nl) + + Target : /bin + Block size : 4096 bytes + Block count : 25600 + Effective chunk size : 104857600 bytes + Skip chunk count : 0 (checks 100.00% of data) + +smbtree 0 cec00f01df1064a98640e01b50c4030259c655bc +ls 0 605d772c98dd91c4df9a9200e63c5edf10cff4ce +cifsdd 0 11348b768b5f14234863c02392dcbe749d34bf91 +dh_bash-completion 0 9d17e0e071892ef43f1ae3fdb5abd40b5bb45252 +swtpm_localca 0 83b427c1ae0d91d46cd49db8ae31e2425e5de55a +dpkg-mergechangelogs 0 13ec450b69b525bc510bcf15f2409a647928fc43 +true 0 f490cefeec06ba345a5e53ec9814a9763a3330e9 +... +``` + +The output of this can then be used as input on another zfs-check. In this example we detected an error: + +```shell +[root@pve1 ~]# zfs-check /bin > checksums +[root@pve1 ~]# zfs-check /bin --check checksums +aa-enabled: Chunk 0 failed: c2a2be25e6c3a5d89005028ea37a61771489710a c2a2be25e6c3a5d89005028ea37a61771489710f +``` + +It displays the expected sha1sum vs the actual sha1sum)