Bug#664088: mdadm fails to initialize components for bitmap

karme at karme.de karme at karme.de
Sat May 12 12:46:25 UTC 2012


Markus Hochholdinger <Markus at hochholdinger.net> writes:

> Hello,
>
> for me there are no problems anymore using:
> ii  linux-image-3.2.0-2-686-pae          3.2.15-1                Linux 3.2 for 
> modern PCs
> ii  linux-image-3.2.0-2-amd64          3.2.15-1                Linux 3.2 for 
> 64-bit PCs
> ii  mdadm                                3.2.3-2                 tool to 
> administer Linux MD arrays (software RAID)
>
> I can do
>  mdadm --grow /dev/md0 --bitmap=none
>  mdadm --grow /dev/md0 --bitmap=internal
> now and the kernel keeps running.

finally got around to do some more testing
looks like it depends on the metadata version in use
using metadata 1.2 adding a bitmap to a raid created without bitmap
doesn't work:

#!/bin/bash -xe

function somefile()
{
    local F=$(tempfile)
    dd if=/dev/zero of=$F bs=4096 count=10000
    echo $F
}

function safedetach()
{
    local try=1
    while ! losetup -d $1; do
	echo retry $try
	try=[try+1];
	sleep 1
    done
}

function mdinfo()
{
    mdadm --misc --wait-clean /dev/md/mdtest || true
    mdadm --misc --detail /dev/md/mdtest
    mdadm --examine-bitmap $LA || true
}


A=$(somefile)
B=$(somefile)
LA=$(losetup --show -f $A)
LB=$(losetup --show -f $B)
echo $LA $LB
# using this it works:
#yes|mdadm --create mdtest --metadata=1.2 --assume-clean --raid-devices=2 --level=1 --bitmap-chunk=1M --bitmap internal $LA $LB
yes|mdadm --create mdtest --metadata=1.2 --assume-clean --raid-devices=2 --level=1 $LA $LB
sleep 1
cat /proc/mdstat
mdinfo
mkfs.ext4 /dev/md/mdtest
mdadm -v --grow /dev/md/mdtest -b none || true
mdinfo
mdadm -v --grow /dev/md/mdtest -b internal --bitmap-chunk=1M
mdinfo
hd /dev/md/mdtest|head -n 3
mdadm --stop /dev/md/mdtest
safedetach $LA
safedetach $LB
rm -v $A $B





More information about the pkg-mdadm-devel mailing list