Bug#465556: mdadm hotadd flag does not work in its shortform
Folken
folken at kabelsalat.ch
Sat Apr 12 10:47:23 UTC 2008
On Fri, 2008-04-11 at 13:40 +0200, martin f krafft wrote:
> tags 465556 unreproducible upstream
> thanks
>
> also sprach Philipp Wollschlegel <folken at kabelsalat.ch> [2008.02.13.0946 +0100]:
> > mdadm hotadd flag is not interpreted correctly:
> >
> > debian:/home/folken# mdadm --manage /dev/md1 -a /dev/sda2
> >
> > the return value of the above is 0. but the raiddevice is not
> > added to the device.
>
> I cannot reproduce this:
>
> lapse:/tmp/cdt.nnet6607> sudo losetup -f one #[1,305]
> lapse:/tmp/cdt.nnet6607> sudo losetup -f two #[306]
> lapse:/tmp/cdt.nnet6607> sudo mdadm -Cn2 -l1 /dev/md0 /dev/loop[01] #[307]
> mdadm: array /dev/md0 started.
> lapse:/tmp/cdt.nnet6607> sudo mdadm --set-faulty /dev/md0 /dev/loop1 #[308]
> mdadm: set /dev/loop1 faulty in /dev/md0
> lapse:/tmp/cdt.nnet6607> cat /proc/mdstat #[309]
> Personalities : [raid1]
> md0 : active raid1 loop1[2](F) loop0[0]
> 8128 blocks [2/1] [U_]
>
> unused devices: <none>
> lapse:/tmp/cdt.nnet6607> sudo mdadm --remove /dev/md0 /dev/loop1 #[310]
> mdadm: hot removed /dev/loop1
> lapse:/tmp/cdt.nnet6607> sudo mdadm -a /dev/md0 /dev/loop1; echo $? #[311]
> mdadm: re-added /dev/loop1
> 0
> lapse:/tmp/cdt.nnet6607> cat /proc/mdstat #[312]
> Personalities : [raid1]
> md0 : active raid1 loop1[1] loop0[0]
> 8128 blocks [2/2] [UU]
>
> unused devices: <none>
I tried it with the commands you entered and it works as long as the
second device added was once a member. (e.g. set faulty) it failes if
the md array is created initialy with missing keyword and is then added
with the manage command. Like so:
root at corsair:/tmp# for each in one two ; do dd if=/dev/zero of="${each}"
bs=1M count=50 ; done
50+0 records in
50+0 records out
52428800 bytes (52 MB) copied, 2.41071 seconds, 21.7 MB/s
50+0 records in
50+0 records out
52428800 bytes (52 MB) copied, 4.03959 seconds, 13.0 MB/s
root at corsair:/tmp# losetup /dev/loop0 one
root at corsair:/tmp# losetup /dev/loop1 two
root at corsair:/tmp# mdadm --create /dev/md2 -n 2 -l 1 /dev/loop0 missing
mdadm: array /dev/md2 started.
root at corsair:/tmp# mdadm --manage /dev/md2 -a /dev/loop1 ; echo $?
0
root at corsair:/tmp# mdadm --manage /dev/md2 --add /dev/loop1 ; echo $?
mdadm: added /dev/loop1
0
The hiccup seems not architecture specific, but seems to apply to
mdadm - v2.5.6 in general.
on mdadm - v2.6.4 - 19th October 2007 i wasn't able to reproduce it.
More information about the pkg-mdadm-devel
mailing list