A patch for Promise RAID1 broken
tan.ming at netstd.com
tan.ming at netstd.com
Thu Dec 23 14:53:02 UTC 2004
I have a Promise FastTrak100 raid card, and I have configured a RAID 1
driver without spare disk, and installed a Fedora Core 3 in another hard
disk. When I use the dmraid, it report find two raid 1 drivers, but both
are broken, the following is the error message:
dmraid -s -vv
ERROR: pdc: device /dev/hde broken in RAID set "pdc_acdgjjgge" [1/2]
ERROR: keeping degraded mirror set "pdc_acdgjjgge"
ERROR: pdc: device /dev/hdg broken in RAID set "pdc_bdbachbhfh" [1/2]
ERROR: keeping degraded mirror set "pdc_bdbachbhfh"
*** Set
name : pdc_acdgjjgge
size : 78150656
stride : 128
type : mirror
status : broken
subsets: 0
devs : 1
spares : 0
*** Set
name : pdc_bdbachbhfh
size : 78150656
stride : 128
type : mirror
status : broken
subsets: 0
devs : 1
spares : 0
I checked the code, and found that the name of raid driver is named by the
magic number of the raid disk, but the RAID1 contain two disks, have
different magic numbers, and the dmraid use the name to find the disks in
the same raid set, so the dmraid found two raid set, but both broken.
I modify the way of name the raid set, use all the disk magic number, and
tested successfully in my computer.
The following is the patch:
--- lib/format/ataraid/pdc.c.orig 2004-12-23 21:19:47.000000000
+0800
+++ lib/format/ataraid/pdc.c 2004-12-23 21:56:42.334972696 +0800
@@ -24,7 +24,14 @@ static const char *handler = HANDLER;
/* FIXME: better name ? */
static size_t _name(struct pdc *pdc, char *str, size_t len)
{
- return snprintf(str, len, "pdc_%u", pdc->magic_1) + 1;
+ int i, ret;
+
+ ret = snprintf(str, len, "pdc");
+ for (i = 0; i < pdc->raid.total_disks; i++) {
+ ret += snprintf(str + ret, len == 0 ? 0 : len - ret,
"_%8x",
+ pdc->raid.disk[i].magic_0);
+ }
+ return ret + 1;
}
static char *name(struct lib_context *lc, struct pdc *pdc, int type)
Merry Christmas.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/ataraid-list/attachments/20041223/7edff0dd/attachment.htm>
More information about the Ataraid-list
mailing list