Initial RAID6 support. Not yet complete.

Uses Murmur3 as default hash.
Check now returns and error even if only recoverable errors are present.
This commit is contained in:
Andrea Mazzoleni 2011-04-23 21:38:26 +02:00
parent ad70b7e560
commit 08831c6641
24 changed files with 1624 additions and 394 deletions

View file

@ -8,13 +8,13 @@ Synopsis
: [-v, --verbose]
: COMMAND
:snapraid [-V, --version] [-h, --help] [-T, --speed-test]
:snapraid [-V, --version] [-h, --help]
Description
SnapRAID is a backup program for a disk array using redundancy.
SnapRAID uses a disk of the array to store redundancy information,
and it allows to recover from a disk failure.
and it allows to recover from up to two disk failures.
SnapRAID is mainly targeted for a home media center, where you have
a lot of big files that rarely change.
@ -27,7 +27,7 @@ Description
* You can add more disks at the array at any time.
* If you accidentally delete some files in a disk, you can
recover them.
* If more than one disk fails, you lose the data only on the
* If more than two disk fails, you lose the data only on the
failed disks. All the data in the other disks is safe.
* It doesn't lock-in your data. You can stop using SnapRAID at any
time without the need to reformat or move data.
@ -63,7 +63,7 @@ Limitations
With RAID you get a speed boost with striping.
* It doesn't support real-time recovery.
With RAID you do not have to stop working when a disk fails.
* It's able to recover damages only from a single disk.
* It's able to recover damages only from up to two disks.
With a Backup you are able to recover from a complete
failure of the whole disk array.
* It identifies changes checking file time and size. If you have
@ -74,17 +74,24 @@ Limitations
Getting Started
To use SnapRAID you need first select one disk of your disk array
to dedicate at the redundancy information.
to dedicate at the parity information. With parity you will be able
to recover from a single disk failure.
You have to pick the biggest disk in the array, as the redundancy
information may grow in size as the biggest data disk in the array.
If you want to recover from two disk failures you must reserve
another disk for the q-parity information.
This disk will be dedicated to store the parity and content metadata
information. You should not store other data on it.
For both disks, you have to pick the biggest disks in the array,
as the redundancy information may grow in size as the biggest data
disk in the array.
For example, if all your disks are present in:
This disk will be dedicated to store the parity and q-parity.
You should not store other data on it, with the exception of
the content metadata information.
:/mnt/diskpar <- selected disk for parity and metadata content
For example, suppose that you are interested only at the parity level
of protection, and that all your disks are present in:
:/mnt/diskpar <- selected disk for parity
:/mnt/disk1 <- first disk to backup
:/mnt/disk2 <- second disk to backup
:/mnt/disk3 <- third disk to backup
@ -157,7 +164,7 @@ Commands
any redundancy recomputation.
You can stop this process at any time pressing Ctrl+C,
without losing the work already done.
The "content" and "parity" files are modified if necessary.
The "content", "parity" and "q-parity" files are modified if necessary.
The files in the array are NOT modified.
=check
@ -174,7 +181,7 @@ Commands
After a successful "fix", you should also run a "sync"
command to update the new state of the files.
The "content" file is NOT modified.
The "parity" file is modified if necessary.
The "parity" and "q-parity" files are modified if necessary.
The files in the array are modified if necessary.
Options
@ -214,17 +221,11 @@ Options
-t, --count BLKCOUNT
Process only the specified number of blocks.
It's present mainly for testing.
It's present mainly for advanced manual recovering.
-v, --verbose
Prints more information in the processing.
-T, --speed-test
Executes a speed test of the MD5 implementation used.
If available, SnapRAID uses the fast MD5 implementation
from the OpenSSL crypto library. Otherwise it uses a
slower C implementation.
-h, --help
Prints a short help screen.
@ -239,19 +240,29 @@ Configuration
it should contains the following options:
=parity FILE
Defines the file to use to store the redundancy information.
Defines the file to use to store the parity information.
It must be placed in a disk dedicated for this purpose with
as much free space as the biggest disk in the array.
Leaving the parity disk reserved for only this file, ensures that
it doesn't get fragmented, improving the performance.
This option can be used only one time.
This option is mandatory and it can be used only one time.
=q-parity FILE
Defines the file to use to store the q-parity information.
This option is optional, and if present it enables the protection
from two disk failures.
It must be placed in a disk dedicated for this purpose with
as much free space as the biggest disk in the array.
Leaving the q-parity disk reserved for only this file, ensures that
it doesn't get fragmented, improving the performance.
This option is optional and it can be used only one time.
=content FILE
Defines the file to use to store the content of the redundancy
organization.
It can be placed in the same disk of the parity file, or better
in another disk, but NOT in a data disk of the array.
This option can be used only one time.
This option is mandatory and it can be used only one time.
=disk NAME DIR
Defines the name and the mount point of the disks of the array.
@ -379,7 +390,7 @@ Content
Defines the ordered parity block list used by the last defined file.
BLOCK is the block position in the "parity" file.
0 for the first block, 1 for the second one and so on.
HASH is the md5 of the block. In the last block of the file,
HASH is the hash of the block. In the last block of the file,
the HASH is the hash of only the used part of the block.
=inv BLOCK [HASH]
@ -389,18 +400,20 @@ Content
command.
Parity
SnapRAID creates a parity file containing the redundancy information
of your disk array.
SnapRAID creates the parity and q-parity files containing the redundancy
information of your disk array.
It's a binary file, containing the computed parity of all the blocks
defined in the "content" file. You do not need to understand its format,
but it's described here for documentation.
They are binary files, containing the computed redundancy of all the
blocks defined in the "content" file. You do not need to understand its
format, but it's described here for documentation.
This file is read and written by the "sync" and "fix" commands, and
These files are read and written by the "sync" and "fix" commands, and
only read by "check".
For all the blocks at a given position, the parity information is
computed with the XOR operator applied to all the blocks.
For all the blocks at a given position, the parity and the q-parity
are computed as specified in:
:kernel.org/pub/linux/kernel/people/hpa/raid6.pdf
When a file block is shorter than the default block size, for example
because it's the last block of a file, it's assumed as filled with 0