Ingo Molnar wrote:
> On Mon, 26 Apr 1999, Benno Senoner wrote:
>
> > I am interested more in the idea of automatically repartition a new blank disk
> > while it is hot-added.
>
> no need to do this in the kernel (or even in raidtools). I use such
> scripts to 'mass-create' partitioned disks:
that's ok,
but it's not unsafe to overwrite the partition-table of disks which are actually
part of
a soft-raid array and in use ?
I think for hot-adding it would be better to use a script which takes as parameter
the disk
you want to partition, and partition only this disk.
An other idea would be , reading the partiton-table of a non-failed disk part of
the
array and recreate this partiton on the new disk.
or a 3rd possiblity would be creating a nice cmdline tool,
where you give the following informations:
the disks which you want to include in the array
and how much space of the disk you want to use for the array.
then the tool partition all disks and write a sort of "template" script for fdisk
so that you can write a wrapper for raidhotadd which first calls this script
before doing the hot-add.
opinions ?
regards,
Benno.
>
>
> [root@moon root]# cat dobigsd
>
> if [ "$#" -ne "1" ]; then
> echo 'sample usage: dobigsd sda'
> exit -1
> fi
>
> echo "*** DESTROYING /dev/$1 in 5 seconds!!! ***"
> sleep 5
> dd if=/dev/zero of=/dev/$1 bs=1024k count=1
> (for N in `cat domanydisks`; do echo $N; done) | fdisk /dev/$1
>
> [root@moon root]# cat domanydisks
> n e 1 1 200
> n l 1 25
> n l 26 50
> n l 51 75
> n l 76 100
> n l 101 125
> n l 126 150
> n l 151 175
> n l 176 200
> n p 2 300 350
> n p 3 350 400
> n p 4 450 500
> t 2 86
> t 3 83
> t 4 83
> t 5 83
> t 6 83
> t 7 83
> t 8 83
> t 9 83
> t 10 83
> t 11 83
> t 12 83
> w
>
> thats all, fdisk is happy to be put into scripts.
>
> -- mingo