The attached patch allows the md driver to be built as a module, and still use the raidautorun feature (basically, using RAID partition tagging (0xfd) and persistent RAID superblocks to autorun detected arrays at boot time). This was previously not possible. In the process, the patch also cleans up some unnecessary, and ugly, interdependencies between the partitioning code and the md driver. The patch should allow vendors to compile md as a module (saving roughly 50k in their default kernel images) without any loss in functionality. It would also allow other volume managers to use the RAID partition tagging to autodetect arrays (if desired). This patch has been tested for several days against 2.5.67/68 with an md/RAID5 root partition, which gets autorun at boot time (in the initrd). Feedback welcome. Please test, if you're interested. If the patch looks good, please apply. Thanks, Paul P.S., If anyone is interested, I've also got a patch for UnitedLinux mk_initrd to make it work properly with modular md and the 2.5 kernel (look for .ko modules, etc.).