Adds the --find-by-name option to find files by path instead than by inode.

This commit is contained in:
Andrea Mazzoleni 2011-10-09 23:41:08 +02:00
parent 1dbd801dcb
commit 191dcdf3d4
14 changed files with 356 additions and 32 deletions

View file

@ -7,6 +7,7 @@
==========
snapraid [-c, --conf CONFIG] [-f, --filter PATTERN]
[-N, --find-by-name]
[-Z, --force-zero] [-E, --force-empty]
[-s, --start BLKSTART] [-t, --count BLKCOUNT]
[-v, --verbose]
@ -253,6 +254,17 @@ SnapRAID provides the following options:
This option can be used many times.
In Unix, ensure to quote globbing chars if used.
-N, --find-by-name
When syncing finds the files by name instead than by inode.
This option allows a fast sync command after having replaced
one physical disk with another copying manually the files.
Without this option the 'sync' command would recognize that
the files were copied to a different disk, and will resync
them all. Instead, with this option a file with the correct
name, size and time will be assumed identical at the previous
one.
This option has effect only on the 'sync' and 'diff' commands.
-Z, --force-zero
Forces the insecure operation of syncing a file with zero
size that before was not.
@ -514,8 +526,72 @@ In Unix, when using globbing chars in the command line, you have to quote them.
Otherwise the shell will try to expand them.
9 CONTENT
=========
9 RECOVERING
============
The worst happened, and you lost a disk!
DO NOT PANIC! You will be able to recover it!
The first thing you have to do is to avoid futher changes at you disk array.
Disable any remote connections to it, any scheduled processes, including any
scheduled SnapRAID nightly sync.
Then proceed with the following steps.
---- 9.0.1 STEP 1 -> Reconfigure ----
You need some space to recover, even better if you have already an additional
disk, but in case also an external USB or remote one is enough.
Change the SnapRAID configuration and change the 'disk' directory
of the failed disk to point to the new empty space.
---- 9.0.2 STEP 2 -> Fix ----
Run the fix command, storing the log in an external file with:
snapraid fix 2>fix.log
This command will take a long time.
Take care that you need also few GB free to store the fix.log file, so run it
from a disk with some free space.
Now you have recovered all the recoverable. If some file is partly or totally
unrecoverable, it will be renamed adding the ".unrecoverable" extension.
You can get a detailed list of all the unrecoverable blocks in the fix.log file
checking all the lines starting with "unrecoverable:"
If you are not satified of the recovering, you can retry it as many time you wish.
For example, if you have moved away some files from other disks after the last 'sync',
you can retry to put them inplace, and retry the 'fix'.
If you are satisfied of the recovering, you can now proceed synching the array,
but take care that after synching you will no more able to retry the
'fix' command!
---- 9.0.3 STEP 3 -> Sync ----
Run the 'sync' command to resyncronize the array with the new disk.
To avoid a long time sync you have to use the '--find-by-name' option to
tell SnapRAID to ignore the fact that all the recovered files are now in
a different physical disk, and they don't need to be synched.
snapraid --find-by-name sync
If everything was recovered, this command is immediate.
---- 9.0.4 STEP 4 -> Check ----
As paranoid check, you can now run a whole 'check' command to ensure that
everything is OK.
snapraid check
This command will take a long time.
10 CONTENT
==========
SnapRAID stores the list and checksums of your files in the content file.
@ -528,24 +604,24 @@ for documentation.
This file is read and written by the "sync" command, and only read by
"fix" and "check".
9.1 blk_size SIZE
-----------------
10.1 blk_size SIZE
------------------
Defines the size of the block in bytes. It must match the size
defined in the configuration file.
9.2 checksum CHECKSUM
---------------------
10.2 checksum CHECKSUM
----------------------
Defines the checksum kind used. It can be "md5" or "murmur3".
9.3 map NAME INDEX
------------------
10.3 map NAME INDEX
-------------------
Defines the position INDEX of the disk NAME in the parity computation.
9.4 file DISK SIZE TIME INODE PATH
----------------------------------
10.4 file DISK SIZE TIME INODE PATH
-----------------------------------
Defines a file in the specified DISK.
@ -560,8 +636,8 @@ to recompute the parity.
The PATH information is used in the "check" and "fix" commands
to identify the file.
9.5 blk BLOCK HASH
------------------
10.5 blk BLOCK HASH
-------------------
Defines the ordered parity block list used by the last defined file.
@ -571,8 +647,8 @@ BLOCK is the block position in the "parity" 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.
9.6 inv BLOCK [HASH]
--------------------
10.6 inv BLOCK [HASH]
---------------------
Like "blk", but inform that the parity of this block is invalid.
@ -582,7 +658,7 @@ This field is used only when you interrupt manually the "sync"
command.
10 PARITY
11 PARITY
=========
SnapRAID stores the redundancy information of your array in the parity
@ -607,7 +683,7 @@ because it's the last block of a file, it's assumed as filled with 0
at the end.
11 ENCODING
12 ENCODING
===========
SnapRAID in Unix ignores any encoding. It simply read and stores the
@ -624,13 +700,13 @@ redirect the console output to a file, the resulting file is always
in the UTF-8 format.
12 COPYRIGHT
13 COPYRIGHT
============
This file is Copyright (C) 2011 Andrea Mazzoleni
13 SEE ALSO
14 SEE ALSO
===========
rsync(1)