Restore the default scrub behaviour of the previous version

If the user like to scrub new blocks, he can now use the -p new
option, and then call again scrub with a percentage to scrub the
old blocks.

Scrubbing old and new blocks are two different operations, and make
sense to keep them separated. Mixing them could instead raise
problematic issues, like not being able to predict the time required
for a full scrub cycle, as it depends also on the amount of synced
data.
This commit is contained in:
Andrea Mazzoleni 2015-11-09 23:21:39 +01:00
parent 9f263b6fa8
commit 1917814d2d
9 changed files with 158 additions and 177 deletions

View file

@ -6,7 +6,7 @@ Synopsis
: [-f, --filter PATTERN] [-d, --filter-disk NAME]
: [-m, --filter-missing] [-e, --filter-error]
: [-a, --audit-only] [-h, --pre-hash] [-i, --import DIR]
: [-p, --percentage PERC|bad|sync|full]
: [-p, --percentage PERC|bad|new|full]
: [-o, --older-than DAYS] [-l, --log FILE]
: [-Z, --force-zero] [-E, --force-empty]
: [-U, --force-uuid] [-D, --force-device]
@ -171,7 +171,7 @@ Getting Started
This command verifies the data in your array comparing it with
the hash computed in the "sync" command.
Every run of the command checks the 15% of the array, but not data
Every run of the command checks the 12.5% of the array, but not data
already scrubbed in the previous 10 days.
You can use the -p, --percentage option to specify a different amount,
and the -o, --older-than option to specify a different age in days.
@ -482,26 +482,23 @@ Commands
Scrubs the array, checking for silent or input/output errors in data
and parity disks.
For each command invocation, the 15% of the array is checked, but
For each command invocation, the 12.5% of the array is checked, but
nothing that was already scrubbed in the last 10 days.
This means that scrubbing once a week, every bit of data is checked
at least one time every two months.
You can define a different scrub amount using the -p, --percentage
You can define a different scrub plan or amount using the -p, --percentage
option that takes as argument:
bad - Scrub blocks marked bad.
sync - Scrub new synced blocks never scrubbed.
new - Scrub just synced blocks not yet scrubbed.
full - Scrub everything.
0-100 - Scrub the exact percentage of blocks.
If you specify a percentage amount, you can also use the -o, --older-than
option to define how old the block should be.
If the specified amount doesn't allow a full scrub, the blocks are
scrubbed with this priority:
* First blocks marked as bad, to verify their status.
* Then new synced blocks never scrubbed, to verify if their
parity data was written correctly.
* And finally all the reimainig blocks, starting from ones with the oldest
scrub time.
The oldest blocks are scrubbed first ensuring an optimal check.
If instead you want to scrub the just synced blocks, not yet scrubbed,
you should use the "-p new" option.
To get the details of the scrub status use the "status" command.
@ -699,12 +696,12 @@ Options
errors during "sync" and "scrub", and listed in "status".
This option can be used only with "check" and "fix".
-p, --percentage PERC|bad|sync|full
Selects the part of the array to process in "scrub".
PERC is a numeric value from 0 to 100, default is 20.
Instead of a percentage, you can also specify the kind of scrub
you want: "bad" scrubs bad blocks, "sync" the blocks not yet
scrubbed, and "full" for everything.
-p, --percentage PERC|bad|new|full
Selects the scrub plan. If PERC is a numeric value from 0 to 100,
it's interpreted as the percentage of blocks to scrub.
Instead of a percentage, you can also specify a plan:
"bad" scrubs bad blocks, "new" the blocks not yet scrubbed,
and "full" for everything.
This option can be used only with "scrub".
-o, --older-than DAYS