sslug-teknik team mailing list archive
-
sslug-teknik team
-
Mailing list archive
-
Message #50411
Re: raidhotadd
On Fri, 2002-04-19 at 08:38, Anders H. Nielsen wrote:
> On Fri, 19 Apr 2002 01:45:23 +0200, Anders Nielsen wrote:
> > Som nævnt i en anden tråd vil jeg gerne anbefale mdadm, der (ifølge
> > linux-raid mailinglisten) kan klare dette problem på en noget fiksere
> > måde. Hvis det har interesse vil jeg gerne forwarde en beskrivelse til
> > denne liste....
>
> Jeg har netop hentet mdadm, da jeg kom til at tænke på din henvisning for
> nogle dage siden. Jeg vil se på den ..... - så snart jeg har lavet en
> backup :)
>
> /a
>
>
>
Jeg citerer lige en mail fra linux-raid. Bemærk, at mdctl nu hedder
mdadm og at spørgeren gerne vil gå fra 1 til 2 diske, men ellers er det
vist det samme. Jeg håber i øvrigt ikke det er / partitionen du vil
pille ved for så får du nok et problem med at unmounte den :-)
Du kan jo evt. prøve at starte med at have 2 diske "missing" og den ene
af dine nuværende diske med. Derefter kan du tilføje den nye og hvis det
går godt kan du tilføje disk nummer 2. Så har du jo automatisk en
backup.
Men måske er det alligevel en god ide alligevel med en "rigtig" backup
:-)
-- Anders Nielsen
On Thursday February 21, jr-list-linuxraid@xxxxxx wrote:
> I've got a problem. I created a RAID-1 array with only one drive by
using:
>
> mdctl --create /dev/md0 --level=1 --raid-disks=1 /dev/hda2
>
> Now, I've installed a second drive and want to add it to the array. So
I
> tried:
>
> mdctl -a /dev/md0 /dev/hdc2
>
> But this does not work as expected. It adds /dev/hdc2 to the list of
devices
> in /proc/mdstat:
>
> md0 : active raid1 hdc2[1] hda2[0]
> 6144768 blocks [1/1] [U]
>
> but it does not resync the array. I guess this has something to do
with the
> fact I originally specified --raid-disks=1. Can it be fixed without
> rebuilding the array from scratch (i.e. without data loss)?
Yes..... you said that you only ever wanted 1 disk in the raid-1
array. A pretty pointless configuration.
What you should have done is
mdctl --create /dev/md0 --level=1 --raid-disks=2 /dev/hda2 missing
to say that you want 2 disks, but the second one is currently
missing.
You can fix this without loosing data. Just stop the array and
re-create it with the correct information. The data on the drive will
not be lost.
So:
make sure that /dev/md0 is not mounted and not in use.
mdctl --stop /dev/md0
mdctl --create /dev/md0 --level=1 --raid-disks=2 /dev/hda2 missing
mdctl --add /dev/md0 /dev/hdc2
and all should be fine.
NeilBrown
References