1 |
From bcec3858a1ec660d7c9ea07beabdf3277d6459f4 Mon Sep 17 00:00:00 2001 |
From 0d8326177bf0508fcd3e5a3023496d94e85e2256 Mon Sep 17 00:00:00 2001 |
2 |
From: Shad L. Lords <slords@mail.com> |
From: Shad L. Lords <slords@mail.com> |
3 |
Date: Mon, 19 Oct 2009 08:08:43 -0600 |
Date: Mon, 19 Oct 2009 08:08:43 -0600 |
4 |
Subject: [PATCH] Allow creating/mounting degraded raid arrays |
Subject: [PATCH] Allow creating/mounting degraded raid arrays |
9 |
2 files changed, 44 insertions(+), 6 deletions(-) |
2 files changed, 44 insertions(+), 6 deletions(-) |
10 |
|
|
11 |
diff --git a/fsset.py b/fsset.py |
diff --git a/fsset.py b/fsset.py |
12 |
index 771a482..2682d2a 100644 |
index 54753a0..ea9ba66 100644 |
13 |
--- a/fsset.py |
--- a/fsset.py |
14 |
+++ b/fsset.py |
+++ b/fsset.py |
15 |
@@ -2460,11 +2460,20 @@ class RAIDDevice(Device): |
@@ -2466,11 +2466,20 @@ class RAIDDevice(Device): |
16 |
self.minor) |
self.minor) |
17 |
|
|
18 |
def raidTab (self, devPrefix='/dev'): |
def raidTab (self, devPrefix='/dev'): |
34 |
entry = entry + "chunk-size %s\n" %(self.chunksize,) |
entry = entry + "chunk-size %s\n" %(self.chunksize,) |
35 |
entry = entry + "persistent-superblock 1\n" |
entry = entry + "persistent-superblock 1\n" |
36 |
entry = entry + "nr-spare-disks %d\n" % (self.spares,) |
entry = entry + "nr-spare-disks %d\n" % (self.spares,) |
37 |
@@ -2474,6 +2483,10 @@ class RAIDDevice(Device): |
@@ -2480,6 +2489,10 @@ class RAIDDevice(Device): |
38 |
device) |
device) |
39 |
entry = entry + " raid-disk %d\n" % (i,) |
entry = entry + " raid-disk %d\n" % (i,) |
40 |
i = i + 1 |
i = i + 1 |
45 |
i = 0 |
i = 0 |
46 |
for device in [m.getDevice() for m in self.members[self.numDisks:]]: |
for device in [m.getDevice() for m in self.members[self.numDisks:]]: |
47 |
entry = entry + " device %s/%s\n" % (devPrefix, |
entry = entry + " device %s/%s\n" % (devPrefix, |
48 |
@@ -2486,6 +2499,15 @@ class RAIDDevice(Device): |
@@ -2492,6 +2505,15 @@ class RAIDDevice(Device): |
49 |
def devify(x): |
def devify(x): |
50 |
return "/dev/%s" %(x,) |
return "/dev/%s" %(x,) |
51 |
|
|
61 |
node = "%s/%s" % (devPrefix, self.device) |
node = "%s/%s" % (devPrefix, self.device) |
62 |
isys.makeDevInode(self.device, node) |
isys.makeDevInode(self.device, node) |
63 |
|
|
64 |
@@ -2498,12 +2520,18 @@ class RAIDDevice(Device): |
@@ -2504,12 +2526,18 @@ class RAIDDevice(Device): |
65 |
args = ["--create", "/dev/%s" %(self.device,), |
args = ["--create", "/dev/%s" %(self.device,), |
66 |
"--run", "--chunk=%s" %(self.chunksize,), |
"--run", "--chunk=%s" %(self.chunksize,), |
67 |
"--level=%s" %(self.level,), |
"--level=%s" %(self.level,), |