Re: partitionable md devices and partition detection

From: Neil Brown
Date: Wed Jul 07 2004 - 00:25:20 EST


On Wednesday July 7, chutz@xxxxxxx wrote:
> What is the proper way to detect the partitions on a md device during kernel
> initialization?

Hmm... I guess there isn't.
I remember having a lot of trouble getting partitions to be recognised
when an array is first assembled, and deciding it was just easier to
leave it to user-space. However that isn't an option when booting
without an initrd.

The following patch should make it work for the
md=d0,....
case. The "raid=part" case is a bit harder....

NeilBrown


diff ./init/do_mounts_md.c~current~ ./init/do_mounts_md.c
--- ./init/do_mounts_md.c~current~ 2004-07-07 15:20:05.000000000 +1000
+++ ./init/do_mounts_md.c 2004-07-07 15:20:57.000000000 +1000
@@ -232,6 +232,8 @@ static void __init md_setup_drive(void)
err = sys_ioctl(fd, RUN_ARRAY, 0);
if (err)
printk(KERN_WARNING "md: starting md%d failed\n", minor);
+ else
+ sys_ioctl(fd, BLKRRPART, 0);
sys_close(fd);
}
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/