From 359958c2cc5b6466bc1afd4f61509accb16b7d78 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Mon, 23 Jul 2001 23:14:52 +0000 Subject: make raid inconsistencies non fatal (#36985) --- raid.py | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'raid.py') diff --git a/raid.py b/raid.py index aa4f865b0..555b99eae 100644 --- a/raid.py +++ b/raid.py @@ -19,6 +19,7 @@ import _balkan import isys import os +from log import log def scanForRaid(drives): raidSets = {} @@ -51,9 +52,11 @@ def scanForRaid(drives): if knownLevel != level or knownDisks != totalDisks or \ knownMinor != mdMinor: # Raise hell - raise SystemError, ("raid set inconsistency for md%d: " - "all drives in this raid set do not " - "agree on raid parameters" % (mdMinor,)) + log("raid set inconsistency for md%d: " + "all drives in this raid set do not " + "agree on raid parameters. Skipping raid device", + mdMinor) + continue knownDevices.append(dev) raidSets[raidSet] = (knownLevel, knownDisks, knownMinor, knownDevices) @@ -62,10 +65,11 @@ def scanForRaid(drives): if raidDevices.has_key(mdMinor): if (raidDevices[mdMinor] != raidSet): - raise SystemError, ("raid set inconsistency for md%d: " - "found members of multiple raid sets " - "that claim to be md%d" - % (mdMinor, mdMinor)) + log("raid set inconsistency for md%d: " + "found members of multiple raid sets " + "that claim to be md%d. Using only the first " + "array found.", mdMinor, mdMinor) + continue else: raidDevices[mdMinor] = raidSet @@ -73,10 +77,11 @@ def scanForRaid(drives): for key in raidSets.keys(): (level, totalDisks, mdMinor, devices) = raidSets[key] if len(devices) < totalDisks: - str = ("missing components of raid device md%d. The " - "raid device needs %d drives and only %d were found." - % (mdMinor, len(devices), totalDisks)) - raise SystemError, str + log("missing components of raid device md%d. The " + "raid device needs %d drives and only %d were found. " + "This raid device will not be started.", mdMinor, + len(devices), totalDisks) + continue raidList.append((mdMinor, devices)) return raidList -- cgit