> is there a tool that can copy a partition table from one drive > and adapt it for another drive? I use dd. > In an ideal world both source and destination drive share the same geometry. > The partition table could easily be copied using sfdisk. or dd. but really, with LBA, most drives already use the same geometry; have you looked? 255 heads, 64 sectors/track, but a variable number of cylinders. which makes sense, since "rectangular" geometries have been lies for a long time (all drives have variable spt.) > What's this all for you might ask? > If one disc in a RAID1 array (without a preconfigured hot spare) fails, > I want to plug in a replacement disc and the rest should be handled > by some automatic system (partition the drive, hot-add it afterwards). this level of automaticity is normally considered bad because it has extremely unpleasant failure modes. (consider what happens if your sysadmin-assistant, low on coffee one monday morning, plugs in a drive which he *doesn't* want to be auto-sucked into the array...) does the devfs/hotplug mechanism let you trigger a script when a new drive appears? this would depend somewhat on the fabric - I suspect that scsi still needs an explicit rescan command. - To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html