Hi James,
>Well, the problem is that I have simulated a failure of half of the
>mirror, then put the disk back in (hot) and done "raidhotadd" the device
>was added again but with a different disk number and it would then not
>sync....
It's ok that the disk is added with another number. The disk entry for the
failed disk is kept around until synchronisatzin finished and then it's
swapped with the newly synchronized disk.
basically what should happen is this
1) working array:
--- wd:2 rd:2 nd:2
disk 0, s:0, o:1, n:0 rd:0 us:1 dev:hdb1
disk 1, s:0, o:1, n:1 rd:1 us:1 dev:hdb2
2) disk 1 failes and gets shut down
--- wd:1 rd:2 nd:2
disk 0, s:0, o:1, n:0 rd:0 us:1 dev:hdb1
disk 1, s:0, o:0, n:1 rd:1 us:1 dev:[dev 00:00]
3) you raidhotadd a new disk - it SHOULD now start to sync..
--- wd:1 rd:2 nd:3
disk 0, s:0, o:1, n:0 rd:0 us:1 dev:hdb1
disk 1, s:0, o:0, n:1 rd:1 us:1 dev:[dev 00:00]
disk 2, s:1, o:0, n:2 rd:2 us:1 dev:hdb3
4) syncronisation finished:
--- wd:2 rd:2 nd:2
disk 0, s:0, o:1, n:0 rd:0 us:1 dev:hdb1
disk 1, s:0, o:1, n:1 rd:1 us:1 dev:hdb3
>Is there a way to force a device to be a particular disk number, or is
>there another reason why it's not working?
raidhotadd adds the new disk as a spare, using the first available device
slot. only after synchronisatzin is the new disk swapped into the position
of the device it replaces.
>Also, I tried creating a raid1 with one disk (So as to reserve the space
>for the superblock and allow mirroring later)... it tried to resync and
>got itself stuck in a loop.
Nope, you can't do that with the stadard raid code; you'd need a patch to
a) allow creation of a single-disk mirror and
b) have some method to increase the number of devices in the mirror
afterwards. The raid device created in a) is perfectly happy running with
just one disk and won't use a second disk added as a spare.
I've done some work in this direction, current status is a patch to raid1.c
which allows you to do just what I described above - I posted the patch a
few days ago, see list archive if you want to play. Currently it's mostly a
"proof of concept", it needs to have an interface via raidhotadd /
raidhotremove so you can actually specify how you want a new device added.
also, it has to be adapted to raid5.
Bye, Martin
PS: no, I don't know why synchronisation doesn't start after adding a spare
disk to your device. Sorry.
--------------------------------------------------
Martin Bene vox: +43-664-3251047
simon media fax: +43-316-813824-6
Andreas-Hofer-Platz 9 e-mail: [EMAIL PROTECTED]
8010 Graz, Austria
--------------------------------------------------
finger [EMAIL PROTECTED] for PGP public key