Updated zfs check (markdown)

DatuX
2022-03-08 18:38:30 +01:00
parent c21dba6148
commit 3df0a05581

@ -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)