On Sunday February 25, [EMAIL PROTECTED] wrote:
> Neil Brown wrote:
> > > OK, this time I really want to know how this should be handled.
> >
> > Well. it "should" be handled by re-writing various bits of raid code
> > to make it all work more easily, but without doing that it "could" be
> > handled by marking the partitions as hold raid componenets (0XFE I
> > think) and then booting a kernel with AUTODETECT_RAID enabled. This
> > approach ignores the device info in the superblock and finds
> > everything properly.
>
> I do not use partitions, the whole /dev/hdb and /dev/hdd are the RAID
> drives (mainly because fdisk was unhappy handling the 60GB drives). Is
> there a way to do the above marking in this situation? How?
No, without partitions, that idea falls through.
With 2.4, you could boot with
md=1,/dev/whatever,/dev/otherone
and it should build the array from the named drives.
There are ioctls available to do the same thing from user space, but
no user-level code has been released to use it yet.
The following patch, when applied to raidtools-0.90 should make
raidstart do the right thing, but I it is a while since I wrote this
code and I only did minimal testing.
NeilBrown
--- ./raidlib.c 2000/05/19 03:42:47 1.1
+++ ./raidlib.c 2000/05/19 06:53:04
@@ -149,6 +149,24 @@
return 0;
}
+static int do_newstart (int fd, md_cfg_entry_t *cfg)
+{
+ int i;
+ if (ioctl (fd, SET_ARRAY_INFO, 0UL)== -1)
+ return -1;
+ /* Ok, we have a new enough kernel (>2.3.99pre9?) */
+ for (i=0; i<cfg->array.param.nr_disks ; i++) {
+ struct stat s;
+ md_disk_info_t info;
+ stat(cfg->device_name[i], &s);
+ memset(&info, 0, sizeof(info));
+ info.major = major(s.st_rdev);
+ info.minor = minor(s.st_rdev);
+ ioctl(fd, ADD_NEW_DISK, (unsigned long)&info);
+ }
+ return (ioctl(fd, RUN_ARRAY, 0UL)!= 0);
+}
+
int do_raidstart_rw (int fd, char *dev)
{
int func = RESTART_ARRAY_RW;
@@ -380,10 +398,12 @@
{
struct stat s;
- stat (cfg->device_name[0], &s);
-
fd = open_or_die(cfg->md_name);
- if (do_mdstart (fd, cfg->md_name, s.st_rdev)) rc++;
+ if (do_newstart (fd, cfg)) {
+ stat (cfg->device_name[0], &s);
+
+ if (do_mdstart (fd, cfg->md_name, s.st_rdev)) rc++;
+ }
break;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to [EMAIL PROTECTED]