Bug#705454: mdadm: --examine --scan generates wrong #spares
NeilBrown
neilb at suse.de
Mon May 6 08:03:39 UTC 2013
On Mon, 6 May 2013 09:22:42 +0200 (CEST) Thorsten Glaser <t.glaser at tarent.de>
wrote:
> On Wed, 1 May 2013, NeilBrown wrote:
>
> > "mdadm --examine --scan" looks at all devices, whether they are currently
> > attached to an md array or not. Maybe it found a device that looked like a
> > spare but isn't currently know to md.
>
> Doubtful…
>
> > What does "mdadm --examine --scan -v" show? It should list "dev=...." for
> > each array.
>
> This is totally wrong ;-)
>
> tglase at tglase:~ $ sudo mdadm --examine --scan -v
> ARRAY /dev/md0 level=raid1 num-devices=4 UUID=b4a6dcca:639ab49e:3cbfd189:3a086020
> spares=1 devices=/dev/sdb1,/dev/sde1,/dev/sdd1,/dev/sdc1,/dev/sda1
> ARRAY /dev/md1 level=raid10 num-devices=4 UUID=b1518a63:e8fe3e9f:3cbfd189:3a086020
> spares=2 devices=/dev/sdb2,/dev/sdb,/dev/sde2,/dev/sde,/dev/sdd2,/dev/sdd,/dev/sdc2,/dev/sdc,/dev/sda2,/dev/sda
It appears that your '2' partitions are at an offset of a multiple of 64K
from the start of the device. This is a serious problem for 0.90 metadata
and is one of the several reasons that 1.x metadata was introduced.
Both sda and sda2 look like they have the same superblock, because the
superblock is at the "end" of both. This can seriously confuse mdadm. It
would probably refuse to assemble the array unless you have a DEVICES line in
mdadm to tell it to ignore 'sda' etc.
"mdadm --examine --scan" sees the spare superblock twice, once at the end of
a partition and once at the end of a device. So it thinks it sees 2 spares.
If possible, I would suggest recreating the md1 array using 1.2 metadata.
NeilBrown
>
> I have /dev/sd{a,b,c,d,e}1 and /dev/sd{a,b,c,d,e}2 respectively.
>
> > Also you might be wanting 'mdadm --detail --scan' if you already have the
> > arrays assembled.
>
> Sure, this one is now the system booted after the move.
>
> tglase at tglase:~ $ sudo mdadm --detail --scan
> ARRAY /dev/md0 metadata=0.90 spares=1 UUID=b4a6dcca:639ab49e:3cbfd189:3a086020
> ARRAY /dev/md1 metadata=0.90 spares=1 UUID=b1518a63:e8fe3e9f:3cbfd189:3a086020
>
> Does that help any?
>
> bye,
> //mirabilos
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-mdadm-devel/attachments/20130506/22adbbe7/attachment-0003.pgp>
More information about the pkg-mdadm-devel
mailing list