From e449777417a48c38758efcd2e9d601ea0ebcf2df Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Sun, 19 Aug 2012 16:31:54 +0200 Subject: [PATCH] A note about -find-by-name and hard-links. --- TODO | 15 +++++++++++++++ snapraid.1 | 3 +++ snapraid.d | 3 +++ snapraid.txt | 3 +++ 4 files changed, 24 insertions(+) diff --git a/TODO b/TODO index 5010c90e..d6dbab8b 100644 --- a/TODO +++ b/TODO @@ -52,6 +52,21 @@ or check validity of data of existing ones. * Rename sync->backup and fix->restore. It seems to me a naming expressing better the meaning of the commands. But not yet sure. +* In the "interim" content file during sync, keep the full list of deleted +files, to be able to restore in case they are put back in their original position. +We use now the "hole/off" fields to represent this information, but we can define +a new "deleted (just like file)/blk,inv,chg,new" keeping the hash. +We must have all the "blk,inv,chg,new" options to be able to address delete file +starting from an interim content. +When recovering, the first try assuming updated parity, will ignore all the "deleted" +entries. The second one, will use them. +Possible problem is when a new file, overwrite part of the deleted ones. +We have to keep in memory different block? Duplicate blocks should be allocated +in a different way ? +In case we can lose the hash of the deleted ones, because we need only the +position in the disk. We use them only for recovering, so the block to be +recovcered will be checked with its own hash. + * When fixing, before overwriting the present file, make a copy of it just in case that the original file cannot be completely recovered. We can always open files in read-only mode, if a write is required, we close it, diff --git a/snapraid.1 b/snapraid.1 index aa9d64a7..1f9157b5 100644 --- a/snapraid.1 +++ b/snapraid.1 @@ -375,6 +375,9 @@ the files were copied to a different disk, and it will resync them all. With this option, a file with the correct path, size and time is assumed identical at the previous one, and not resynched. +Note that if you use this option, all the hard\(hylinks will be +stored independently wasting space. So, if you use hard\(hylinks, +it\(cqs better to don\(cqt use it. This option has effect only on the \(a"sync\(a" and \(a"diff\(a" commands. .TP .B \(hyZ, \(hy\(hyforce\(hyzero diff --git a/snapraid.d b/snapraid.d index 24c294be..2e227b86 100644 --- a/snapraid.d +++ b/snapraid.d @@ -255,6 +255,9 @@ Options them all. With this option, a file with the correct path, size and time is assumed identical at the previous one, and not resynched. + Note that if you use this option, all the hard-links will be + stored independently wasting space. So, if you use hard-links, + it's better to don't use it. This option has effect only on the "sync" and "diff" commands. -Z, --force-zero diff --git a/snapraid.txt b/snapraid.txt index b6a11737..73c39159 100644 --- a/snapraid.txt +++ b/snapraid.txt @@ -284,6 +284,9 @@ SnapRAID provides the following options: them all. With this option, a file with the correct path, size and time is assumed identical at the previous one, and not resynched. + Note that if you use this option, all the hard-links will be + stored independently wasting space. So, if you use hard-links, + it's better to don't use it. This option has effect only on the "sync" and "diff" commands. -Z, --force-zero