From 1973c32f30def8062fa6c446fecb9390c5584453 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Mon, 4 Mar 2013 21:37:26 +0100 Subject: [PATCH] Allows 1 or 2 UUID change without the need of the -U option. --- snapraid.1 | 9 ++++----- snapraid.d | 9 ++++----- snapraid.txt | 9 ++++----- state.c | 2 +- 4 files changed, 13 insertions(+), 16 deletions(-) diff --git a/snapraid.1 b/snapraid.1 index 7a75fef9..da51d863 100644 --- a/snapraid.1 +++ b/snapraid.1 @@ -509,10 +509,13 @@ This option can be used only with the \(a"sync\(a" command. .B \(hyU, \(hy\(hyforce\(hyuuid Forces the insecure operation of syncing, checking and fixing with disks that have changed the UUID. -If SnapRAID detects that a disk has changed UUID, +If SnapRAID detects that some disks have changed UUID, it stops proceeding unless you specify this option. This allows to detect when your disks are mounted in the wrong mount points. +It\(cqs anyway allowed to have a single UUID change with +single parity, and two with double parity, because it\(cqs +the normal case of replacing disks. This option can be used only with the \(a"sync\(a", \(a"check\(a" or \(a"fix\(a" command. .TP @@ -939,10 +942,6 @@ Where NAME is the name of the disk, like \(a"d1\(a" as in our previous example. .PP This command will take a long time. .PP -If the command doesn\(cqt start complaining that the failed and replaced -disk has changed UUID, just add the \(cq\(hyU\(cq option. -But ensure that the failed disk is the only one with the UUID changed. -.PP You can also add the \(cq\(hyv\(cq option to see on the console the fixed files. .PP Take care that you need also few gigabytes free to store the fix.log file. diff --git a/snapraid.d b/snapraid.d index f4910a67..44f89835 100644 --- a/snapraid.d +++ b/snapraid.d @@ -366,10 +366,13 @@ Options -U, --force-uuid Forces the insecure operation of syncing, checking and fixing with disks that have changed the UUID. - If SnapRAID detects that a disk has changed UUID, + If SnapRAID detects that some disks have changed UUID, it stops proceeding unless you specify this option. This allows to detect when your disks are mounted in the wrong mount points. + It's anyway allowed to have a single UUID change with + single parity, and two with double parity, because it's + the normal case of replacing disks. This option can be used only with the "sync", "check" or "fix" command. @@ -661,10 +664,6 @@ Recovering This command will take a long time. - If the command doesn't start complaining that the failed and replaced - disk has changed UUID, just add the '-U' option. - But ensure that the failed disk is the only one with the UUID changed. - You can also add the '-v' option to see on the console the fixed files. Take care that you need also few gigabytes free to store the fix.log file. diff --git a/snapraid.txt b/snapraid.txt index 3b334bca..b6946f90 100644 --- a/snapraid.txt +++ b/snapraid.txt @@ -401,10 +401,13 @@ SnapRAID provides the following options: -U, --force-uuid Forces the insecure operation of syncing, checking and fixing with disks that have changed the UUID. - If SnapRAID detects that a disk has changed UUID, + If SnapRAID detects that some disks have changed UUID, it stops proceeding unless you specify this option. This allows to detect when your disks are mounted in the wrong mount points. + It's anyway allowed to have a single UUID change with + single parity, and two with double parity, because it's + the normal case of replacing disks. This option can be used only with the "sync", "check" or "fix" command. @@ -725,10 +728,6 @@ Where NAME is the name of the disk, like "d1" as in our previous example. This command will take a long time. -If the command doesn't start complaining that the failed and replaced -disk has changed UUID, just add the '-U' option. -But ensure that the failed disk is the only one with the UUID changed. - You can also add the '-v' option to see on the console the fixed files. Take care that you need also few gigabytes free to store the fix.log file. diff --git a/state.c b/state.c index b23bad0c..d5d35b86 100644 --- a/state.c +++ b/state.c @@ -727,7 +727,7 @@ static void state_map(struct snapraid_state* state) pathcpy(map->uuid, sizeof(map->uuid), uuid); } - if (!state->force_uuid && uuid_mismatch > 0) { + if (!state->force_uuid && uuid_mismatch > state->level) { fprintf(stderr, "Some disks have UUID changed from the latest 'sync'.\n"); fprintf(stderr, "If this happens because you really replaced them,\n"); fprintf(stderr, "you can '%s' anyway, using 'snapraid --force-uuid %s'.\n", state->command, state->command);