>
> This brings up another question, partitioning. The above (I don't think)
> would work currently
> anyway due to the disks having to be partitioned out first (correct?). How
> hard would it be
> to have the raid code itself write the required partition information and
> whatever it requires
> to get a raw disk (which was marked as a hot spare) up and running?
I am interested more in the idea of automatically repartition a new blank disk
while it is hot-added.
A simple solution would be:
assume that all disks in the array are partitioned in the same way,
assume you have a command like
myraidhotadd /dev/md0 /dev/hdb
which does the following:
scans /etc/raidtab and sees wich disks are part of the md0 device
choses a a non-failed disk, for example /dev/hda
reads the partition-table from hda using fdisk /dev/hda <inputcommands
>outputfile
then myraidhotadd parses the contens of outputfile (partitiontable of hda), and
invokes fdisk on hdb
and recreates the exact partition table (perhaps deleting first eventual
partitions found on hdb)
finally you can run raidhotadd to add the disk to the array
The fun thing is that you can write this program with little effort because its
basically only parsing of text
and calling of external programs.
If I find some free time I will write such a script and post it here.
or am I reinventing the wheel ?
:-)
ciao
Benno.